[pgsqlclient-checkins] pgsqlclient_10/PgSqlClient.Security.Tls/source TlsSession.cs,1.18,1.19
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-09-30 09:23:48
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv12727 Modified Files: TlsSession.cs Log Message: - Added exception Handling to Open & Close methods. - Reset isSecure field in closeStreams method. Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSession.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TlsSession.cs 16 Sep 2003 12:28:28 -0000 1.18 --- TlsSession.cs 30 Sep 2003 09:23:45 -0000 1.19 *************** *** 153,177 **** public void Open() { ! this.socket.DoHandshake(); } public void Close() { ! if (isSecure) { ! TlsCloseNotifyAlert alert = new TlsCloseNotifyAlert(this); ! // Write close notify ! this.socket.SendAlert(alert); ! // Check that the session is finished by the client and by server ! if (!this.context.ConnectionEnd) ! { ! throw new TlsException("Invalid session termination"); } } ! ! // Close streams ! closeStreams(); } --- 153,198 ---- public void Open() { ! try ! { ! this.socket.DoHandshake(); ! } ! catch (TlsException ex) ! { ! throw ex; ! } ! catch (Exception ex) ! { ! this.closeStreams(); ! throw ex; ! } } public void Close() { ! try { ! if (isSecure) ! { ! TlsCloseNotifyAlert alert = new TlsCloseNotifyAlert(this); ! // Write close notify ! this.socket.SendAlert(alert); ! // Check that the session is finished by the client and by server ! if (!this.context.ConnectionEnd) ! { ! throw new TlsException("Invalid session termination"); ! } } } ! catch (Exception ex) ! { ! throw ex; ! } ! finally ! { ! // Close streams ! closeStreams(); ! } } *************** *** 276,279 **** --- 297,301 ---- // Reset session information + this.isSecure = false; this.helloDone = false; this.handshakeFinished = false; |