[pgsqlclient-checkins] pgsqlclient_10/PgSqlClient.Security.Tls/source TlsSession.cs,1.24,1.25 TlsSes
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-10-10 18:15:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv8602 Modified Files: TlsSession.cs TlsSessionContext.cs TlsSocket.cs Log Message: Reworked Handshake Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSession.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** TlsSession.cs 9 Oct 2003 19:50:34 -0000 1.24 --- TlsSession.cs 10 Oct 2003 18:15:21 -0000 1.25 *************** *** 159,163 **** try { ! this.state = TlsSessionState.OpeningSecure; this.socket.DoHandshake(); } --- 159,164 ---- try { ! this.context.Protocol = settings.Protocol; ! this.state = TlsSessionState.OpeningSecure; this.socket.DoHandshake(); } Index: TlsSessionContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSessionContext.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsSessionContext.cs 9 Oct 2003 08:54:55 -0000 1.4 --- TlsSessionContext.cs 10 Oct 2003 18:15:21 -0000 1.5 *************** *** 30,33 **** --- 30,36 ---- #region FIELDS + // Protocol version + private TlsProtocol protocol; + // Information sent and request by the server in the Handshake protocol private TlsServerSettings serverSettings; *************** *** 63,66 **** --- 66,75 ---- #region PROPERTIES + public TlsProtocol Protocol + { + get { return protocol; } + set { protocol = value; } + } + public TlsServerSettings ServerSettings { *************** *** 170,173 **** --- 179,183 ---- public TlsSessionContext() { + this.protocol = TlsProtocol.Tls1; this.serverSettings = new TlsServerSettings(); this.handshakeHashes = new TlsHandshakeHashes(); Index: TlsSocket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSocket.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TlsSocket.cs 10 Oct 2003 15:41:06 -0000 1.12 --- TlsSocket.cs 10 Oct 2003 18:15:21 -0000 1.13 *************** *** 201,205 **** // Check that the message as a valid protocol version ! if (protocol != TlsProtocol.Tls1) { throw session.CreateException("Invalid protocol version on message received from server"); --- 201,205 ---- // Check that the message as a valid protocol version ! if (protocol != session.Context.Protocol) { throw session.CreateException("Invalid protocol version on message received from server"); *************** *** 343,347 **** private int sendRecord(TlsHandshakeType type) { ! TlsClientHandshakeMessage msg = createClientHandshakeMessage(type); // Write record --- 343,347 ---- private int sendRecord(TlsHandshakeType type) { ! TlsHandshakeMessage msg = createClientHandshakeMessage(type); // Write record *************** *** 453,457 **** { TlsHandshakeType handshakeType = (TlsHandshakeType)handMsg.ReadByte(); ! TlsServerHandshakeMessage message = null; message = createServerHandshakeMessage(handshakeType, handMsg); --- 453,457 ---- { TlsHandshakeType handshakeType = (TlsHandshakeType)handMsg.ReadByte(); ! TlsHandshakeMessage message = null; message = createServerHandshakeMessage(handshakeType, handMsg); *************** *** 629,633 **** } ! private TlsClientHandshakeMessage createClientHandshakeMessage(TlsHandshakeType type) { switch (type) --- 629,633 ---- } ! private TlsHandshakeMessage createClientHandshakeMessage(TlsHandshakeType type) { switch (type) *************** *** 653,657 **** } ! private TlsServerHandshakeMessage createServerHandshakeMessage(TlsHandshakeType type, TlsStreamReader handMsg) { switch (type) --- 653,657 ---- } ! private TlsHandshakeMessage createServerHandshakeMessage(TlsHandshakeType type, TlsStreamReader handMsg) { switch (type) |