pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 32)
Status: Inactive
Brought to you by:
carlosga_fb
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(120) |
Aug
(95) |
Sep
(95) |
Oct
(213) |
Nov
(114) |
Dec
(64) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(6) |
Feb
(134) |
Mar
(88) |
Apr
(28) |
May
(22) |
Jun
(15) |
Jul
(23) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(6) |
Dec
|
2005 |
Jan
(8) |
Feb
(6) |
Mar
|
Apr
(42) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(84) |
Apr
(46) |
May
(40) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <car...@us...> - 2003-11-17 09:13:24
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv19050 Modified Files: PgCommand.cs Log Message: 2003-11-17 Carlos Guzmán Álvarez <car...@te...> * source/PgCommand.cs: - Restricted batch command execution to ExecuteReader calls . Prepare, ExecuteNonquery and ExecuteScalar calls will handle the command text as a single SQL command. Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PgCommand.cs 10 Nov 2003 12:11:25 -0000 1.12 --- PgCommand.cs 17 Nov 2003 09:12:43 -0000 1.13 *************** *** 72,76 **** this.commandText = value; this.actualCommand = 0; ! this.splitBatchCommands(); } } --- 72,76 ---- this.commandText = value; this.actualCommand = 0; ! this.commands = null; } } *************** *** 317,320 **** --- 317,321 ---- this.checkCommand(); + this.splitBatchCommands(false); this.InternalPrepare(); this.InternalExecute(); *************** *** 346,349 **** --- 347,351 ---- commandBehavior = behavior; + this.splitBatchCommands(true); this.InternalPrepare(); *************** *** 366,369 **** --- 368,372 ---- object returnValue = null; + this.splitBatchCommands(false); this.InternalPrepare(); this.InternalExecute(); *************** *** 381,384 **** --- 384,388 ---- this.checkCommand(); + this.splitBatchCommands(false); this.InternalPrepare(); this.connection.ActiveCommands.Add(this); *************** *** 692,709 **** } ! private void splitBatchCommands() { ! MatchCollection matches = Regex.Matches( ! this.commandText, ! "([^';]+('[^']*'))*[^';]*(?=;*)"); ! ! commands = new string[matches.Count/2]; ! int count = 0; ! for (int i = 0; i < matches.Count; i++) { ! if (matches[i].Value.Trim() != String.Empty) { ! this.commands[count] = matches[i].Value.Trim(); ! count++; } } --- 696,723 ---- } ! private void splitBatchCommands(bool batchAllowed) { ! if (this.commands == null) { ! if (batchAllowed) { ! MatchCollection matches = Regex.Matches( ! this.commandText, ! "([^';]+('[^']*'))*[^';]*(?=;*)"); ! ! this.commands = new string[matches.Count/2]; ! int count = 0; ! for (int i = 0; i < matches.Count; i++) ! { ! if (matches[i].Value.Trim() != String.Empty) ! { ! this.commands[count] = matches[i].Value.Trim(); ! count++; ! } ! } ! } ! else ! { ! this.commands = new string[]{this.commandText}; } } |
From: <car...@us...> - 2003-11-14 13:45:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv18204 Modified Files: changelog.txt Log Message: 2003-11-14 Carlos Guzmán Álvarez <car...@te...> * source/NPgClient/PgDbClient.cs: * Added changes for make use of the new scema of the SSL/TLS library. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** changelog.txt 13 Nov 2003 12:22:23 -0000 1.72 --- changelog.txt 14 Nov 2003 13:45:06 -0000 1.73 *************** *** 2,5 **** --- 2,12 ---- ------------------------------------------------------- + 2003-11-14 Carlos Guzmán Álvarez <car...@te...> + + * source/NPgClient/PgDbClient.cs: + + * Added changes for make use of the new scema of the SSL/TLS library. + + 2003-11-12 Carlos Guzmán Álvarez <car...@te...> |
From: <car...@us...> - 2003-11-14 13:44:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1:/tmp/cvs-serv18087 Modified Files: PgDbClient.cs Log Message: 2003-11-14 Carlos Guzmán Álvarez <car...@te...> * source/NPgClient/PgDbClient.cs: * Added changes for make use of the new scema of the SSL/TLS library. Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** PgDbClient.cs 12 Nov 2003 22:38:32 -0000 1.31 --- PgDbClient.cs 14 Nov 2003 13:44:23 -0000 1.32 *************** *** 51,60 **** private int secretKey; private Hashtable parameterStatus; private BinaryReader receive; private BinaryWriter send; - private PgConnectionParams settings; - private char transactionStatus; - private TlsSession session; private PgResponsePacket buffer; #endregion --- 51,62 ---- private int secretKey; private Hashtable parameterStatus; + private Socket socket; + private NetworkStream networkStream; + private SslClientStream sslStream; private BinaryReader receive; private BinaryWriter send; private PgResponsePacket buffer; + private PgConnectionParams settings; + private char transactionStatus; #endregion *************** *** 137,158 **** PgDbClient.InitializeTypes(); PgDbClient.InitializeCharSets(); lock (this) { - // Configure TLS Session Settings - TlsSessionSettings tlsSettings = new TlsSessionSettings(); - - tlsSettings.Protocol = SecurityProtocolType.Tls1; - tlsSettings.CompressionMethod = SecurityCompressionType.None; - tlsSettings.ServerName = settings.ServerName; - tlsSettings.ServerPort = settings.ServerPort; - - // Create a new TLS Session - session = new TlsSession(tlsSettings); - - // Create objects for read & write - receive = new BinaryReader(session.NetworkStream); - send = new BinaryWriter(session.NetworkStream); - if (settings.SSL) { --- 139,147 ---- PgDbClient.InitializeTypes(); PgDbClient.InitializeCharSets(); + + initializeSocket(); lock (this) { if (settings.SSL) { *************** *** 162,177 **** if (settings.SSL) { ! try ! { ! // Start TLS Session ! session.Open(); ! } ! catch (TlsException ex) ! { ! // If the exception is fatal close connection ! session.Close(); ! throw new PgClientException(ex.Message); ! } } } --- 151,162 ---- if (settings.SSL) { ! sslStream = new SslClientStream( ! networkStream, ! settings.ServerName, ! true, ! SecurityProtocolType.Default); ! receive = new BinaryReader(sslStream); ! send = new BinaryWriter(sslStream); } } *************** *** 202,208 **** } } catch (PgClientException ex) { ! session.Close(); throw ex; } --- 187,207 ---- } } + catch (TlsException ex) + { + // If the exception is fatal close connection + sslStream.Close(); + + throw new PgClientException(ex.Message); + } catch (PgClientException ex) { ! if (sslStream != null) ! { ! sslStream.Close(); ! } ! if (networkStream != null) ! { ! networkStream.Close(); ! } throw ex; } *************** *** 217,222 **** SendData(packet.GetPacketBytes(PgFrontEndCodes.TERMINATE)); ! // End session ! session.Close(); } catch (PgClientException ex) --- 216,232 ---- SendData(packet.GetPacketBytes(PgFrontEndCodes.TERMINATE)); ! // Close streams ! if (sslStream != null) ! { ! sslStream.Close(); ! } ! if (networkStream != null) ! { ! networkStream.Close(); ! } ! } ! catch (TlsException ex) ! { ! throw new PgClientException(ex.Message); } catch (PgClientException ex) *************** *** 784,787 **** --- 794,827 ---- { return new PgStatement(this, parseName, portalName, stmtText); + } + + #endregion + + #region PRIVATE_METHODS + + private void initializeSocket() + { + IPAddress hostadd = Dns.Resolve(settings.ServerName).AddressList[0]; + IPEndPoint EPhost = new IPEndPoint(hostadd, settings.ServerPort); + + this.socket = new Socket(AddressFamily.InterNetwork, + SocketType.Stream, + ProtocolType.IP); + + // Set Receive Buffer size. + socket.SetSocketOption(SocketOptionLevel.Socket, + SocketOptionName.ReceiveBuffer, settings.PacketSize); + + // Set Send Buffer size. + socket.SetSocketOption(SocketOptionLevel.Socket, + SocketOptionName.SendBuffer, settings.PacketSize); + + // Make the socket to connect to the Server + this.socket.Connect(EPhost); + this.networkStream = new NetworkStream(socket, true); + + // Create objects for read & write + this.receive = new BinaryReader(this.networkStream); + this.send = new BinaryWriter(this.networkStream); } |
From: <car...@us...> - 2003-11-14 13:43:20
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv17896 Modified Files: changelog.txt Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. The next files are no more needed: - TlsSession.cs - TlsNetworkStream.cs - TlsSocket.cs - TlsSessionState.cs The next files are renamed: - TlsSessionSettings.cs -> TlsClientSettings.cs - TlsSessionContext.cs -> TlsContext.cs The next files are new: - SslClientStream.cs ( the name is non definitive yet ) The next files where changed to reflect the new canges: - TlsHandshakeMessage.cs - TlsClientCertificate.cs - TlsClientCertificateVerify.cs - TlsClientFinished.cs - TlsClientHello.cs - TlsClientKeyExchange.cs - TlsServerCertificate.cs - TlsServerCertificateRequest.cs - TlsServerFinished.cs - TlsServerHello.cs - TlsServerHelloDone.cs - TlsServerKeyExchange.cs - TlsAlert.cs - TlsCloseNotifyAlert.cs Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/changelog.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** changelog.txt 13 Nov 2003 09:24:04 -0000 1.10 --- changelog.txt 14 Nov 2003 13:43:11 -0000 1.11 *************** *** 4,10 **** 2003-11-13 Carlos Guzmán Álvarez <car...@te...> ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> --- 4,59 ---- 2003-11-13 Carlos Guzmán Álvarez <car...@te...> ! * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. ! ! The next files are no more needed: ! ! - TlsSession.cs ! ! - TlsNetworkStream.cs ! ! - TlsSocket.cs ! ! - TlsSessionState.cs ! ! The next files are renamed: ! ! - TlsSessionSettings.cs -> TlsClientSettings.cs ! ! - TlsSessionContext.cs -> TlsContext.cs ! ! The next files are new: ! ! - SslClientStream.cs ( the name is non definitive yet ) ! ! The next files where changed to reflect the new canges: ! ! - TlsHandshakeMessage.cs ! ! - TlsClientCertificate.cs ! ! - TlsClientCertificateVerify.cs ! ! - TlsClientFinished.cs ! ! - TlsClientHello.cs ! ! - TlsClientKeyExchange.cs ! ! - TlsServerCertificate.cs ! ! - TlsServerCertificateRequest.cs ! ! - TlsServerFinished.cs ! ! - TlsServerHello.cs ! ! - TlsServerHelloDone.cs ! ! - TlsServerKeyExchange.cs ! ! - TlsAlert.cs ! ! - TlsCloseNotifyAlert.cs ! 2003-11-12 Carlos Guzmán Álvarez <car...@te...> |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1:/tmp/cvs-serv17834 Modified Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHello.cs TlsClientKeyExchange.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHello.cs TlsServerHelloDone.cs TlsServerKeyExchange.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. The next files are no more needed: - TlsSession.cs - TlsNetworkStream.cs - TlsSocket.cs - TlsSessionState.cs The next files are renamed: - TlsSessionSettings.cs -> TlsClientSettings.cs - TlsSessionContext.cs -> TlsContext.cs The next files are new: - SslClientStream.cs ( the name is non definitive yet ) The next files where changed to reflect the new canges: - TlsHandshakeMessage.cs - TlsClientCertificate.cs - TlsClientCertificateVerify.cs - TlsClientFinished.cs - TlsClientHello.cs - TlsClientKeyExchange.cs - TlsServerCertificate.cs - TlsServerCertificateRequest.cs - TlsServerFinished.cs - TlsServerHello.cs - TlsServerHelloDone.cs - TlsServerKeyExchange.cs - TlsAlert.cs - TlsCloseNotifyAlert.cs Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsClientCertificate.cs 3 Nov 2003 16:21:25 -0000 1.9 --- TlsClientCertificate.cs 14 Nov 2003 13:42:54 -0000 1.10 *************** *** 33,38 **** #region CONSTRUCTORS ! public TlsClientCertificate(TlsSession session) ! : base(session, TlsHandshakeType.Certificate, TlsContentType.Handshake) { } --- 33,38 ---- #region CONSTRUCTORS ! public TlsClientCertificate(TlsContext context) ! : base(context, TlsHandshakeType.Certificate, TlsContentType.Handshake) { } *************** *** 59,71 **** protected override void ProcessAsTls1() { ! if (Session.Settings.Certificates == null || ! Session.Settings.Certificates.Count == 0) { ! throw this.Session.CreateException("Client certificate requested by the server and no client certificate specified."); } // Write client certificates information to a stream TlsStream stream = new TlsStream(); ! foreach (X509Certificate cert in Session.Settings.Certificates) { stream.WriteInt24(cert.GetRawCertData().Length); --- 59,71 ---- protected override void ProcessAsTls1() { ! if (this.Context.ClientSettings.Certificates == null || ! this.Context.ClientSettings.Certificates.Count == 0) { ! throw this.Context.CreateException("Client certificate requested by the server and no client certificate specified."); } // Write client certificates information to a stream TlsStream stream = new TlsStream(); ! foreach (X509Certificate cert in this.Context.ClientSettings.Certificates) { stream.WriteInt24(cert.GetRawCertData().Length); Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TlsClientCertificateVerify.cs 13 Nov 2003 09:23:50 -0000 1.11 --- TlsClientCertificateVerify.cs 14 Nov 2003 13:42:54 -0000 1.12 *************** *** 35,40 **** #region CONSTRUCTORS ! public TlsClientCertificateVerify(TlsSession session) ! : base(session, TlsHandshakeType.Finished, TlsContentType.Handshake) { } --- 35,40 ---- #region CONSTRUCTORS ! public TlsClientCertificateVerify(TlsContext context) ! : base(context, TlsHandshakeType.Finished, TlsContentType.Handshake) { } *************** *** 61,65 **** protected override void ProcessAsTls1() { ! foreach (X509Certificate cert in Session.Settings.Certificates) { MD5SHA1 hash = new MD5SHA1(); --- 61,65 ---- protected override void ProcessAsTls1() { ! foreach (X509Certificate cert in this.Context.ClientSettings.Certificates) { MD5SHA1 hash = new MD5SHA1(); *************** *** 69,73 **** TlsStream data = new TlsStream(); ! data.Write(this.Session.Context.RandomCS); data.Write((short)p.Modulus.Length); data.Write(p.Modulus); --- 69,73 ---- TlsStream data = new TlsStream(); ! data.Write(this.Context.RandomCS); data.Write((short)p.Modulus.Length); data.Write(p.Modulus); Index: TlsClientFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TlsClientFinished.cs 13 Nov 2003 09:23:50 -0000 1.11 --- TlsClientFinished.cs 14 Nov 2003 13:42:54 -0000 1.12 *************** *** 34,39 **** #region CONSTRUCTORS ! public TlsClientFinished(TlsSession session) ! : base(session, TlsHandshakeType.Finished, TlsContentType.Handshake) { } --- 34,39 ---- #region CONSTRUCTORS ! public TlsClientFinished(TlsContext context) ! : base(context, TlsHandshakeType.Finished, TlsContentType.Handshake) { } *************** *** 56,63 **** { // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Session.Context.MasterSecret); TlsStream data = new TlsStream(); ! data.Write(this.Session.Context.HandshakeMessages.ToArray()); data.Write((int)0x434C4E54); --- 56,63 ---- { // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Context.MasterSecret); TlsStream data = new TlsStream(); ! data.Write(this.Context.HandshakeMessages.ToArray()); data.Write((int)0x434C4E54); *************** *** 74,83 **** HashAlgorithm hash = new MD5SHA1(); hash.ComputeHash( ! Session.Context.HandshakeMessages.ToArray(), 0, ! (int)Session.Context.HandshakeMessages.Length); // Write message ! Write(Session.Context.Cipher.PRF(Session.Context.MasterSecret, "client finished", hash.Hash, 12)); } --- 74,83 ---- HashAlgorithm hash = new MD5SHA1(); hash.ComputeHash( ! this.Context.HandshakeMessages.ToArray(), 0, ! (int)this.Context.HandshakeMessages.Length); // Write message ! Write(this.Context.Cipher.PRF(this.Context.MasterSecret, "client finished", hash.Hash, 12)); } Index: TlsClientHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsClientHello.cs 22 Oct 2003 11:48:08 -0000 1.9 --- TlsClientHello.cs 14 Nov 2003 13:42:54 -0000 1.10 *************** *** 38,43 **** #region CONSTRUCTORS ! public TlsClientHello(TlsSession session) ! : base(session, TlsHandshakeType.ClientHello, TlsContentType.Handshake) { } --- 38,43 ---- #region CONSTRUCTORS ! public TlsClientHello(TlsContext context) ! : base(context, TlsHandshakeType.ClientHello, TlsContentType.Handshake) { } *************** *** 51,55 **** base.UpdateSession(); ! Session.Context.ClientRandom = random; random = null; --- 51,55 ---- base.UpdateSession(); ! this.Context.ClientRandom = random; random = null; *************** *** 68,77 **** { // Client Version ! this.Write((short)this.Session.Context.Protocol); // Random bytes - Unix time + Radom bytes [28] TlsStream clientRandom = new TlsStream(); ! clientRandom.Write(this.Session.Context.GetUnixTime()); ! clientRandom.Write(this.Session.Context.GetSecureRandomBytes(28)); this.random = clientRandom.ToArray(); clientRandom.Reset(); --- 68,77 ---- { // Client Version ! this.Write((short)this.Context.Protocol); // Random bytes - Unix time + Radom bytes [28] TlsStream clientRandom = new TlsStream(); ! clientRandom.Write(this.Context.GetUnixTime()); ! clientRandom.Write(this.Context.GetSecureRandomBytes(28)); this.random = clientRandom.ToArray(); clientRandom.Reset(); *************** *** 81,90 **** // Session id // Send the session ID empty ! if (this.Session.SessionId != null) { ! this.Write((byte)this.Session.SessionId.Length); ! if (this.Session.SessionId.Length > 0) { ! this.Write(this.Session.SessionId); } } --- 81,90 ---- // Session id // Send the session ID empty ! if (this.Context.SessionId != null) { ! this.Write((byte)this.Context.SessionId.Length); ! if (this.Context.SessionId.Length > 0) { ! this.Write(this.Context.SessionId); } } *************** *** 95,104 **** // Write length of Cipher suites ! this.Write((short)(this.Session.Context.SupportedCiphers.Count*2)); // Write Supported Cipher suites ! for (int i = 0; i < this.Session.Context.SupportedCiphers.Count; i++) { ! this.Write((short)this.Session.Context.SupportedCiphers[i].Code); } --- 95,104 ---- // Write length of Cipher suites ! this.Write((short)(this.Context.SupportedCiphers.Count*2)); // Write Supported Cipher suites ! for (int i = 0; i < this.Context.SupportedCiphers.Count; i++) { ! this.Write((short)this.Context.SupportedCiphers[i].Code); } *************** *** 107,111 **** // Compression methods ( 0 = none ) ! this.Write((byte)this.Session.Context.CompressionMethod); } --- 107,111 ---- // Compression methods ( 0 = none ) ! this.Write((byte)this.Context.CompressionMethod); } Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsClientKeyExchange.cs 28 Oct 2003 16:12:30 -0000 1.9 --- TlsClientKeyExchange.cs 14 Nov 2003 13:42:54 -0000 1.10 *************** *** 33,38 **** #region CONSTRUCTORS ! public TlsClientKeyExchange (TlsSession session) : ! base(session, TlsHandshakeType.ClientKeyExchange, TlsContentType.Handshake) --- 33,38 ---- #region CONSTRUCTORS ! public TlsClientKeyExchange (TlsContext context) : ! base(context, TlsHandshakeType.ClientKeyExchange, TlsContentType.Handshake) *************** *** 47,54 **** { // Compute pre master secret ! byte[] preMasterSecret = this.Session.Context.Cipher.CreatePremasterSecret(); // Create a new RSA key ! RSA rsa = this.Session.Context.Cipher.CreateRSA(); // Encrypt premaster_sercret --- 47,54 ---- { // Compute pre master secret ! byte[] preMasterSecret = this.Context.Cipher.CreatePremasterSecret(); // Create a new RSA key ! RSA rsa = this.Context.Cipher.CreateRSA(); // Encrypt premaster_sercret *************** *** 60,67 **** // Create master secret ! this.Session.Context.Cipher.ComputeMasterSecret(preMasterSecret); // Create keys ! this.Session.Context.Cipher.ComputeKeys(); // Clear resources --- 60,67 ---- // Create master secret ! this.Context.Cipher.ComputeMasterSecret(preMasterSecret); // Create keys ! this.Context.Cipher.ComputeKeys(); // Clear resources *************** *** 72,79 **** { // Compute pre master secret ! byte[] preMasterSecret = this.Session.Context.Cipher.CreatePremasterSecret(); // Create a new RSA key ! RSA rsa = this.Session.Context.Cipher.CreateRSA(); // Encrypt premaster_sercret --- 72,79 ---- { // Compute pre master secret ! byte[] preMasterSecret = this.Context.Cipher.CreatePremasterSecret(); // Create a new RSA key ! RSA rsa = this.Context.Cipher.CreateRSA(); // Encrypt premaster_sercret *************** *** 86,93 **** // Create master secret ! this.Session.Context.Cipher.ComputeMasterSecret(preMasterSecret); // Create keys ! this.Session.Context.Cipher.ComputeKeys(); // Clear resources --- 86,93 ---- // Create master secret ! this.Context.Cipher.ComputeMasterSecret(preMasterSecret); // Create keys ! this.Context.Cipher.ComputeKeys(); // Clear resources Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsServerCertificate.cs 13 Nov 2003 09:23:50 -0000 1.10 --- TlsServerCertificate.cs 14 Nov 2003 13:42:54 -0000 1.11 *************** *** 24,28 **** --- 24,31 ---- using System; + using System.Collections; + using System.Text.RegularExpressions; using System.Security.Cryptography; + using X509Cert = System.Security.Cryptography.X509Certificates; using Mono.Security.Protocol.Tls.Alerts; *************** *** 35,39 **** #region FIELDS ! private X509CertificateCollection certificates; #endregion --- 38,42 ---- #region FIELDS ! private X509CertificateCollection certificates; #endregion *************** *** 41,46 **** #region CONSTRUCTORS ! public TlsServerCertificate(TlsSession session, byte[] buffer) ! : base(session, TlsHandshakeType.Certificate, buffer) { } --- 44,49 ---- #region CONSTRUCTORS ! public TlsServerCertificate(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Certificate, buffer) { } *************** *** 53,57 **** { base.UpdateSession(); ! this.Session.Context.ServerSettings.Certificates = certificates; } --- 56,60 ---- { base.UpdateSession(); ! this.Context.ServerSettings.Certificates = certificates; } *************** *** 99,108 **** private void validateCertificate(X509Certificate certificate) { #warning "Check validity of certificates" // 1 step : Validate dates ! if (!certificate.WasCurrent(DateTime.Now)) { ! throw Session.CreateException("Certificate received from the server expired."); } --- 102,113 ---- private void validateCertificate(X509Certificate certificate) { + int[] certificateErrors = new int[0]; + #warning "Check validity of certificates" // 1 step : Validate dates ! if (!certificate.IsCurrent) { ! #warning "Add error to the list" } *************** *** 114,123 **** if (!certificate.VerifySignature(certificate.RSA)) { ! throw Session.CreateException("Certificate received from the server has invalid signature."); } */ // 4 step: Validate domain name ! string name = certificate.SubjectName; } --- 119,161 ---- if (!certificate.VerifySignature(certificate.RSA)) { ! throw this.Context.CreateException("Certificate received from the server has invalid signature."); } */ // 4 step: Validate domain name ! if (!this.checkDomainName(certificate.SubjectName)) ! { ! #warning "Add error to the list" ! } ! ! if (certificateErrors.Length > 0) ! { ! if (!this.Context.SslStream.RaiseServerCertificateValidation( ! new X509Cert.X509Certificate(certificate.RawData), ! new int[]{})) ! { ! throw this.Context.CreateException("Invalid certificate received form server."); ! } ! } ! } ! ! private bool checkDomainName(string subjectName) ! { ! string domainName = String.Empty; ! Regex search = new Regex(@"([\w\s\d]*)\s*=\s*([^,]*)"); ! ! MatchCollection elements = search.Matches(subjectName); ! ! foreach (Match element in elements) ! { ! switch (element.Groups[1].Value.Trim().ToUpper()) ! { ! case "CN": ! domainName = element.Groups[2].Value; ! break; ! } ! } ! ! return (this.Context.ClientSettings.TargetHost == domainName); } Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsServerCertificateRequest.cs 3 Nov 2003 12:35:56 -0000 1.6 --- TlsServerCertificateRequest.cs 14 Nov 2003 13:42:54 -0000 1.7 *************** *** 40,45 **** #region CONSTRUCTORS ! public TlsServerCertificateRequest(TlsSession session, byte[] buffer) ! : base(session, TlsHandshakeType.ServerHello, buffer) { } --- 40,45 ---- #region CONSTRUCTORS ! public TlsServerCertificateRequest(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) { } *************** *** 53,59 **** base.UpdateSession(); ! this.Session.Context.ServerSettings.CertificateTypes = this.certificateTypes; ! this.Session.Context.ServerSettings.DistinguisedNames = this.distinguisedNames; ! this.Session.Context.ServerSettings.CertificateRequest = true; } --- 53,59 ---- base.UpdateSession(); ! this.Context.ServerSettings.CertificateTypes = this.certificateTypes; ! this.Context.ServerSettings.DistinguisedNames = this.distinguisedNames; ! this.Context.ServerSettings.CertificateRequest = true; } Index: TlsServerFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TlsServerFinished.cs 13 Nov 2003 09:23:50 -0000 1.11 --- TlsServerFinished.cs 14 Nov 2003 13:42:54 -0000 1.12 *************** *** 34,39 **** #region CONSTRUCTORS ! public TlsServerFinished(TlsSession session, byte[] buffer) ! : base(session, TlsHandshakeType.ServerHello, buffer) { } --- 34,39 ---- #region CONSTRUCTORS ! public TlsServerFinished(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) { } *************** *** 48,55 **** // Reset Hahdshake messages information ! this.Session.Context.HandshakeMessages.Reset(); // Hahdshake is finished ! this.Session.Context.HandshakeFinished = true; } --- 48,55 ---- // Reset Hahdshake messages information ! this.Context.HandshakeMessages.Reset(); // Hahdshake is finished ! this.Context.HandshakeFinished = true; } *************** *** 61,68 **** { // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Session.Context.MasterSecret); TlsStream data = new TlsStream(); ! data.Write(this.Session.Context.HandshakeMessages.ToArray()); data.Write((int)0x53525652); --- 61,68 ---- { // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Context.MasterSecret); TlsStream data = new TlsStream(); ! data.Write(this.Context.HandshakeMessages.ToArray()); data.Write((int)0x53525652); *************** *** 94,102 **** hash.ComputeHash( ! Session.Context.HandshakeMessages.ToArray(), 0, ! (int)Session.Context.HandshakeMessages.Length); ! byte[] clientPRF = this.Session.Context.Cipher.PRF(this.Session.Context.MasterSecret, "server finished", hash.Hash, 12); // Check server prf against client prf --- 94,102 ---- hash.ComputeHash( ! this.Context.HandshakeMessages.ToArray(), 0, ! (int)this.Context.HandshakeMessages.Length); ! byte[] clientPRF = this.Context.Cipher.PRF(this.Context.MasterSecret, "server finished", hash.Hash, 12); // Check server prf against client prf Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TlsServerHello.cs 13 Nov 2003 09:23:50 -0000 1.11 --- TlsServerHello.cs 14 Nov 2003 13:42:54 -0000 1.12 *************** *** 41,46 **** #region CONSTRUCTORS ! public TlsServerHello(TlsSession session, byte[] buffer) ! : base(session, TlsHandshakeType.ServerHello, buffer) { } --- 41,46 ---- #region CONSTRUCTORS ! public TlsServerHello(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) { } *************** *** 54,75 **** base.UpdateSession(); ! this.Session.SetSessionId(this.sessionId); ! this.Session.Context.ServerRandom = this.random; ! this.Session.Context.Cipher = this.cipherSuite; ! this.Session.Context.CompressionMethod = this.compressionMethod; ! this.Session.Context.Cipher.Context = this.Session.Context; // Compute ClientRandom + ServerRandom TlsStream random = new TlsStream(); ! random.Write(this.Session.Context.ClientRandom); ! random.Write(this.Session.Context.ServerRandom); ! this.Session.Context.RandomCS = random.ToArray(); // Server Random + Client Random random.Reset(); ! random.Write(this.Session.Context.ServerRandom); ! random.Write(this.Session.Context.ClientRandom); ! this.Session.Context.RandomSC = random.ToArray(); random.Reset(); } --- 54,75 ---- base.UpdateSession(); ! this.Context.SessionId = this.sessionId; ! this.Context.ServerRandom = this.random; ! this.Context.Cipher = this.cipherSuite; ! this.Context.CompressionMethod = this.compressionMethod; ! this.Context.Cipher.Context = this.Context; // Compute ClientRandom + ServerRandom TlsStream random = new TlsStream(); ! random.Write(this.Context.ClientRandom); ! random.Write(this.Context.ServerRandom); ! this.Context.RandomCS = random.ToArray(); // Server Random + Client Random random.Reset(); ! random.Write(this.Context.ServerRandom); ! random.Write(this.Context.ClientRandom); ! this.Context.RandomSC = random.ToArray(); random.Reset(); } *************** *** 97,106 **** // Read cipher suite short cipherCode = this.ReadInt16(); ! if (this.Session.Context.SupportedCiphers.IndexOf(cipherCode) == -1) { // The server has sent an invalid ciphersuite throw new TlsException("Invalid cipher suite received from server"); } ! this.cipherSuite = this.Session.Context.SupportedCiphers[cipherCode]; // Read compression methods ( always 0 ) --- 97,106 ---- // Read cipher suite short cipherCode = this.ReadInt16(); ! if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) { // The server has sent an invalid ciphersuite throw new TlsException("Invalid cipher suite received from server"); } ! this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; // Read compression methods ( always 0 ) *************** *** 125,134 **** // Read cipher suite short cipherCode = this.ReadInt16(); ! if (this.Session.Context.SupportedCiphers.IndexOf(cipherCode) == -1) { // The server has sent an invalid ciphersuite throw new TlsException("Invalid cipher suite received from server"); } ! this.cipherSuite = this.Session.Context.SupportedCiphers[cipherCode]; // Read compression methods ( always 0 ) --- 125,134 ---- // Read cipher suite short cipherCode = this.ReadInt16(); ! if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) { // The server has sent an invalid ciphersuite throw new TlsException("Invalid cipher suite received from server"); } ! this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; // Read compression methods ( always 0 ) Index: TlsServerHelloDone.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsServerHelloDone.cs 21 Oct 2003 20:06:28 -0000 1.5 --- TlsServerHelloDone.cs 14 Nov 2003 13:42:54 -0000 1.6 *************** *** 31,36 **** #region CONSTRUCTORS ! public TlsServerHelloDone(TlsSession session, byte[] buffer) ! : base(session, TlsHandshakeType.ServerHello, buffer) { } --- 31,36 ---- #region CONSTRUCTORS ! public TlsServerHelloDone(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) { } *************** *** 44,48 **** base.UpdateSession(); ! this.Session.Context.HelloDone = true; } --- 44,48 ---- base.UpdateSession(); ! this.Context.HelloDone = true; } Index: TlsServerKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TlsServerKeyExchange.cs 13 Nov 2003 09:23:50 -0000 1.12 --- TlsServerKeyExchange.cs 14 Nov 2003 13:42:54 -0000 1.13 *************** *** 42,47 **** #region CONSTRUCTORS ! public TlsServerKeyExchange(TlsSession session, byte[] buffer) ! : base(session, TlsHandshakeType.ServerKeyExchange, buffer) { this.verifySignature(); --- 42,47 ---- #region CONSTRUCTORS ! public TlsServerKeyExchange(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerKeyExchange, buffer) { this.verifySignature(); *************** *** 56,62 **** base.UpdateSession(); ! this.Session.Context.ServerSettings.ServerKeyExchange = true; ! this.Session.Context.ServerSettings.RsaParameters = this.rsaParams; ! this.Session.Context.ServerSettings.SignedParams = this.signedParams; } --- 56,62 ---- base.UpdateSession(); ! this.Context.ServerSettings.ServerKeyExchange = true; ! this.Context.ServerSettings.RsaParameters = this.rsaParams; ! this.Context.ServerSettings.SignedParams = this.signedParams; } *************** *** 95,99 **** TlsStream stream = new TlsStream(); ! stream.Write(this.Session.Context.RandomCS); stream.Write(rsaParams.Modulus.Length); stream.Write(rsaParams.Modulus); --- 95,99 ---- TlsStream stream = new TlsStream(); ! stream.Write(this.Context.RandomCS); stream.Write(rsaParams.Modulus.Length); stream.Write(rsaParams.Modulus); *************** *** 106,110 **** // Verify Signature ! X509Certificate certificate = this.Session.Context.ServerSettings.Certificates[0]; RSA rsa = RSA.Create(); --- 106,110 ---- // Verify Signature ! X509Certificate certificate = this.Context.ServerSettings.Certificates[0]; RSA rsa = RSA.Create(); |
From: <car...@us...> - 2003-11-14 13:42:45
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv17733 Modified Files: TlsHandshakeMessage.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. The next files are no more needed: - TlsSession.cs - TlsNetworkStream.cs - TlsSocket.cs - TlsSessionState.cs The next files are renamed: - TlsSessionSettings.cs -> TlsClientSettings.cs - TlsSessionContext.cs -> TlsContext.cs The next files are new: - SslClientStream.cs ( the name is non definitive yet ) The next files where changed to reflect the new canges: - TlsHandshakeMessage.cs - TlsClientCertificate.cs - TlsClientCertificateVerify.cs - TlsClientFinished.cs - TlsClientHello.cs - TlsClientKeyExchange.cs - TlsServerCertificate.cs - TlsServerCertificateRequest.cs - TlsServerFinished.cs - TlsServerHello.cs - TlsServerHelloDone.cs - TlsServerKeyExchange.cs - TlsAlert.cs - TlsCloseNotifyAlert.cs Index: TlsHandshakeMessage.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TlsHandshakeMessage.cs 13 Nov 2003 09:23:36 -0000 1.11 --- TlsHandshakeMessage.cs 14 Nov 2003 13:42:26 -0000 1.12 *************** *** 32,36 **** #region FIELDS ! private TlsSession session; private TlsHandshakeType handshakeType; private TlsContentType contentType; --- 32,36 ---- #region FIELDS ! private TlsContext context; private TlsHandshakeType handshakeType; private TlsContentType contentType; *************** *** 40,56 **** #region PROPERTIES ! public TlsSession Session { ! get { return session; } } public TlsHandshakeType HandshakeType { ! get { return handshakeType; } } public TlsContentType ContentType { ! get { return contentType; } } --- 40,56 ---- #region PROPERTIES ! public TlsContext Context { ! get { return this.context; } } public TlsHandshakeType HandshakeType { ! get { return this.handshakeType; } } public TlsContentType ContentType { ! get { return this.contentType; } } *************** *** 59,67 **** #region CONSTRUCTORS ! public TlsHandshakeMessage(TlsSession session, ! TlsHandshakeType handshakeType, ! TlsContentType contentType) : base() { ! this.session = session; this.handshakeType = handshakeType; this.contentType = contentType; --- 59,68 ---- #region CONSTRUCTORS ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType, ! TlsContentType contentType) : base() { ! this.context = context; this.handshakeType = handshakeType; this.contentType = contentType; *************** *** 71,78 **** } ! public TlsHandshakeMessage(TlsSession session, ! TlsHandshakeType handshakeType, byte[] data) : base(data) { ! this.session = session; this.handshakeType = handshakeType; --- 72,81 ---- } ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType, ! byte[] data) : base(data) { ! this.context = context; this.handshakeType = handshakeType; *************** *** 95,99 **** private void process() { ! switch (this.session.Context.Protocol) { case SecurityProtocolType.Ssl3: --- 98,102 ---- private void process() { ! switch (this.Context.Protocol) { case SecurityProtocolType.Ssl3: *************** *** 101,105 **** break; ! case SecurityProtocolType.Tls1: this.ProcessAsTls1(); break; --- 104,108 ---- break; ! case SecurityProtocolType.Tls: this.ProcessAsTls1(); break; *************** *** 111,115 **** if (CanWrite) { ! this.session.Context.HandshakeMessages.Write(this.EncodeMessage()); this.Reset(); } --- 114,118 ---- if (CanWrite) { ! this.context.HandshakeMessages.Write(this.EncodeMessage()); this.Reset(); } |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts In directory sc8-pr-cvs1:/tmp/cvs-serv17573 Modified Files: TlsAlert.cs TlsCloseNotifyAlert.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. The next files are no more needed: - TlsSession.cs - TlsNetworkStream.cs - TlsSocket.cs - TlsSessionState.cs The next files are renamed: - TlsSessionSettings.cs -> TlsClientSettings.cs - TlsSessionContext.cs -> TlsContext.cs The next files are new: - SslClientStream.cs ( the name is non definitive yet ) The next files where changed to reflect the new canges: - TlsHandshakeMessage.cs - TlsClientCertificate.cs - TlsClientCertificateVerify.cs - TlsClientFinished.cs - TlsClientHello.cs - TlsClientKeyExchange.cs - TlsServerCertificate.cs - TlsServerCertificateRequest.cs - TlsServerFinished.cs - TlsServerHello.cs - TlsServerHelloDone.cs - TlsServerKeyExchange.cs - TlsAlert.cs - TlsCloseNotifyAlert.cs Index: TlsAlert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsAlert.cs 13 Nov 2003 09:23:17 -0000 1.4 --- TlsAlert.cs 14 Nov 2003 13:41:20 -0000 1.5 *************** *** 69,73 **** #region FIELDS ! private TlsSession session; private TlsAlertLevel level; private TlsAlertDescription description; --- 69,73 ---- #region FIELDS ! private TlsContext context; private TlsAlertLevel level; private TlsAlertDescription description; *************** *** 77,83 **** #region PROPERTIES ! public TlsSession Session { ! get { return session; } } --- 77,83 ---- #region PROPERTIES ! public TlsContext Context { ! get { return this.context; } } *************** *** 86,94 **** #region CONSTRUCTORS ! public TlsAlert(TlsSession session, TlsAlertLevel level, TlsAlertDescription description) : base() { ! this.session = session; this.level = level; this.description = description; --- 86,94 ---- #region CONSTRUCTORS ! public TlsAlert(TlsContext context, TlsAlertLevel level, TlsAlertDescription description) : base() { ! this.context = context; this.level = level; this.description = description; Index: TlsCloseNotifyAlert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsCloseNotifyAlert.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsCloseNotifyAlert.cs 11 Oct 2003 10:08:17 -0000 1.1 --- TlsCloseNotifyAlert.cs 14 Nov 2003 13:41:20 -0000 1.2 *************** *** 30,35 **** internal class TlsCloseNotifyAlert : TlsAlert { ! public TlsCloseNotifyAlert(TlsSession session) ! : base(session, TlsAlertLevel.Warning, TlsAlertDescription.CloseNotify) --- 30,35 ---- internal class TlsCloseNotifyAlert : TlsAlert { ! public TlsCloseNotifyAlert(TlsContext context) ! : base(context, TlsAlertLevel.Warning, TlsAlertDescription.CloseNotify) *************** *** 39,43 **** public override void UpdateSession() { ! this.Session.Context.ConnectionEnd = true; } } --- 39,43 ---- public override void UpdateSession() { ! this.Context.ConnectionEnd = true; } } |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv17476 Modified Files: SecurityProtocolType.cs TlsCipherSuiteCollection.cs TlsCipherSuiteFactory.cs TlsContext.cs Added Files: SslClientStream.cs TlsClientSettings.cs Removed Files: TlsNetworkStream.cs TlsSession.cs TlsSessionSettings.cs TlsSessionState.cs TlsSocket.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. The next files are no more needed: - TlsSession.cs - TlsNetworkStream.cs - TlsSocket.cs - TlsSessionState.cs The next files are renamed: - TlsSessionSettings.cs -> TlsClientSettings.cs - TlsSessionContext.cs -> TlsContext.cs The next files are new: - SslClientStream.cs ( the name is non definitive yet ) The next files where changed to reflect the new canges: - TlsHandshakeMessage.cs - TlsClientCertificate.cs - TlsClientCertificateVerify.cs - TlsClientFinished.cs - TlsClientHello.cs - TlsClientKeyExchange.cs - TlsServerCertificate.cs - TlsServerCertificateRequest.cs - TlsServerFinished.cs - TlsServerHello.cs - TlsServerHelloDone.cs - TlsServerKeyExchange.cs - TlsAlert.cs - TlsCloseNotifyAlert.cs --- NEW FILE: TlsClientSettings.cs --- (This appears to be a binary file; contents omitted.) Index: SecurityProtocolType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SecurityProtocolType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecurityProtocolType.cs 13 Nov 2003 09:21:51 -0000 1.1 --- SecurityProtocolType.cs 14 Nov 2003 13:40:40 -0000 1.2 *************** *** 31,35 **** Default = (0x03 << 8) | 0x01, Ssl3 = (0x03 << 8) | 0x00, ! Tls1 = (0x03 << 8) | 0x01 } } --- 31,35 ---- Default = (0x03 << 8) | 0x01, Ssl3 = (0x03 << 8) | 0x00, ! Tls = (0x03 << 8) | 0x01 } } Index: TlsCipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteCollection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsCipherSuiteCollection.cs 13 Nov 2003 09:21:52 -0000 1.5 --- TlsCipherSuiteCollection.cs 14 Nov 2003 13:40:40 -0000 1.6 *************** *** 125,129 **** effectiveKeyBytes, ivSize, blockSize)); ! case SecurityProtocolType.Tls1: return this.add( new TlsCipherSuite( --- 125,129 ---- effectiveKeyBytes, ivSize, blockSize)); ! case SecurityProtocolType.Tls: return this.add( new TlsCipherSuite( Index: TlsCipherSuiteFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsCipherSuiteFactory.cs 13 Nov 2003 09:21:52 -0000 1.10 --- TlsCipherSuiteFactory.cs 14 Nov 2003 13:40:40 -0000 1.11 *************** *** 36,40 **** return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); ! case SecurityProtocolType.Tls1: return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); --- 36,40 ---- return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); ! case SecurityProtocolType.Tls: return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); *************** *** 48,56 **** private static TlsCipherSuiteCollection GetTls1SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Tls1); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); --- 48,56 ---- private static TlsCipherSuiteCollection GetTls1SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Tls); // Supported ciphers ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); Index: TlsContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsContext.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsContext.cs 13 Nov 2003 09:21:52 -0000 1.1 --- TlsContext.cs 14 Nov 2003 13:40:40 -0000 1.2 *************** *** 25,31 **** --- 25,34 ---- using System; using System.Text; + using System.Collections; using System.Security.Cryptography; + using System.Security.Cryptography.X509Certificates; using Mono.Security.Cryptography; + using Mono.Security.Protocol.Tls.Alerts; using Mono.Security.Protocol.Tls.Handshake; *************** *** 35,42 **** --- 38,51 ---- { #region FIELDS + + // SslClientStream that owns the context + private SslClientStream sslStream; // Protocol version private SecurityProtocolType protocol; + // Sesison ID + private byte[] sessionId; + // Compression method private SecurityCompressionType compressionMethod; *************** *** 45,48 **** --- 54,60 ---- private TlsServerSettings serverSettings; + // Client configuration + private TlsClientSettings clientSettings; + // Cipher suite information private CipherSuite cipher; *************** *** 87,90 **** --- 99,107 ---- #region PROPERTIES + public SslClientStream SslStream + { + get { return sslStream; } + } + public SecurityProtocolType Protocol { *************** *** 93,96 **** --- 110,119 ---- } + public byte[] SessionId + { + get { return this.sessionId; } + set { this.sessionId = value; } + } + public SecurityCompressionType CompressionMethod { *************** *** 105,108 **** --- 128,137 ---- } + public TlsClientSettings ClientSettings + { + get { return this.clientSettings; } + set { this.clientSettings = value; } + } + public bool IsActual { *************** *** 228,237 **** #region CONSTRUCTORS ! public TlsContext() { ! this.protocol = SecurityProtocolType.Tls1; this.compressionMethod = SecurityCompressionType.None; this.serverSettings = new TlsServerSettings(); this.handshakeMessages = new TlsStream(); } --- 257,277 ---- #region CONSTRUCTORS ! public TlsContext( ! SslClientStream sslStream, ! SecurityProtocolType securityProtocolType, ! string targetHost, ! X509CertificateCollection clientCertificates) { ! this.sslStream = sslStream; ! this.protocol = securityProtocolType; this.compressionMethod = SecurityCompressionType.None; this.serverSettings = new TlsServerSettings(); + this.clientSettings = new TlsClientSettings(); this.handshakeMessages = new TlsStream(); + this.sessionId = null; + + // Set client settings + this.ClientSettings.TargetHost = targetHost; + this.ClientSettings.Certificates = clientCertificates; } *************** *** 283,286 **** --- 323,348 ---- this.serverWriteMAC = null; } + } + + #endregion + + #region EXCEPTION_METHODS + + internal TlsException CreateException(TlsAlertLevel alertLevel, TlsAlertDescription alertDesc) + { + return CreateException(TlsAlert.GetAlertMessage(alertDesc)); + } + + internal TlsException CreateException(string format, params object[] args) + { + StringBuilder message = new StringBuilder(); + message.AppendFormat(format, args); + + return CreateException(message.ToString()); + } + + internal TlsException CreateException(string message) + { + return new TlsException(message); } --- TlsNetworkStream.cs DELETED --- --- TlsSession.cs DELETED --- --- TlsSessionSettings.cs DELETED --- --- TlsSessionState.cs DELETED --- --- TlsSocket.cs DELETED --- |
From: <car...@us...> - 2003-11-13 18:50:18
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv17789 Removed Files: SslClientStream.cs Log Message: Removed file --- SslClientStream.cs DELETED --- |
From: <car...@us...> - 2003-11-13 12:33:55
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.X509 In directory sc8-pr-cvs1:/tmp/cvs-serv4251 Added Files: TestAnchors.cs Log Message: new file needed for build --- NEW FILE: TestAnchors.cs --- // // TestAnchors.cs: Trust Anchors for development and debugging // include test certificates for Microsoft (root agency) and Mono // // Author: // Sebastien Pouliot (spo...@mo...) // // (C) 2003 Motus Technologies Inc. (http://www.motus.com) // using System; namespace Mono.Security.X509 { internal class TestAnchors : TrustAnchors { static byte[] rootagency = { 0x30, 0x82, 0x01, 0xCA, 0x30, 0x82, 0x01, 0x74, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x06, 0x37, 0x6C, 0x00, 0xAA, 0x00, 0x64, 0x8A, 0x11, 0xCF, 0xB8, 0xD4, 0xAA, 0x5C, 0x35, 0xF4, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04, 0x05, 0x00, 0x30, 0x16, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0B, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6E, 0x63, 0x79, 0x30, 0x1E, 0x17, 0x0D, 0x39, 0x36, 0x30, 0x35, 0x32, 0x38, 0x32, 0x32, 0x30, 0x32, 0x35, 0x39, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x16, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0B, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6E, 0x63, 0x79, 0x30, 0x5B, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x4A, 0x00, 0x30, 0x47, 0x02, 0x40, 0x81, 0x55, 0x22, 0xB9, 0x8A, 0xA4, 0x6F, 0xED, 0xD6, 0xE7, 0xD9, 0x66, 0x0F, 0x55, 0xBC, 0xD7, 0xCD, 0xD5, 0xBC, 0x4E, 0x40, 0x02, 0x21, 0xA2, 0xB1, 0xF7, 0x87, 0x30, 0x85, 0x5E, 0xD2, 0xF2, 0x44, 0xB9, 0xDC, 0x9B, 0x75, 0xB6, 0xFB, 0x46, 0x5F, 0x42, 0xB6, 0x9D, 0x23, 0x36, 0x0B, 0xDE, 0x54, 0x0F, 0xCD, 0xBD, 0x1F, 0x99, 0x2A, 0x10, 0x58, 0x11, 0xCB, 0x40, 0xCB, 0xB5, 0xA7, 0x41, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x81, 0x9E, 0x30, 0x81, 0x9B, 0x30, 0x50, 0x06, 0x03, 0x55, 0x04, 0x03, 0x04, 0x49, 0x13, 0x47, 0x46, 0x6F, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6E, 0x67, 0x20, 0x50, 0x75, 0x72, 0x70, 0x6F, 0x73, 0x65, 0x73, 0x20, 0x4F, 0x6E, 0x6C, 0x79, 0x20, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x20, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6E, 0x74, 0x69, 0x61, 0x6C, 0x73, 0x20, 0x41, 0x67, 0x65, 0x6E, 0x63, 0x79, 0x30, 0x47, 0x06, 0x03, 0x55, 0x1D, 0x01, 0x04, 0x40, 0x30, 0x3E, 0x80, 0x10, 0x12, 0xE4, 0x09, 0x2D, 0x06, 0x1D, 0x1D, 0x4F, 0x00, 0x8D, 0x61, 0x21, 0xDC, 0x16, 0x64, 0x63, 0xA1, 0x18, 0x30, 0x16, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0B, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6E, 0x63, 0x79, 0x82, 0x10, 0x06, 0x37, 0x6C, 0x00, 0xAA, 0x00, 0x64, 0x8A, 0x11, 0xCF, 0xB8, 0xD4, 0xAA, 0x5C, 0x35, 0xF4, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04, 0x05, 0x00, 0x03, 0x41, 0x00, 0x2D, 0x2E, 0x3E, 0x7B, 0x89, 0x42, 0x89, 0x3F, 0xA8, 0x21, 0x17, 0xFA, 0xF0, 0xF5, 0xC3, 0x95, 0xDB, 0x62, 0x69, 0x5B, 0xC9, 0xDC, 0xC1, 0xB3, 0xFA, 0xF0, 0xC4, 0x6F, 0x6F, 0x64, 0x9A, 0xBD, 0xE7, 0x1B, 0x25, 0x68, 0x72, 0x83, 0x67, 0xBD, 0x56, 0xB0, 0x8D, 0x01, 0xBD, 0x2A, 0xF7, 0xCC, 0x4B, 0xBD, 0x87, 0xA5, 0xBA, 0x87, 0x20, 0x4C, 0x42, 0x11, 0x41, 0xAD, 0x10, 0x17, 0x3B, 0x8C }; static byte[] monoTestRoot = { 0x30, 0x82, 0x01, 0xC2, 0x30, 0x82, 0x01, 0x2B, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x28, 0xF4, 0x76, 0x38, 0x91, 0x74, 0x0E, 0x48, 0x85, 0xC7, 0x6E, 0x88, 0x4F, 0xE1, 0xB0, 0x69, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04, 0x05, 0x00, 0x30, 0x20, 0x31, 0x1E, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x15, 0x4D, 0x6F, 0x6E, 0x6F, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6E, 0x63, 0x79, 0x30, 0x1E, 0x17, 0x0D, 0x30, 0x33, 0x30, 0x39, 0x30, 0x31, 0x31, 0x35, 0x35, 0x35, 0x34, 0x38, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x32, 0x33, 0x31, 0x31, 0x38, 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x20, 0x31, 0x1E, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x15, 0x4D, 0x6F, 0x6E, 0x6F, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6E, 0x63, 0x79, 0x30, 0x81, 0x9E, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8C, 0x00, 0x30, 0x81, 0x88, 0x02, 0x81, 0x80, 0xBF, 0xFE, 0x27, 0x00, 0xB0, 0x71, 0x08, 0x4F, 0xBD, 0x26, 0x01, 0x02, 0xD0, 0xB9, 0xC3, 0x52, 0xF2, 0xA1, 0xE9, 0xEF, 0x7A, 0x3F, 0x04, 0xE9, 0x37, 0x84, 0x63, 0xFA, 0xF5, 0xA7, 0xA8, 0xA4, 0xFB, 0x20, 0x0A, 0x75, 0x88, 0xAF, 0xC9, 0x8E, 0xEA, 0xAF, 0x02, 0x0E, 0x83, 0x43, 0x6B, 0xD3, 0x7E, 0xFD, 0x1D, 0x4E, 0x5A, 0x9F, 0x7E, 0x61, 0xC7, 0xE7, 0x53, 0xB2, 0x8A, 0x8A, 0x6B, 0x71, 0x3E, 0x67, 0xCF, 0x17, 0x12, 0x4E, 0xC6, 0x5B, 0xFF, 0xD8, 0xDC, 0x1D, 0x27, 0x06, 0xD2, 0xCD, 0xFF, 0x15, 0x12, 0x16, 0x9D, 0x77, 0x8B, 0x93, 0xF7, 0xE0, 0x9B, 0xB9, 0x92, 0x62, 0x18, 0xD4, 0x68, 0x73, 0x48, 0xD2, 0x6D, 0x7F, 0x35, 0x34, 0xE4, 0xB6, 0x2A, 0x62, 0x72, 0x32, 0xB1, 0xA3, 0xBD, 0x61, 0x18, 0x88, 0x3D, 0xAA, 0xE7, 0x02, 0x5A, 0x70, 0xEE, 0x9B, 0xE2, 0xAB, 0x87, 0xF9, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x8E, 0x08, 0xD7, 0x0F, 0x30, 0xB2, 0xFD, 0x3A, 0x5C, 0x94, 0xA9, 0x56, 0xBE, 0x44, 0x77, 0xE3, 0xA3, 0x92, 0xBC, 0xB9, 0xE4, 0x95, 0x68, 0xD4, 0xF4, 0xF9, 0x24, 0x4B, 0x2A, 0x79, 0x93, 0x57, 0x7E, 0x84, 0x50, 0x3F, 0xA9, 0xC8, 0xDA, 0x9E, 0x08, 0x9C, 0x21, 0xE1, 0x10, 0xFC, 0x1C, 0x5C, 0x4B, 0x60, 0x97, 0xBA, 0x55, 0xCB, 0x7C, 0xEA, 0xC3, 0x04, 0x2F, 0x55, 0xBB, 0x16, 0x26, 0xCD, 0x87, 0x90, 0x30, 0x7F, 0xE0, 0xCF, 0x24, 0x27, 0xB4, 0x3A, 0xD0, 0x9F, 0xC7, 0x55, 0xF8, 0x7C, 0xC9, 0xA0, 0x72, 0xE4, 0x06, 0xF1, 0x4A, 0x5B, 0xBB, 0x71, 0x84, 0x8B, 0x76, 0x23, 0x65, 0x1F, 0x1B, 0xEA, 0x96, 0x85, 0x13, 0x84, 0x0C, 0x8C, 0xCD, 0xDA, 0x3D, 0x1F, 0xEB, 0xA9, 0xA7, 0xDF, 0xE0, 0xD1, 0xDC, 0x93, 0x21, 0x7A, 0x10, 0xA7, 0x92, 0x63, 0x5D, 0xAB, 0xA2, 0x13, 0x37, 0xA4 }; static TestAnchors () { // add Microsoft Test Root for people who used MS makecert to create // their Authenticode(tm) test certificates coll.Add (new X509Certificate (rootagency)); // add Mono Test Root for people who used Mono makecert to create // their Authenticode(tm) test certificates coll.Add (new X509Certificate (monoTestRoot)); } } } |
From: <car...@us...> - 2003-11-13 12:32:17
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.X509 In directory sc8-pr-cvs1:/tmp/cvs-serv3972 Removed Files: X509Builder.cs Log Message: removed file --- X509Builder.cs DELETED --- |
From: <car...@us...> - 2003-11-13 12:30:28
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.X509 In directory sc8-pr-cvs1:/tmp/cvs-serv3410 Removed Files: X509CertificateBuilder.cs Log Message: removed file --- X509CertificateBuilder.cs DELETED --- |
From: <car...@us...> - 2003-11-13 12:22:27
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv1972 Modified Files: changelog.txt Log Message: Updated changelog.txt Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** changelog.txt 12 Nov 2003 19:54:43 -0000 1.71 --- changelog.txt 13 Nov 2003 12:22:23 -0000 1.72 *************** *** 4,7 **** --- 4,12 ---- 2003-11-12 Carlos Guzmán Álvarez <car...@te...> + * source/NPgClient/PgDbClient.cs: + * source/NPgClient/PgOutputPacket.cs: + + - Fixed bug #841051. + * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: |
From: <car...@us...> - 2003-11-13 09:24:07
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv1552 Modified Files: changelog.txt Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/changelog.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** changelog.txt 10 Nov 2003 12:16:31 -0000 1.9 --- changelog.txt 13 Nov 2003 09:24:04 -0000 1.10 *************** *** 2,5 **** --- 2,48 ---- --------------- ----------- ----------------------------------------- + 2003-11-13 Carlos Guzmán Álvarez <car...@te...> + + * Mono.Security.Protocol.Tls/TlsSessionContext.cs: + + - Renamed to TlsContext. + + 2003-11-12 Carlos Guzmán Álvarez <car...@te...> + + * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: + + - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) + + * Mono.Security.Protocol.Tls/TlsProtocol.cs: + + - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) + + * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: + + - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) + + * Mono.Security.Cryptography/TlsCompressionMethod.cs: + + - Renamed to SecurityCompressionType. + + * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: + * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: + * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: + + - New enumerations that matches .NET 1.2 definitions with some minor differences. + + * Mono.Security.Protocol.Tls/CipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsSessionContext.cs: + + - Added changes for make use of new enumerations. + + * Mono.Security.Protocol.Tls/TlsClientStream.cs: + + - Added new informative properties that matches .NET 1.2 SslClientStream + ( Not all the properties are implemented yet ). + + 2003-11-10 Carlos Guzmán Álvarez <car...@te...> *************** *** 36,40 **** ! ----------------- Updated Mono Sources ------------------------------- --- 79,83 ---- ! ----------------- Updated Mono Sources ----------------------- |
From: <car...@us...> - 2003-11-13 09:23:53
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1:/tmp/cvs-serv1483 Modified Files: TlsClientCertificateVerify.cs TlsClientFinished.cs TlsServerCertificate.cs TlsServerFinished.cs TlsServerHello.cs TlsServerKeyExchange.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsClientCertificateVerify.cs 10 Nov 2003 12:16:04 -0000 1.10 --- TlsClientCertificateVerify.cs 13 Nov 2003 09:23:50 -0000 1.11 *************** *** 63,71 **** foreach (X509Certificate cert in Session.Settings.Certificates) { ! MD5SHA1CryptoServiceProvider hash = new MD5SHA1CryptoServiceProvider(); ! X509.X509Certificate c = new X509.X509Certificate(cert.GetRawCertData()); ! RSA rsa = c.RSA; ! RSAParameters p = rsa.ExportParameters(false); ! TlsStream data = new TlsStream(); data.Write(this.Session.Context.RandomCS); --- 63,71 ---- foreach (X509Certificate cert in Session.Settings.Certificates) { ! MD5SHA1 hash = new MD5SHA1(); ! X509.X509Certificate c = new X509.X509Certificate(cert.GetRawCertData()); ! RSA rsa = c.RSA; ! RSAParameters p = rsa.ExportParameters(false); ! TlsStream data = new TlsStream(); data.Write(this.Session.Context.RandomCS); Index: TlsClientFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsClientFinished.cs 3 Nov 2003 18:13:20 -0000 1.10 --- TlsClientFinished.cs 13 Nov 2003 09:23:50 -0000 1.11 *************** *** 72,76 **** { // Compute handshake messages hash ! HashAlgorithm hash = new MD5SHA1CryptoServiceProvider(); hash.ComputeHash( Session.Context.HandshakeMessages.ToArray(), --- 72,76 ---- { // Compute handshake messages hash ! HashAlgorithm hash = new MD5SHA1(); hash.ComputeHash( Session.Context.HandshakeMessages.ToArray(), Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsServerCertificate.cs 7 Nov 2003 10:05:51 -0000 1.9 --- TlsServerCertificate.cs 13 Nov 2003 09:23:50 -0000 1.10 *************** *** 102,106 **** // 1 step : Validate dates ! if (!certificate.IsCurrent) { throw Session.CreateException("Certificate received from the server expired."); --- 102,106 ---- // 1 step : Validate dates ! if (!certificate.WasCurrent(DateTime.Now)) { throw Session.CreateException("Certificate received from the server expired."); *************** *** 119,122 **** --- 119,123 ---- // 4 step: Validate domain name + string name = certificate.SubjectName; } Index: TlsServerFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsServerFinished.cs 3 Nov 2003 18:13:20 -0000 1.10 --- TlsServerFinished.cs 13 Nov 2003 09:23:50 -0000 1.11 *************** *** 91,95 **** { byte[] serverPRF = this.ReadBytes((int)Length); ! HashAlgorithm hash = new MD5SHA1CryptoServiceProvider(); hash.ComputeHash( --- 91,95 ---- { byte[] serverPRF = this.ReadBytes((int)Length); ! HashAlgorithm hash = new MD5SHA1(); hash.ComputeHash( Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsServerHello.cs 22 Oct 2003 11:48:08 -0000 1.10 --- TlsServerHello.cs 13 Nov 2003 09:23:50 -0000 1.11 *************** *** 31,36 **** #region FIELDS ! private TlsProtocol protocol; ! private TlsCompressionMethod compressionMethod; private byte[] random; private byte[] sessionId; --- 31,36 ---- #region FIELDS ! private SecurityProtocolType protocol; ! private SecurityCompressionType compressionMethod; private byte[] random; private byte[] sessionId; *************** *** 83,87 **** #warning "Check that the protocol sent by the server is supported" // Read protocol version ! this.protocol = (TlsProtocol)this.ReadInt16(); // Read random - Unix time + Random bytes --- 83,87 ---- #warning "Check that the protocol sent by the server is supported" // Read protocol version ! this.protocol = (SecurityProtocolType)this.ReadInt16(); // Read random - Unix time + Random bytes *************** *** 105,109 **** // Read compression methods ( always 0 ) ! this.compressionMethod = (TlsCompressionMethod)this.ReadByte(); } --- 105,109 ---- // Read compression methods ( always 0 ) ! this.compressionMethod = (SecurityCompressionType)this.ReadByte(); } *************** *** 111,115 **** { // Read protocol version ! this.protocol = (TlsProtocol)this.ReadInt16(); // Read random - Unix time + Random bytes --- 111,115 ---- { // Read protocol version ! this.protocol = (SecurityProtocolType)this.ReadInt16(); // Read random - Unix time + Random bytes *************** *** 133,137 **** // Read compression methods ( always 0 ) ! this.compressionMethod = (TlsCompressionMethod)this.ReadByte(); } --- 133,137 ---- // Read compression methods ( always 0 ) ! this.compressionMethod = (SecurityCompressionType)this.ReadByte(); } Index: TlsServerKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TlsServerKeyExchange.cs 7 Nov 2003 10:06:23 -0000 1.11 --- TlsServerKeyExchange.cs 13 Nov 2003 09:23:50 -0000 1.12 *************** *** 90,94 **** private void verifySignature() { ! MD5SHA1CryptoServiceProvider hash = new MD5SHA1CryptoServiceProvider(); // Create server params array --- 90,94 ---- private void verifySignature() { ! MD5SHA1 hash = new MD5SHA1(); // Create server params array *************** *** 108,112 **** X509Certificate certificate = this.Session.Context.ServerSettings.Certificates[0]; ! RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(rsaParams.Modulus.Length << 3); rsa.ImportParameters(rsaParams); --- 108,114 ---- X509Certificate certificate = this.Session.Context.ServerSettings.Certificates[0]; ! RSA rsa = RSA.Create(); ! ! rsa.KeySize = rsaParams.Modulus.Length << 3; rsa.ImportParameters(rsaParams); |
From: <car...@us...> - 2003-11-13 09:23:39
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv1405 Modified Files: TlsHandshakeMessage.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). Index: TlsHandshakeMessage.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsHandshakeMessage.cs 3 Nov 2003 19:42:31 -0000 1.10 --- TlsHandshakeMessage.cs 13 Nov 2003 09:23:36 -0000 1.11 *************** *** 97,106 **** switch (this.session.Context.Protocol) { ! case TlsProtocol.Tls1: ! this.ProcessAsTls1(); break; ! case TlsProtocol.Ssl3: ! this.ProcessAsSsl3(); break; } --- 97,106 ---- switch (this.session.Context.Protocol) { ! case SecurityProtocolType.Ssl3: ! this.ProcessAsSsl3(); break; ! case SecurityProtocolType.Tls1: ! this.ProcessAsTls1(); break; } |
From: <car...@us...> - 2003-11-13 09:23:20
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts In directory sc8-pr-cvs1:/tmp/cvs-serv1337 Modified Files: TlsAlert.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). Index: TlsAlert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsAlert.cs 10 Nov 2003 12:16:03 -0000 1.3 --- TlsAlert.cs 13 Nov 2003 09:23:17 -0000 1.4 *************** *** 119,122 **** --- 119,123 ---- internal static string GetAlertMessage(TlsAlertDescription description) { + #if (DEBUG) switch (description) { *************** *** 193,196 **** --- 194,273 ---- return ""; } + #else + switch (description) + { + case TlsAlertDescription.AccessDenied: + return "Invalid message."; + + case TlsAlertDescription.BadCertificate: + return "Handshake failiure."; + + case TlsAlertDescription.BadRecordMAC: + return "Cryptographic failiure."; + + case TlsAlertDescription.CertificateExpired: + return "Handshake failiure."; + + case TlsAlertDescription.CertificateRevoked: + return "Handshake failiure."; + + case TlsAlertDescription.CertificateUnknown: + return "Handshake failiure."; + + case TlsAlertDescription.CloseNotify: + return "Connection closed."; + + case TlsAlertDescription.DecodeError: + return "Invalid message."; + + case TlsAlertDescription.DecompressionFailiure: + return "Compression error."; + + case TlsAlertDescription.DecryptError: + return "Cryptographic failiure."; + + case TlsAlertDescription.DecryptionFailed: + return "Cryptographic failiure."; + + case TlsAlertDescription.ExportRestriction: + return "Handshake failiure."; + + case TlsAlertDescription.HandshakeFailiure: + return "Handshake failiure."; + + case TlsAlertDescription.IlegalParameter: + return "Handshake failiure."; + + case TlsAlertDescription.InsuficientSecurity: + return "Handshake failiure."; + + case TlsAlertDescription.InternalError: + return "Fatal failiure."; + + case TlsAlertDescription.NoRenegotiation: + return "Handshake failiure."; + + case TlsAlertDescription.ProtocolVersion: + return "Handshake failiure."; + + case TlsAlertDescription.RecordOverflow: + return "Incorrect message."; + + case TlsAlertDescription.UnexpectedMessage: + return "Incorrect message."; + + case TlsAlertDescription.UnknownCA: + return "Handshake failiure."; + + case TlsAlertDescription.UnsupportedCertificate: + return "Handshake failiure."; + + case TlsAlertDescription.UserCancelled: + return "Handshake cancelled by user."; + + default: + return ""; + } + #endif } |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.Cryptography In directory sc8-pr-cvs1:/tmp/cvs-serv1229 Added Files: MD5SHA1.cs Removed Files: MD5SHA1CryptoServiceProvider.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). --- NEW FILE: MD5SHA1.cs --- (This appears to be a binary file; contents omitted.) --- MD5SHA1CryptoServiceProvider.cs DELETED --- |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv1035 Modified Files: CipherSuite.cs TlsCipherSuite.cs TlsCipherSuiteCollection.cs TlsCipherSuiteFactory.cs TlsNetworkStream.cs TlsSession.cs TlsSessionSettings.cs TlsSocket.cs TlsSslCipherSuite.cs Added Files: CipherAlgorithmType.cs ExchangeAlgorithmType.cs HashAlgorithmType.cs SecurityCompressionType.cs SecurityProtocolType.cs SslClientStream.cs TlsContext.cs Removed Files: TlsCompressionMethod.cs TlsProtocol.cs TlsSessionContext.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). --- NEW FILE: CipherAlgorithmType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ExchangeAlgorithmType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: HashAlgorithmType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SecurityCompressionType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SecurityProtocolType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SslClientStream.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsContext.cs --- (This appears to be a binary file; contents omitted.) Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CipherSuite.cs 10 Nov 2003 12:16:03 -0000 1.8 --- CipherSuite.cs 13 Nov 2003 09:21:51 -0000 1.9 *************** *** 31,34 **** --- 31,35 ---- using Mono.Security.Cryptography; using Mono.Security.X509; + using M = Mono.Security.Cryptography; namespace Mono.Security.Protocol.Tls *************** *** 38,59 **** #region FIELDS ! private short code; ! private string name; ! private string algName; ! private string hashName; ! private bool isExportable; ! private CipherMode cipherMode; ! private byte keyMaterialSize; ! private byte expandedKeyMaterialSize; ! private short effectiveKeyBits; ! private byte ivSize; ! private byte blockSize; ! private TlsSessionContext context; ! private SymmetricAlgorithm encryptionAlgorithm; ! private ICryptoTransform encryptionCipher; ! private SymmetricAlgorithm decryptionAlgorithm; ! private ICryptoTransform decryptionCipher; ! private KeyedHashAlgorithm clientHMAC; ! private KeyedHashAlgorithm serverHMAC; #endregion --- 39,62 ---- #region FIELDS ! private short code; ! private string name; ! private CipherAlgorithmType cipherAlgorithmType; ! private HashAlgorithmType hashAlgorithmType; ! private ExchangeAlgorithmType exchangeAlgorithmType; ! private bool isExportable; ! private CipherMode cipherMode; ! private byte keyMaterialSize; ! private int keyBlockSize; ! private byte expandedKeyMaterialSize; ! private short effectiveKeyBits; ! private byte ivSize; ! private byte blockSize; ! private TlsContext context; ! private SymmetricAlgorithm encryptionAlgorithm; ! private ICryptoTransform encryptionCipher; ! private SymmetricAlgorithm decryptionAlgorithm; ! private ICryptoTransform decryptionCipher; ! private KeyedHashAlgorithm clientHMAC; ! private KeyedHashAlgorithm serverHMAC; #endregion *************** *** 63,82 **** protected ICryptoTransform EncryptionCipher { ! get { return encryptionCipher; } } protected ICryptoTransform DecryptionCipher { ! get { return decryptionCipher; } } protected KeyedHashAlgorithm ClientHMAC { ! get { return clientHMAC; } } protected KeyedHashAlgorithm ServerHMAC { ! get { return serverHMAC; } } --- 66,85 ---- protected ICryptoTransform EncryptionCipher { ! get { return this.encryptionCipher; } } protected ICryptoTransform DecryptionCipher { ! get { return this.decryptionCipher; } } protected KeyedHashAlgorithm ClientHMAC { ! get { return this.clientHMAC; } } protected KeyedHashAlgorithm ServerHMAC { ! get { return this.serverHMAC; } } *************** *** 85,155 **** #region PROPERTIES ! public short Code { ! get { return code; } } ! public string Name { ! get { return name; } } ! public bool IsExportable { ! get { return isExportable; } } public CipherMode CipherMode { ! get { return cipherMode; } } ! public int HashSize { ! get { return (int)(hashName == "MD5" ? 16 : 20); } } public byte KeyMaterialSize { ! get { return keyMaterialSize; } } public int KeyBlockSize { ! get ! { ! return keyMaterialSize*2 + HashSize*2 + ivSize*2; ! } } public byte ExpandedKeyMaterialSize { ! get { return expandedKeyMaterialSize; } } public byte EffectiveKeyBits { ! get { return EffectiveKeyBits; } } public byte IvSize { ! get { return ivSize; } } public byte BlockSize { ! get { return blockSize; } ! } ! ! public string HashName ! { ! get { return hashName; } } ! public TlsSessionContext Context { ! get { return context; } ! set { context = value; } } --- 88,196 ---- #region PROPERTIES ! public CipherAlgorithmType CipherAlgorithmType { ! get { return this.cipherAlgorithmType; } } ! public string HashAlgorithmName { ! get ! { ! switch (this.hashAlgorithmType) ! { ! case HashAlgorithmType.Md5: ! return "MD5"; ! ! case HashAlgorithmType.Sha1: ! return "SHA1"; ! ! default: ! return "None"; ! } ! } } ! public HashAlgorithmType HashAlgorithmType { ! get { return this.hashAlgorithmType; } ! } ! ! public int HashSize ! { ! get ! { ! switch (this.hashAlgorithmType) ! { ! case HashAlgorithmType.Md5: ! return 16; ! ! case HashAlgorithmType.Sha1: ! return 20; ! ! default: ! return 0; ! } ! } ! } ! ! public ExchangeAlgorithmType ExchangeAlgorithmType ! { ! get { return this.exchangeAlgorithmType; } } public CipherMode CipherMode { ! get { return this.cipherMode; } } ! public short Code { ! get { return this.code; } ! } ! ! public string Name ! { ! get { return this.name; } ! } ! ! public bool IsExportable ! { ! get { return this.isExportable; } } public byte KeyMaterialSize { ! get { return this.keyMaterialSize; } } public int KeyBlockSize { ! get { return this.keyBlockSize; } } public byte ExpandedKeyMaterialSize { ! get { return this.expandedKeyMaterialSize; } } public byte EffectiveKeyBits { ! get { return this.EffectiveKeyBits; } } public byte IvSize { ! get { return this.ivSize; } } public byte BlockSize { ! get { return this.blockSize; } } ! public TlsContext Context { ! get { return this.context; } ! set { this.context = value; } } *************** *** 158,177 **** #region CONSTRUCTORS ! public CipherSuite(short code, string name, string algName, string hashName, bool exportable, bool blockMode, byte keyMaterialSize, byte expandedKeyMaterialSize, short effectiveKeyBytes, byte ivSize, byte blockSize) { ! this.code = code; ! this.name = name; ! this.algName = algName; ! this.hashName = hashName; ! this.isExportable = exportable; if (blockMode) { ! this.cipherMode = CipherMode.CBC; } ! this.keyMaterialSize = keyMaterialSize; ! this.expandedKeyMaterialSize = expandedKeyMaterialSize; ! this.effectiveKeyBits = effectiveKeyBits; ! this.ivSize = ivSize; ! this.blockSize = blockSize; } --- 199,225 ---- #region CONSTRUCTORS ! public CipherSuite( ! short code, string name, CipherAlgorithmType cipherAlgorithmType, ! HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) { ! this.code = code; ! this.name = name; ! this.cipherAlgorithmType = cipherAlgorithmType; ! this.hashAlgorithmType = hashAlgorithmType; ! this.exchangeAlgorithmType = exchangeAlgorithmType; ! this.isExportable = exportable; if (blockMode) { ! this.cipherMode = CipherMode.CBC; } ! this.keyMaterialSize = keyMaterialSize; ! this.expandedKeyMaterialSize= expandedKeyMaterialSize; ! this.effectiveKeyBits = effectiveKeyBits; ! this.ivSize = ivSize; ! this.blockSize = blockSize; ! this.keyBlockSize = this.keyMaterialSize*2 + this.HashSize*2 + this.ivSize*2; } *************** *** 182,187 **** public void InitializeCipher() { ! createEncryptionCipher(); ! createDecryptionCipher(); } --- 230,235 ---- public void InitializeCipher() { ! this.createEncryptionCipher(); ! this.createDecryptionCipher(); } *************** *** 191,195 **** if (this.Context.ServerSettings.ServerKeyExchange) { ! rsa = new RSACryptoServiceProvider(); rsa.ImportParameters(this.Context.ServerSettings.RsaParameters); } --- 239,243 ---- if (this.Context.ServerSettings.ServerKeyExchange) { ! rsa = RSA.Create(); rsa.ImportParameters(this.Context.ServerSettings.RsaParameters); } *************** *** 202,226 **** } - public RSACryptoServiceProvider CreateRSA(RSAParameters rsaParams) - { - // BUG: MS BCL 1.0 can't import a key which - // isn't the same size as the one present in - // the container. - int keySize = (rsaParams.Modulus.Length << 3); - RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(keySize); - rsa.ImportParameters(rsaParams); - - return rsa; - } - public void UpdateClientCipherIV(byte[] iv) { ! if (cipherMode == CipherMode.CBC) { // Set the new IV ! encryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! encryptionCipher = encryptionAlgorithm.CreateEncryptor(); } } --- 250,262 ---- } public void UpdateClientCipherIV(byte[] iv) { ! if (this.cipherMode == CipherMode.CBC) { // Set the new IV ! this.encryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! this.encryptionCipher = this.encryptionAlgorithm.CreateEncryptor(); } } *************** *** 228,238 **** public void UpdateServerCipherIV(byte[] iv) { ! if (cipherMode == CipherMode.CBC) { // Set the new IV ! decryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! decryptionCipher = decryptionAlgorithm.CreateDecryptor(); } } --- 264,274 ---- public void UpdateServerCipherIV(byte[] iv) { ! if (this.cipherMode == CipherMode.CBC) { // Set the new IV ! this.decryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! this.decryptionCipher = this.decryptionAlgorithm.CreateDecryptor(); } } *************** *** 294,302 **** */ ! fragmentSize = (buffer.Length - (paddingLength + 1)) - HashSize; } else { ! fragmentSize = buffer.Length - HashSize; } --- 330,338 ---- */ ! fragmentSize = (buffer.Length - (paddingLength + 1)) - this.HashSize; } else { ! fragmentSize = buffer.Length - this.HashSize; } *************** *** 388,392 **** } ! HMAC hmac = new HMAC(hashName, secret); TlsStream resMacs = new TlsStream(); --- 424,428 ---- } ! M.HMAC hmac = new M.HMAC(hashName, secret); TlsStream resMacs = new TlsStream(); *************** *** 418,473 **** #region PRIVATE_METHODS - // This code is from Mono.Security.X509Certificate class. - private byte[] getUnsignedBigInteger(byte[] integer) - { - if (integer[0] == 0x00) - { - // this first byte is added so we're sure it's an unsigned integer - // however we can't feed it into RSAParameters or DSAParameters - int length = integer.Length - 1; - byte[] uinteger = new byte[length]; - Array.Copy(integer, 1, uinteger, 0, length); - - return uinteger; - } - else - { - return integer; - } - } - private void createEncryptionCipher() { // Create and configure the symmetric algorithm ! switch (this.algName) { ! case "RC4": ! encryptionAlgorithm = new ARC4Managed(); break; ! default: ! encryptionAlgorithm = SymmetricAlgorithm.Create(algName); break; } // If it's a block cipher ! if (cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! encryptionAlgorithm.Mode = this.cipherMode; ! encryptionAlgorithm.Padding = PaddingMode.None; ! encryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! encryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! encryptionAlgorithm.Key = context.ClientWriteKey; ! encryptionAlgorithm.IV = context.ClientWriteIV; // Create encryption cipher ! encryptionCipher = encryptionAlgorithm.CreateEncryptor(); // Create the HMAC algorithm for the client ! clientHMAC = new HMAC(hashName, context.ClientWriteMAC); } --- 454,504 ---- #region PRIVATE_METHODS private void createEncryptionCipher() { // Create and configure the symmetric algorithm ! switch (this.cipherAlgorithmType) { ! case CipherAlgorithmType.Des: ! this.encryptionAlgorithm = DES.Create(); break; ! case CipherAlgorithmType.Rc2: ! this.encryptionAlgorithm = RC2.Create(); ! break; ! ! case CipherAlgorithmType.Rc4: ! this.encryptionAlgorithm = new ARC4Managed(); ! break; ! ! case CipherAlgorithmType.TripleDes: ! this.encryptionAlgorithm = TripleDES.Create(); ! break; ! ! case CipherAlgorithmType.Rijndael: ! this.encryptionAlgorithm = Rijndael.Create(); break; } // If it's a block cipher ! if (this.cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! this.encryptionAlgorithm.Mode = this.cipherMode; ! this.encryptionAlgorithm.Padding = PaddingMode.None; ! this.encryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! this.encryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! this.encryptionAlgorithm.Key = this.context.ClientWriteKey; ! this.encryptionAlgorithm.IV = this.context.ClientWriteIV; // Create encryption cipher ! this.encryptionCipher = this.encryptionAlgorithm.CreateEncryptor(); // Create the HMAC algorithm for the client ! this.clientHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ClientWriteMAC); } *************** *** 475,508 **** { // Create and configure the symmetric algorithm ! switch (this.algName) { ! case "RC4": ! decryptionAlgorithm = new ARC4Managed(); break; ! default: ! decryptionAlgorithm = SymmetricAlgorithm.Create(algName); break; } // If it's a block cipher ! if (cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! decryptionAlgorithm.Mode = this.cipherMode; ! decryptionAlgorithm.Padding = PaddingMode.None; ! decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! decryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! decryptionAlgorithm.Key = context.ServerWriteKey; ! decryptionAlgorithm.IV = context.ServerWriteIV; // Create decryption cipher ! decryptionCipher = decryptionAlgorithm.CreateDecryptor(); // Create the HMAC algorithm for the server ! serverHMAC = new HMAC(hashName, context.ServerWriteMAC); } --- 506,553 ---- { // Create and configure the symmetric algorithm ! switch (this.cipherAlgorithmType) { ! case CipherAlgorithmType.Des: ! this.decryptionAlgorithm = DES.Create(); break; ! case CipherAlgorithmType.Rc2: ! this.decryptionAlgorithm = RC2.Create(); ! break; ! ! case CipherAlgorithmType.Rc4: ! this.decryptionAlgorithm = new ARC4Managed(); ! break; ! ! case CipherAlgorithmType.TripleDes: ! this.decryptionAlgorithm = TripleDES.Create(); ! break; ! ! case CipherAlgorithmType.Rijndael: ! this.decryptionAlgorithm = Rijndael.Create(); break; } // If it's a block cipher ! if (this.cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! this.decryptionAlgorithm.Mode = this.cipherMode; ! this.decryptionAlgorithm.Padding = PaddingMode.None; ! this.decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! this.decryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! this.decryptionAlgorithm.Key = this.context.ServerWriteKey; ! this.decryptionAlgorithm.IV = this.context.ServerWriteIV; // Create decryption cipher ! this.decryptionCipher = this.decryptionAlgorithm.CreateDecryptor(); // Create the HMAC algorithm for the server ! this.serverHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ServerWriteMAC); } Index: TlsCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuite.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsCipherSuite.cs 24 Oct 2003 09:39:21 -0000 1.8 --- TlsCipherSuite.cs 13 Nov 2003 09:21:52 -0000 1.9 *************** *** 38,48 **** #region CONSTRUCTORS ! public TlsCipherSuite(short code, string name, string algName, ! string hashName, bool exportable, bool blockMode, ! byte keyMaterialSize, byte expandedKeyMaterialSize, ! short effectiveKeyBytes, byte ivSize, byte blockSize) ! : base (code, name, algName, hashName, exportable, blockMode, ! keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ! ivSize, blockSize) { } --- 38,50 ---- #region CONSTRUCTORS ! public TlsCipherSuite( ! short code, string name, CipherAlgorithmType cipherAlgorithmType, ! HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) : ! base(code, name, cipherAlgorithmType, hashAlgorithmType, ! exchangeAlgorithmType, exportable, blockMode, keyMaterialSize, ! expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize) { } Index: TlsCipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteCollection.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsCipherSuiteCollection.cs 21 Oct 2003 20:04:09 -0000 1.4 --- TlsCipherSuiteCollection.cs 13 Nov 2003 09:21:52 -0000 1.5 *************** *** 34,38 **** #region FIELDS ! private TlsProtocol protocol; #endregion --- 34,38 ---- #region FIELDS ! private SecurityProtocolType protocol; #endregion *************** *** 62,66 **** #region CONSTRUCTORS ! public TlsCipherSuiteCollection(TlsProtocol protocol) : base() { this.protocol = protocol; --- 62,66 ---- #region CONSTRUCTORS ! public TlsCipherSuiteCollection(SecurityProtocolType protocol) : base() { this.protocol = protocol; *************** *** 109,123 **** } ! public CipherSuite Add(short code, string name, string algName, string hashName, bool exportable, bool blockMode, byte keyMaterialSize, byte expandedKeyMaterialSize, short effectiveKeyBytes, byte ivSize, byte blockSize) { switch (this.protocol) { ! case TlsProtocol.Tls1: return this.add( ! new TlsCipherSuite(code, name, algName, hashName, exportable, blockMode, keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize)); ! case TlsProtocol.Ssl3: return this.add( ! new TlsSslCipherSuite(code, name, algName, hashName, exportable, blockMode, keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize)); default: --- 109,134 ---- } ! public CipherSuite Add( ! short code, string name, CipherAlgorithmType cipherType, ! HashAlgorithmType hashType, ExchangeAlgorithmType exchangeType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) { switch (this.protocol) { ! case SecurityProtocolType.Ssl3: return this.add( ! new TlsSslCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); ! case SecurityProtocolType.Tls1: return this.add( ! new TlsCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); default: Index: TlsCipherSuiteFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsCipherSuiteFactory.cs 7 Nov 2003 10:05:35 -0000 1.9 --- TlsCipherSuiteFactory.cs 13 Nov 2003 09:21:52 -0000 1.10 *************** *** 29,42 **** internal class TlsCipherSuiteFactory { ! public static TlsCipherSuiteCollection GetSupportedCiphers(TlsProtocol protocol) { switch (protocol) { ! case TlsProtocol.Tls1: ! return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); ! ! case TlsProtocol.Ssl3: return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); default: throw new NotSupportedException(); --- 29,42 ---- internal class TlsCipherSuiteFactory { ! public static TlsCipherSuiteCollection GetSupportedCiphers(SecurityProtocolType protocol) { switch (protocol) { ! case SecurityProtocolType.Ssl3: return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); + case SecurityProtocolType.Tls1: + return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); + default: throw new NotSupportedException(); *************** *** 48,96 **** private static TlsCipherSuiteCollection GetTls1SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(TlsProtocol.Tls1); // Supported ciphers ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 16, 16); ! scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "TLS_NULL_WITH_NULL_NULL", "", "", true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "TLS_RSA_WITH_NULL_MD5", "", "MD5", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", "", "SHA1", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", "RC2", "MD5", true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "TLS_RSA_WITH_IDEA_CBC_SHA", "IDEA", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "TLS_DH_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "TLS_DH_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "TLS_DHE_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "TLS_DHE_RSA_WITH_DES_CBC_SHA", "SHA1", "DES", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "TLS_DH_anon_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "TLS_DH_anon_WITH_DES_CBC_SHA", "DES4", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); // AES CipherSuites --- 48,96 ---- private static TlsCipherSuiteCollection GetTls1SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Tls1); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); ! scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "TLS_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "TLS_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSignKeyX, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "TLS_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "TLS_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "TLS_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "TLS_DHE_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "TLS_DHE_RSA_WITH_DES_CBC_SHA", HashAlgorithmType.Sha1, CipherAlgorithmType.Des, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.DiffieHellman, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "TLS_DH_anon_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, false, ExchangeAlgorithmType.DiffieHellman, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "TLS_DH_anon_WITH_DES_CBC_SHA", "DES4", HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); // AES CipherSuites *************** *** 98,114 **** // Ref: RFC3268 - (http://www.ietf.org/rfc/rfc3268.txt) ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x30, "TLS_DH_DSS_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x31, "TLS_DH_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x32, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x33, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x34, "TLS_DH_anon_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x36, "TLS_DH_DSS_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x37, "TLS_DH_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x38, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x39, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x3A, "TLS_DH_anon_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); return scs; --- 98,114 ---- // Ref: RFC3268 - (http://www.ietf.org/rfc/rfc3268.txt) ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x30, "TLS_DH_DSS_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x31, "TLS_DH_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x32, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x33, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x34, "TLS_DH_anon_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x36, "TLS_DH_DSS_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x37, "TLS_DH_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x38, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x39, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x3A, "TLS_DH_anon_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); return scs; *************** *** 117,163 **** private static TlsCipherSuiteCollection GetSsl3SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(TlsProtocol.Ssl3); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", "", "", true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "SSL_RSA_WITH_NULL_MD5", "", "MD5", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "SSL_RSA_WITH_NULL_SHA", "", "SHA1", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", "RC2", "MD5", true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "SSL_RSA_WITH_IDEA_CBC_SHA", "IDEA", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "SSL_DH_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "SSL_DH_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "SSL_DHE_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "SSL_DHE_RSA_WITH_DES_CBC_SHA", "SHA1", "DES", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "SSL_DH_anon_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "SSL_DH_anon_WITH_DES_CBC_SHA", "DES4", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); return scs; --- 117,163 ---- private static TlsCipherSuiteCollection GetSsl3SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Ssl3); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "SSL_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "SSL_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, true, ExchangeAlgorithmType.None, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "SSL_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyEx, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "SSL_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "SSL_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "SSL_DHE_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "SSL_DHE_RSA_WITH_DES_CBC_SHA", HashAlgorithmType.Sha1, CipherAlgorithmType.Des, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.DiffieHellman, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "SSL_DH_anon_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, false, ExchangeAlgorithmType.DiffieHellman, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "SSL_DH_anon_WITH_DES_CBC_SHA", "DES4", HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); return scs; *************** *** 166,168 **** #endregion } ! } --- 166,168 ---- #endregion } ! } \ No newline at end of file Index: TlsNetworkStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsNetworkStream.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsNetworkStream.cs 11 Oct 2003 10:04:20 -0000 1.1 --- TlsNetworkStream.cs 13 Nov 2003 09:21:52 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- using System.Net; using System.Net.Sockets; + using System.Security.Cryptography.X509Certificates; namespace Mono.Security.Protocol.Tls *************** *** 93,96 **** --- 94,154 ---- } } + + #endregion + + #region SECURITY_PROPERTIES + + public CipherAlgorithmType CipherAlgorithm + { + get { return this.socket.Session.Context.Cipher.CipherAlgorithmType;} + } + + public int CipherStrength + { + get { return this.socket.Session.Context.Cipher.EffectiveKeyBits;} + } + + public X509CertificateCollection ClientCertificates + { + get { return this.socket.Session.Settings.Certificates;} + } + + public HashAlgorithmType HashAlgorithm + { + get { return this.socket.Session.Context.Cipher.HashAlgorithmType; } + } + + public int HashStrength + { + get { return this.socket.Session.Context.Cipher.HashSize * 8; } + } + + public int KeyExchangeStrength + { + get + { + return this.socket.Session.Context.ServerSettings.Certificates[0].RSA.KeySize; + } + } + + public ExchangeAlgorithmType KeyExchangeAlgorithm + { + get { return this.socket.Session.Context.Cipher.ExchangeAlgorithmType; } + } + + public SecurityProtocolType SecurityProtocol + { + get { return this.socket.Session.Context.Protocol; } + } + + public X509Certificate SelectedClientCertificate + { + get { throw new NotImplementedException(); } + } + + public X509Certificate ServerCertificate + { + get { throw new NotImplementedException(); } + } #endregion Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsSession.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsSession.cs 21 Oct 2003 20:04:09 -0000 1.8 --- TlsSession.cs 13 Nov 2003 09:21:52 -0000 1.9 *************** *** 46,50 **** private byte[] sessionId; ! private TlsSessionContext context; private TlsSessionSettings settings; private TlsSocket socket; --- 46,50 ---- private byte[] sessionId; ! private TlsContext context; private TlsSessionSettings settings; private TlsSocket socket; *************** *** 76,80 **** #region INTERNAL_PROPERTIES ! internal TlsSessionContext Context { get { return context; } --- 76,80 ---- #region INTERNAL_PROPERTIES ! internal TlsContext Context { get { return context; } *************** *** 99,103 **** { this.settings = settings; ! this.context = new TlsSessionContext(); this.sessionId = new byte[0]; --- 99,103 ---- { this.settings = settings; ! this.context = new TlsContext(); this.sessionId = new byte[0]; *************** *** 257,261 **** // Reset session information this.isSecure = false; ! this.context = new TlsSessionContext(); this.sessionId = new byte[0]; } --- 257,261 ---- // Reset session information this.isSecure = false; ! this.context = new TlsContext(); this.sessionId = new byte[0]; } Index: TlsSessionSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsSessionSettings.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsSessionSettings.cs 21 Oct 2003 16:05:12 -0000 1.3 --- TlsSessionSettings.cs 13 Nov 2003 09:21:52 -0000 1.4 *************** *** 36,41 **** private int serverPort; private Encoding encoding; ! private TlsProtocol protocol; ! private TlsCompressionMethod compressionMethod; private X509CertificateCollection certificates; --- 36,41 ---- private int serverPort; private Encoding encoding; ! private SecurityProtocolType protocol; ! private SecurityCompressionType compressionMethod; private X509CertificateCollection certificates; *************** *** 62,72 **** } ! public TlsProtocol Protocol { get { return protocol; } set { ! if (value != TlsProtocol.Tls1 && ! value != TlsProtocol.Ssl3) { throw new NotSupportedException("Specified protocol is not supported"); --- 62,72 ---- } ! public SecurityProtocolType Protocol { get { return protocol; } set { ! if (value != SecurityProtocolType.Tls1 && ! value != SecurityProtocolType.Ssl3) { throw new NotSupportedException("Specified protocol is not supported"); *************** *** 76,85 **** } ! public TlsCompressionMethod CompressionMethod { get { return compressionMethod; } set { ! if (value != TlsCompressionMethod.None) { throw new NotSupportedException("Specified compression method is not supported"); --- 76,85 ---- } ! public SecurityCompressionType CompressionMethod { get { return compressionMethod; } set { ! if (value != SecurityCompressionType.None) { throw new NotSupportedException("Specified compression method is not supported"); *************** *** 101,106 **** public TlsSessionSettings() { ! this.protocol = TlsProtocol.Tls1; ! this.compressionMethod = TlsCompressionMethod.None; this.certificates = new X509CertificateCollection(); this.serverName = "localhost"; --- 101,106 ---- public TlsSessionSettings() { ! this.protocol = SecurityProtocolType.Tls1; ! this.compressionMethod = SecurityCompressionType.None; this.certificates = new X509CertificateCollection(); this.serverName = "localhost"; *************** *** 109,118 **** } ! public TlsSessionSettings(TlsProtocol protocol) : this() { this.Protocol = protocol; } ! public TlsSessionSettings(TlsProtocol protocol, Encoding encoding) : this(protocol) { this.encoding = encoding; --- 109,118 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol) : this() { this.Protocol = protocol; } ! public TlsSessionSettings(SecurityProtocolType protocol, Encoding encoding) : this(protocol) { this.encoding = encoding; *************** *** 143,152 **** } ! public TlsSessionSettings(TlsProtocol protocol, string serverName) : this(protocol) { this.serverName = serverName; } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, Encoding encoding) : this(protocol) { this.serverName = serverName; --- 143,152 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName) : this(protocol) { this.serverName = serverName; } ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName, Encoding encoding) : this(protocol) { this.serverName = serverName; *************** *** 155,159 **** ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort) : this(protocol) { this.serverName = serverName; --- 155,159 ---- ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName, int serverPort) : this(protocol) { this.serverName = serverName; *************** *** 161,165 **** } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.serverName = serverName; --- 161,165 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.serverName = serverName; *************** *** 168,177 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates) : this(protocol) { this.certificates = certificates; } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, Encoding encoding) : this(protocol) { this.certificates = certificates; --- 168,177 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates) : this(protocol) { this.certificates = certificates; } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates, Encoding encoding) : this(protocol) { this.certificates = certificates; *************** *** 179,183 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort) : this(protocol) { this.certificates = certificates; --- 179,183 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates, string serverName, int serverPort) : this(protocol) { this.certificates = certificates; *************** *** 186,190 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.certificates = certificates; --- 186,190 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.certificates = certificates; *************** *** 194,213 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509Certificate[] certificate... [truncated message content] |
From: <car...@us...> - 2003-11-13 09:19:43
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv653 Modified Files: PgBaseTest.cs PgGeometicTypesTest.cs Log Message: Added NUnit test for LSeg, Path and Polygon Geometry types Index: PgBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgBaseTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgBaseTest.cs 25 Oct 2003 20:57:49 -0000 1.6 --- PgBaseTest.cs 13 Nov 2003 09:19:40 -0000 1.7 *************** *** 23,26 **** --- 23,29 ---- using NUnit.Framework; + using PostgreSql.Data.PgSqlClient; + using PostgreSql.Data.PgTypes; + namespace PostgreSql.Data.PgSqlClient.UnitTests { *************** *** 167,187 **** // Table for Geometric types tests ! ! commandText.Append("CREATE TABLE public.gemetric_test("); commandText.Append("pk int4 NOT NULL,"); commandText.Append("point_field point,"); ! commandText.Append("point_array point[][],"); ! commandText.Append("box_field box,"); ! commandText.Append("box_array box[],"); ! commandText.Append("line_field line,"); ! commandText.Append("line_array line[],"); commandText.Append("circle_field circle,"); ! commandText.Append("circle_array circle[],"); commandText.Append("polygon_field polygon,"); ! commandText.Append("polygon_array polygon[],"); ! commandText.Append("lseg_field lseg,"); commandText.Append("lseg_array lseg[],"); - commandText.Append("path_field path,"); commandText.Append("path_array path[],"); commandText.Append("CONSTRAINT geometric_test_pkey PRIMARY KEY (pk)"); commandText.Append(") WITH OIDS;"); --- 170,189 ---- // Table for Geometric types tests ! commandText.Append("CREATE TABLE public.geometric_table("); commandText.Append("pk int4 NOT NULL,"); commandText.Append("point_field point,"); ! commandText.Append("box_field box,"); commandText.Append("circle_field circle,"); ! commandText.Append("lseg_field lseg,"); ! commandText.Append("path_field path,"); commandText.Append("polygon_field polygon,"); ! commandText.Append("point_array point[],"); ! commandText.Append("box_array box[],"); ! commandText.Append("circle_array circle[],"); commandText.Append("lseg_array lseg[],"); commandText.Append("path_array path[],"); + commandText.Append("polygon_array polygon[],"); + commandText.Append("line_field line,"); + commandText.Append("line_array line[],"); commandText.Append("CONSTRAINT geometric_test_pkey PRIMARY KEY (pk)"); commandText.Append(") WITH OIDS;"); *************** *** 192,195 **** --- 194,198 ---- insertTestData(); + insertGeometricTestData(); } *************** *** 283,287 **** command.Parameters.Add("@date_field", PgDbType.Date); command.Parameters.Add("@time_field", PgDbType.Time); ! command.Parameters.Add("@timestamp_field", PgDbType.TimeStamp); for (int i = 0; i < 100; i++) --- 286,290 ---- command.Parameters.Add("@date_field", PgDbType.Date); command.Parameters.Add("@time_field", PgDbType.Time); ! command.Parameters.Add("@timestamp_field", PgDbType.Timestamp); for (int i = 0; i < 100; i++) *************** *** 295,298 **** --- 298,346 ---- command.Parameters["@time_field"].Value = DateTime.Now; command.Parameters["@timestamp_field"].Value = DateTime.Now; + + command.ExecuteNonQuery(); + } + + // Commit transaction + transaction.Commit(); + } + catch (PgException ex) + { + transaction.Rollback(); + throw ex; + } + finally + { + command.Dispose(); + } + } + + private void insertGeometricTestData() + { + string commandText = "insert into public.geometric_table values(@pk, @point, @box, @circle, @lseg, @path, @polygon)"; + + PgTransaction transaction = connection.BeginTransaction(); + PgCommand command = new PgCommand(commandText, connection, transaction); + + try + { + // Add command parameters + command.Parameters.Add("@pk", PgDbType.Int4); + command.Parameters.Add("@point", PgDbType.Point); + command.Parameters.Add("@box", PgDbType.Box); + command.Parameters.Add("@circle", PgDbType.Circle); + command.Parameters.Add("@lseg", PgDbType.LSeg); + command.Parameters.Add("@path", PgDbType.Path); + command.Parameters.Add("@polygon", PgDbType.Polygon); + + for (int i = 0; i < 100; i++) + { + command.Parameters["@pk"].Value = i; + command.Parameters["@point"].Value = new PgPoint(i, i + 10); + command.Parameters["@box"].Value = new PgBox(new PgPoint(0,i), new PgPoint(i, i)); + command.Parameters["@circle"].Value = new PgCircle(new PgPoint(i, 0), i); + command.Parameters["@lseg"].Value = new PgLSeg(new PgPoint(-1,0), new PgPoint(1,0)); + command.Parameters["@path"].Value = new PgPath(false, new PgPoint[]{new PgPoint(0,0), new PgPoint(1,0)}); + command.Parameters["@polygon"].Value= new PgPolygon(new PgPoint[]{new PgPoint(1,1), new PgPoint(0,0)}); command.ExecuteNonQuery(); Index: PgGeometicTypesTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgGeometicTypesTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgGeometicTypesTest.cs 25 Oct 2003 21:59:33 -0000 1.2 --- PgGeometicTypesTest.cs 13 Nov 2003 09:19:40 -0000 1.3 *************** *** 32,74 **** public void PointTest() { } [Test] ! public void LineSegmentTest() { } [Test] ! public void BoxTest() { } [Test] ! public void PathTest() { } [Test] ! public void PolygonTest() { } [Test] ! public void CircleTest() { } [Test] ! public void PointArrayTest() { } [Test] ! public void LineSegmentArrayTest() { } [Test] ! public void BoxArrayTest() { } --- 32,207 ---- public void PointTest() { + PgCommand command = new PgCommand("select point_field from public.geometric_table where pk = @pk", Connection); + try + { + command.Parameters.Add("@pk", PgDbType.Int4).Value = 50; + + PgPoint point = (PgPoint)command.ExecuteScalar(); + + Console.WriteLine("Point value: {0}", point.ToString()); + + Assertion.AssertEquals("Invalid X coord in point", 50, point.X); + Assertion.AssertEquals("Invalid Y coord in point", 60, point.Y); + } + catch (Exception ex) + { + throw ex; + } + finally + { + command.Dispose(); + } } [Test] ! public void BoxTest() { + PgCommand command = new PgCommand("select box_field from public.geometric_table where pk = @pk", Connection); + try + { + command.Parameters.Add("@pk", PgDbType.Int4).Value = 70; + + PgBox box = (PgBox)command.ExecuteScalar(); + + Console.WriteLine("Box value: {0}", box.ToString()); + + Assertion.AssertEquals("Invalid X coord in Lower Left corner", 0, box.LowerLeft.X); + Assertion.AssertEquals("Invalid Y coord in Lower Left corner", 70, box.LowerLeft.Y); + + Assertion.AssertEquals("Invalid X coord in Upper Right corner", 70, box.UpperRight.X); + Assertion.AssertEquals("Invalid Y coord in Upper Right corner", 70, box.UpperRight.Y); + } + catch (Exception ex) + { + throw ex; + } + finally + { + command.Dispose(); + } } [Test] ! public void CircleTest() { + PgCommand command = new PgCommand("select circle_field from public.geometric_table where pk = @pk", Connection); + try + { + command.Parameters.Add("@pk", PgDbType.Int4).Value = 30; + + PgCircle circle = (PgCircle)command.ExecuteScalar(); + + Console.WriteLine("Circle value: {0}", circle.ToString()); + + Assertion.AssertEquals("Invalid X coord in circle", 30, circle.Center.X); + Assertion.AssertEquals("Invalid Y coord in circle", 0, circle.Center.Y); + Assertion.AssertEquals("Invalid RADIUS coord in circle", 30, circle.Radius); + } + catch (Exception ex) + { + throw ex; + } + finally + { + command.Dispose(); + } } [Test] ! public void LineSegmentTest() { + PgCommand command = new PgCommand("select lseg_field from public.geometric_table where pk = @pk", Connection); + try + { + command.Parameters.Add("@pk", PgDbType.Int4).Value = 20; + + PgLSeg lseg = (PgLSeg)command.ExecuteScalar(); + + Console.WriteLine("LSeg value: {0}", lseg.ToString()); + + Assertion.AssertEquals("Invalid X coord in start point", -1, lseg.StartPoint.X); + Assertion.AssertEquals("Invalid Y coord in start point", 0, lseg.StartPoint.Y); + + Assertion.AssertEquals("Invalid X coord in end point", 1, lseg.EndPoint.X); + Assertion.AssertEquals("Invalid Y coord in end point", 0, lseg.EndPoint.Y); + } + catch (Exception ex) + { + throw ex; + } + finally + { + command.Dispose(); + } } [Test] ! public void PathTest() { + PgCommand command = new PgCommand("select path_field from public.geometric_table where pk = @pk", Connection); + try + { + command.Parameters.Add("@pk", PgDbType.Int4).Value = 10; + + PgPath path = (PgPath)command.ExecuteScalar(); + + Console.WriteLine("Path value: {0}", path.ToString()); + + Assertion.AssertEquals("Invalid X coord in path point 0", 0, path.Points[0].X); + Assertion.AssertEquals("Invalid Y coord in path point 0", 0, path.Points[0].Y); + + Assertion.AssertEquals("Invalid X coord in path point 1", 1, path.Points[1].X); + Assertion.AssertEquals("Invalid Y coord in path point 1", 0, path.Points[1].Y); + } + catch (Exception ex) + { + throw ex; + } + finally + { + command.Dispose(); + } } [Test] ! public void PolygonTest() { + PgCommand command = new PgCommand("select polygon_field from public.geometric_table where pk = @pk", Connection); + try + { + command.Parameters.Add("@pk", PgDbType.Int4).Value = 10; + + PgPolygon polygon = (PgPolygon)command.ExecuteScalar(); + + Console.WriteLine("Polygon value: {0}", polygon.ToString()); + + Assertion.AssertEquals("Invalid X coord in polygon point 0", 1, polygon.Points[0].X); + Assertion.AssertEquals("Invalid Y coord in polygon point 0", 1, polygon.Points[0].Y); + + Assertion.AssertEquals("Invalid X coord in polygon point 1", 0, polygon.Points[1].X); + Assertion.AssertEquals("Invalid Y coord in polygon point 1", 0, polygon.Points[1].Y); + } + catch (Exception ex) + { + throw ex; + } + finally + { + command.Dispose(); + } } [Test] ! public void BoxArrayTest() { } [Test] ! public void PointArrayTest() { } [Test] ! public void LineSegmentArrayTest() { } |
From: <car...@us...> - 2003-11-12 22:43:41
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1:/tmp/cvs-serv27816 Modified Files: PgAuthMethods.cs Log Message: Updated file Index: PgAuthMethods.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgAuthMethods.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgAuthMethods.cs 15 Aug 2003 17:50:09 -0000 1.2 --- PgAuthMethods.cs 12 Nov 2003 22:43:37 -0000 1.3 *************** *** 27,31 **** public static string GetMD5Hash(byte[] salt, string password) { ! MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider(); StringBuilder md5 = new StringBuilder(); --- 27,31 ---- public static string GetMD5Hash(byte[] salt, string password) { ! HashAlgorithm csp = MD5.Create(); StringBuilder md5 = new StringBuilder(); |
From: <car...@us...> - 2003-11-12 22:38:35
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1:/tmp/cvs-serv26778 Modified Files: PgDbClient.cs PgOutputPacket.cs Log Message: * source/NPgClient/PgDbClient.cs: * source/NPgClient/PgOutputPacket.cs: - Fixed bug #841051. Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** PgDbClient.cs 1 Nov 2003 10:31:05 -0000 1.30 --- PgDbClient.cs 12 Nov 2003 22:38:32 -0000 1.31 *************** *** 143,148 **** TlsSessionSettings tlsSettings = new TlsSessionSettings(); ! tlsSettings.Protocol = TlsProtocol.Tls1; ! tlsSettings.CompressionMethod = TlsCompressionMethod.None; tlsSettings.ServerName = settings.ServerName; tlsSettings.ServerPort = settings.ServerPort; --- 143,148 ---- TlsSessionSettings tlsSettings = new TlsSessionSettings(); ! tlsSettings.Protocol = SecurityProtocolType.Tls1; ! tlsSettings.CompressionMethod = SecurityCompressionType.None; tlsSettings.ServerName = settings.ServerName; tlsSettings.ServerPort = settings.ServerPort; *************** *** 665,669 **** types.Add(600 , "point" , PgDataType.Point , 701, 1, 16); types.Add(601 , "lseg" , PgDataType.LSeg , 600, 1, 32); ! types.Add(602 , "path" , PgDataType.Path , 0, 1, -1); types.Add(603 , "box" , PgDataType.Box , 600, 1, 32); types.Add(604 , "polygon" , PgDataType.Polygon , 0, 1, 16); --- 665,669 ---- types.Add(600 , "point" , PgDataType.Point , 701, 1, 16); types.Add(601 , "lseg" , PgDataType.LSeg , 600, 1, 32); ! types.Add(602 , "path" , PgDataType.Path , 0, 1, 16); types.Add(603 , "box" , PgDataType.Box , 600, 1, 32); types.Add(604 , "polygon" , PgDataType.Polygon , 0, 1, 16); Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PgOutputPacket.cs 28 Oct 2003 10:44:55 -0000 1.17 --- PgOutputPacket.cs 12 Nov 2003 22:38:32 -0000 1.18 *************** *** 218,224 **** public void WritePolygon(PgPolygon polygon) { for (int i = 0; i < polygon.Points.Length; i++) { ! this.WritePoint(polygon.Points[0]); } } --- 218,225 ---- public void WritePolygon(PgPolygon polygon) { + this.WriteInt(polygon.Points.Length); for (int i = 0; i < polygon.Points.Length; i++) { ! this.WritePoint(polygon.Points[i]); } } *************** *** 226,232 **** public void WritePath(PgPath path) { for (int i = 0; i < path.Points.Length; i++) { ! this.WritePoint(path.Points[0]); } } --- 227,235 ---- public void WritePath(PgPath path) { + this.Write(path.IsClosedPath); + this.WriteInt(path.Points.Length); for (int i = 0; i < path.Points.Length; i++) { ! this.WritePoint(path.Points[i]); } } *************** *** 418,423 **** case PgDataType.Polygon: PgPolygon polygon = (PgPolygon)value; ! ! packet.WriteInt(size*polygon.Points.Length); packet.WritePolygon(polygon); break; --- 421,426 ---- case PgDataType.Polygon: PgPolygon polygon = (PgPolygon)value; ! ! packet.WriteInt((size*polygon.Points.Length) + 4); packet.WritePolygon(polygon); break; *************** *** 426,430 **** PgPath path = (PgPath)value; ! packet.WriteInt(size*path.Points.Length); packet.WritePath(path); break; --- 429,433 ---- PgPath path = (PgPath)value; ! packet.WriteInt((size*path.Points.Length) + 5); packet.WritePath(path); break; |
From: <car...@us...> - 2003-11-12 19:54:46
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv22526 Modified Files: changelog.txt Log Message: 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLine.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Added new constructors ( not to all ). - Added Serializable attribute. * source/PgTypes/PgBox.cs: - Added Serializable attribute. * source/PgTransaction.cs: - Removed set accessors from Connection and IsolationLEvel properties. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** changelog.txt 10 Nov 2003 12:11:07 -0000 1.70 --- changelog.txt 12 Nov 2003 19:54:43 -0000 1.71 *************** *** 2,5 **** --- 2,27 ---- ------------------------------------------------------- + 2003-11-12 Carlos Guzmán Álvarez <car...@te...> + + * source/PgTypes/PgBox.cs: + * source/PgTypes/PgCircle.cs: + * source/PgTypes/PgLine.cs: + * source/PgTypes/PgLSeg.cs: + * source/PgTypes/PgPath.cs: + * source/PgTypes/PgPoint.cs: + * source/PgTypes/PgPolygon.cs: + + - Added new constructors ( not to all ). + + - Added Serializable attribute. + + * source/PgTypes/PgBox.cs: + + - Added Serializable attribute. + + * source/PgTransaction.cs: + + - Removed set accessors from Connection and IsolationLEvel properties. + 2003-11-10 Carlos Guzmán Álvarez <car...@te...> |
From: <car...@us...> - 2003-11-12 19:54:24
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv22477 Modified Files: PgTransaction.cs Log Message: 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLine.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Added new constructors ( not to all ). - Added Serializable attribute. * source/PgTypes/PgBox.cs: - Added Serializable attribute. * source/PgTransaction.cs: - Removed set accessors from Connection and IsolationLEvel properties. Index: PgTransaction.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTransaction.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgTransaction.cs 2 Aug 2003 19:43:01 -0000 1.1.1.1 --- PgTransaction.cs 12 Nov 2003 19:54:19 -0000 1.2 *************** *** 45,50 **** public PgConnection Connection { ! get { return connection; } ! set { connection = value; } } --- 45,59 ---- public PgConnection Connection { ! get ! { ! if (!this.isUpdated) ! { ! return this.connection; ! } ! else ! { ! return null; ! } ! } } *************** *** 52,56 **** { get { return isolationLevel; } - set { isolationLevel = value; } } --- 61,64 ---- |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes In directory sc8-pr-cvs1:/tmp/cvs-serv22272 Modified Files: PgBox.cs PgCircle.cs PgLine.cs PgLSeg.cs PgPath.cs PgPoint.cs PgPolygon.cs PgTimeSpan.cs Log Message: 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLine.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Added new constructors ( not to all ). - Added Serializable attribute. * source/PgTypes/PgBox.cs: - Added Serializable attribute. Index: PgBox.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgBox.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgBox.cs 27 Oct 2003 18:46:29 -0000 1.5 --- PgBox.cs 12 Nov 2003 19:53:11 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgBox { *************** *** 50,53 **** --- 51,60 ---- this.lowerLeft = lowerLeft; this.upperRight = upperRight; + } + + public PgBox(double x1, double y1, double x2, double y2) + { + this.lowerLeft = new PgPoint(x1, y1); + this.upperRight = new PgPoint(x2, y2); } Index: PgCircle.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgCircle.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgCircle.cs 26 Oct 2003 14:56:59 -0000 1.3 --- PgCircle.cs 12 Nov 2003 19:53:11 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgCircle { *************** *** 50,53 **** --- 51,60 ---- this.center = center; this.radius = radius; + } + + public PgCircle(double x, double y, double radius) + { + this.center = new PgPoint(x, y); + this.radius = radius; } Index: PgLine.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgLine.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgLine.cs 26 Oct 2003 14:56:59 -0000 1.3 --- PgLine.cs 12 Nov 2003 19:53:11 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgLine { *************** *** 50,53 **** --- 51,60 ---- this.startPoint = startPoint; this.endPoint = endPoint; + } + + public PgLine(double x1, double y1, double x2, double y2) + { + this.startPoint = new PgPoint(x1, y1); + this.endPoint = new PgPoint(x2, y2); } Index: PgLSeg.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgLSeg.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgLSeg.cs 26 Oct 2003 14:56:59 -0000 1.4 --- PgLSeg.cs 12 Nov 2003 19:53:11 -0000 1.5 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgLSeg { *************** *** 50,53 **** --- 51,60 ---- this.startPoint = startPoint; this.endPoint = endPoint; + } + + public PgLSeg(double x1, double y1, double x2, double y2) + { + this.startPoint = new PgPoint(x1, y1); + this.endPoint = new PgPoint(x2, y2); } Index: PgPath.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPath.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgPath.cs 26 Oct 2003 14:56:59 -0000 1.3 --- PgPath.cs 12 Nov 2003 19:53:11 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgPath { Index: PgPoint.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPoint.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgPoint.cs 26 Oct 2003 14:56:59 -0000 1.3 --- PgPoint.cs 12 Nov 2003 19:53:11 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgPoint { Index: PgPolygon.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPolygon.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgPolygon.cs 26 Oct 2003 14:56:59 -0000 1.4 --- PgPolygon.cs 12 Nov 2003 19:53:11 -0000 1.5 *************** *** 20,24 **** namespace PostgreSql.Data.PgTypes ! { public struct PgPolygon { --- 20,25 ---- namespace PostgreSql.Data.PgTypes ! { ! [Serializable] public struct PgPolygon { Index: PgTimeSpan.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgTimeSpan.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgTimeSpan.cs 26 Oct 2003 14:57:31 -0000 1.1 --- PgTimeSpan.cs 12 Nov 2003 19:53:11 -0000 1.2 *************** *** 21,24 **** --- 21,25 ---- namespace PostgreSql.Data.PgTypes { + [Serializable] public struct PgTimeSpan : IComparable { |