pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 18)
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: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 11:28:37
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15676 Modified Files: TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHello.cs TlsServerCertificateRequest.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/SslClientStream.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/TlsException.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Reworked Alert and Exception (TlsException) handling. Index: TlsClientFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsClientFinished.cs 10 Mar 2004 15:50:12 -0000 1.6 --- TlsClientFinished.cs 10 Apr 2004 11:15:08 -0000 1.7 *************** *** 80,86 **** if (decryptError) { ! this.Context.RecordProtocol.SendAlert(AlertDescription.DecryptError); ! ! throw new TlsException("Decrypt error."); } } --- 80,86 ---- if (decryptError) { ! throw new TlsException( ! AlertDescription.DecryptError, ! "Decrypt error."); } } *************** *** 118,124 **** if (decryptError) { ! this.Context.RecordProtocol.SendAlert(AlertDescription.DecryptError); ! ! throw new TlsException("Decrypt error."); } } --- 118,124 ---- if (decryptError) { ! throw new TlsException( ! AlertDescription.DecryptError, ! "Decrypt error."); } } Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsClientCertificateVerify.cs 9 Apr 2004 08:43:38 -0000 1.5 --- TlsClientCertificateVerify.cs 10 Apr 2004 11:15:08 -0000 1.6 *************** *** 60,66 **** signature)) { ! context.RecordProtocol.SendAlert(AlertDescription.HandshakeFailiure); ! ! throw new TlsException("Handshake Failiure."); } } --- 60,66 ---- signature)) { ! throw new TlsException( ! AlertDescription.HandshakeFailiure, ! "Handshake Failiure."); } } *************** *** 82,88 **** signature)) { ! context.RecordProtocol.SendAlert(AlertDescription.HandshakeFailiure); ! ! throw new TlsException("Handshake Failiure."); } } --- 82,88 ---- signature)) { ! throw new TlsException( ! AlertDescription.HandshakeFailiure, ! "Handshake Failiure."); } } Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsServerCertificateRequest.cs 9 Mar 2004 22:04:55 -0000 1.4 --- TlsServerCertificateRequest.cs 10 Apr 2004 11:15:08 -0000 1.5 *************** *** 40,52 **** #endregion - #region Methods - - public override void Update() - { - throw new NotSupportedException(); - } - - #endregion - #region Protected Methods --- 40,43 ---- Index: TlsClientHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsClientHello.cs 19 Mar 2004 22:43:34 -0000 1.8 --- TlsClientHello.cs 10 Apr 2004 11:15:08 -0000 1.9 *************** *** 119,125 **** else { ! this.Context.RecordProtocol.SendAlert(AlertDescription.ProtocolVersion); ! ! throw this.Context.CreateException("Incorrect protocol version received from server"); } } --- 119,125 ---- else { ! throw new TlsException( ! AlertDescription.ProtocolVersion, ! "Incorrect protocol version received from server"); } } *************** *** 140,146 **** if (this.Context.Cipher == null) { ! this.Context.RecordProtocol.SendAlert(AlertDescription.InsuficientSecurity); ! ! throw this.Context.CreateException("Insuficient Security"); } } --- 140,146 ---- if (this.Context.Cipher == null) { ! throw new TlsException( ! AlertDescription.InsuficientSecurity, ! "Insuficient Security"); } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-09 09:00:58
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv992 Modified Files: changelog.txt Log Message: 2004-04-09 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Added new CertificateRSA property. * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: - Added two new methods: CreateSignature and VerifySignature. * Mono.Security.Protocol.Tls.Handshake.Client/TlsCertificateVerify.cs: - Added Ssl3 implementation. * Mono.Security.Protocol.Tls.Handshake.Server/TlsCertificateVerify.cs: - Added initial implementation. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** changelog.txt 19 Mar 2004 22:45:15 -0000 1.25 --- changelog.txt 9 Apr 2004 08:47:39 -0000 1.26 *************** *** 2,5 **** --- 2,23 ---- --------------- ----------- ----------------------------------------- + 2004-04-09 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/TlsClientSettings.cs: + + - Added new CertificateRSA property. + + * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: + + - Added two new methods: CreateSignature and VerifySignature. + + * Mono.Security.Protocol.Tls.Handshake.Client/TlsCertificateVerify.cs: + + - Added Ssl3 implementation. + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsCertificateVerify.cs: + + - Added initial implementation. + 2004-03-19 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-09 08:56:54
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv377 Modified Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs Log Message: 2004-04-09 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Added new CertificateRSA property. * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: - Added two new methods: CreateSignature and VerifySignature. * Mono.Security.Protocol.Tls.Handshake.Client/TlsCertificateVerify.cs: - Added Ssl3 implementation. * Mono.Security.Protocol.Tls.Handshake.Server/TlsCertificateVerify.cs: - Added initial implementation. Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsClientCertificateVerify.cs 9 Mar 2004 22:04:55 -0000 1.4 --- TlsClientCertificateVerify.cs 9 Apr 2004 08:43:38 -0000 1.5 *************** *** 42,64 **** #endregion ! #region Methods ! public override void Update() { ! throw new NotSupportedException(); ! } ! #endregion ! #region Protected Methods ! protected override void ProcessAsSsl3() ! { ! throw new NotSupportedException(); } protected override void ProcessAsTls1() { ! throw new NotSupportedException(); } --- 42,89 ---- #endregion ! #region Protected Methods ! protected override void ProcessAsSsl3() { ! ServerContext context = (ServerContext)this.Context; ! byte[] signature = this.ReadBytes((int)this.Length); ! // Verify signature ! SslHandshakeHash hash = new SslHandshakeHash(context.MasterSecret); ! hash.TransformFinalBlock( ! context.HandshakeMessages.ToArray(), ! 0, ! (int)context.HandshakeMessages.Length); ! if (!hash.VerifySignature( ! context.ClientSettings.CertificateRSA, ! signature)) ! { ! context.RecordProtocol.SendAlert(AlertDescription.HandshakeFailiure); ! throw new TlsException("Handshake Failiure."); ! } } protected override void ProcessAsTls1() { ! ServerContext context = (ServerContext)this.Context; ! byte[] signature = this.ReadBytes((int)this.Length); ! ! // Verify signature ! MD5SHA1 hash = new MD5SHA1(); ! hash.ComputeHash( ! context.HandshakeMessages.ToArray(), ! 0, ! (int)context.HandshakeMessages.Length); ! ! if (!hash.VerifySignature( ! context.ClientSettings.CertificateRSA, ! signature)) ! { ! context.RecordProtocol.SendAlert(AlertDescription.HandshakeFailiure); ! ! throw new TlsException("Handshake Failiure."); ! } } Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsClientCertificate.cs 17 Mar 2004 16:33:36 -0000 1.4 --- TlsClientCertificate.cs 9 Apr 2004 08:43:37 -0000 1.5 *************** *** 67,71 **** this.clientCertificate = new X509Certificate(this.ReadBytes(length)); ! #warning "Is client certificate validation needed ??" } --- 67,80 ---- this.clientCertificate = new X509Certificate(this.ReadBytes(length)); ! this.validateCertificate(this.clientCertificate); ! } ! ! #endregion ! ! #region Private Methods ! ! private void validateCertificate(X509Certificate certificate) ! { ! #warning "Validate client certificate" } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-09 08:56:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv306 Modified Files: TlsClientCertificateVerify.cs Log Message: 2004-04-09 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Added new CertificateRSA property. * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: - Added two new methods: CreateSignature and VerifySignature. * Mono.Security.Protocol.Tls.Handshake.Client/TlsCertificateVerify.cs: - Added Ssl3 implementation. * Mono.Security.Protocol.Tls.Handshake.Server/TlsCertificateVerify.cs: - Added initial implementation. Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsClientCertificateVerify.cs 9 Mar 2004 22:05:30 -0000 1.4 --- TlsClientCertificateVerify.cs 9 Apr 2004 08:43:08 -0000 1.5 *************** *** 56,60 **** protected override void ProcessAsSsl3() { ! throw new NotSupportedException(); } --- 56,85 ---- protected override void ProcessAsSsl3() { ! AsymmetricAlgorithm privKey = null; ! ClientContext context = (ClientContext)this.Context; ! ! privKey = context.SslStream.RaisePrivateKeySelection( ! context.ClientSettings.ClientCertificate, ! context.ClientSettings.TargetHost); ! ! if (privKey == null) ! { ! throw this.Context.CreateException("Client certificate Private Key unavailable."); ! } ! else ! { ! SslHandshakeHash hash = new SslHandshakeHash(context.MasterSecret); ! hash.TransformFinalBlock( ! context.HandshakeMessages.ToArray(), ! 0, ! (int)context.HandshakeMessages.Length); ! ! // RSAManaged of the selected ClientCertificate ! // (at this moment the first one) ! RSA rsa = this.getClientCertRSA((RSA)privKey); ! ! // Write message ! this.Write(hash.CreateSignature(rsa)); ! } } *************** *** 65,70 **** privKey = context.SslStream.RaisePrivateKeySelection( ! this.Context.ClientSettings.ClientCertificate, ! this.Context.ClientSettings.TargetHost); if (privKey == null) --- 90,95 ---- privKey = context.SslStream.RaisePrivateKeySelection( ! context.ClientSettings.ClientCertificate, ! context.ClientSettings.TargetHost); if (privKey == null) |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-09 08:55:38
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32641 Modified Files: SslHandshakeHash.cs TlsClientSettings.cs Log Message: 2004-04-09 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Added new CertificateRSA property. * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: - Added two new methods: CreateSignature and VerifySignature. * Mono.Security.Protocol.Tls.Handshake.Client/TlsCertificateVerify.cs: - Added Ssl3 implementation. * Mono.Security.Protocol.Tls.Handshake.Server/TlsCertificateVerify.cs: - Added initial implementation. Index: SslHandshakeHash.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SslHandshakeHash.cs 15 Mar 2004 13:18:30 -0000 1.2 --- SslHandshakeHash.cs 9 Apr 2004 08:42:21 -0000 1.3 *************** *** 124,127 **** --- 124,157 ---- } + public byte[] CreateSignature(RSA rsa) + { + if (rsa == null) + { + throw new CryptographicUnexpectedOperationException ("missing key"); + } + + RSASslSignatureFormatter f = new RSASslSignatureFormatter(rsa); + f.SetHashAlgorithm("SslHash"); + + return f.CreateSignature(this.Hash); + } + + public bool VerifySignature(RSA rsa, byte[] rgbSignature) + { + if (rsa == null) + { + throw new CryptographicUnexpectedOperationException ("missing key"); + } + if (rgbSignature == null) + { + throw new ArgumentNullException ("rgbSignature"); + } + + RSASslSignatureDeformatter d = new RSASslSignatureDeformatter(rsa); + d.SetHashAlgorithm("SslHash"); + + return d.VerifySignature(this.Hash, rgbSignature); + } + #endregion Index: TlsClientSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsClientSettings.cs 10 Feb 2004 09:43:42 -0000 1.1 --- TlsClientSettings.cs 9 Apr 2004 08:42:21 -0000 1.2 *************** *** 26,29 **** --- 26,31 ---- using System.Text; using System.Security.Cryptography.X509Certificates; + using Mono.Security.Cryptography; + using X509 = Mono.Security.X509; namespace Mono.Security.Protocol.Tls *************** *** 37,40 **** --- 39,43 ---- private SecurityCompressionType compressionMethod; private X509Certificate clientCertificate; + private RSAManaged certificateRSA; #endregion *************** *** 70,76 **** { get { return this.clientCertificate; } ! set { this.clientCertificate = value; } } #endregion --- 73,87 ---- { get { return this.clientCertificate; } ! set ! { ! this.clientCertificate = value; ! this.UpdateCertificateRSA(); ! } } + public RSAManaged CertificateRSA + { + get { return this.certificateRSA; } + } #endregion *************** *** 86,89 **** --- 97,122 ---- #endregion + + #region Methods + + public void UpdateCertificateRSA() + { + if (this.clientCertificate == null) + { + this.certificateRSA = null; + } + else + { + X509.X509Certificate cert = new X509.X509Certificate(this.clientCertificate.GetRawCertData()); + + this.certificateRSA = new RSAManaged( + cert.RSA.KeySize); + + this.certificateRSA.ImportParameters( + cert.RSA.ExportParameters(false)); + } + } + + #endregion } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-06 14:31:04
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27646 Modified Files: PgConnection.cs PgDataReader.cs Log Message: Changes on Db Schema stuff Index: PgConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PgConnection.cs 9 Mar 2004 12:40:35 -0000 1.15 --- PgConnection.cs 6 Apr 2004 14:18:14 -0000 1.16 *************** *** 531,535 **** } ! IDbSchema dbSchema = PgDbSchemaFactory.GetSchema(schema); if (dbSchema == null) --- 531,535 ---- } ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(schema); if (dbSchema == null) Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PgDataReader.cs 1 Apr 2004 16:41:29 -0000 1.20 --- PgDataReader.cs 6 Apr 2004 14:18:15 -0000 1.21 *************** *** 334,338 **** private PgCommand getColumnInfoCmd() { ! IDbSchema dbSchema = PgDbSchemaFactory.GetSchema(PgDbSchemaType.Columns); dbSchema.AddWhereFilter("pg_attribute.attnum = @OidNumber"); --- 334,338 ---- private PgCommand getColumnInfoCmd() { ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(PgDbSchemaType.Columns); dbSchema.AddWhereFilter("pg_attribute.attnum = @OidNumber"); *************** *** 349,353 **** private PgCommand getPrimaryKeyInfoCmd() { ! IDbSchema dbSchema = PgDbSchemaFactory.GetSchema(PgDbSchemaType.Primary_Keys); dbSchema.AddWhereFilter("pg_class.oid = @OidTable"); --- 349,353 ---- private PgCommand getPrimaryKeyInfoCmd() { ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(PgDbSchemaType.Primary_Keys); dbSchema.AddWhereFilter("pg_class.oid = @OidTable"); |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27448 Modified Files: PgAggregatesSchema.cs PgCastsSchema.cs PgCheckConstraints.cs PgCheckConstraintsByTable.cs PgColumnsSchema.cs PgDatabaseSchema.cs PgDbSchemaFactory.cs PgDomainsSchema.cs PgForeignKeysSchema.cs PgFunctionPrivilegesSchema.cs PgFunctionsSchema.cs PgGroupsSchema.cs PgIndexesSchema.cs PgPrimaryKeysSchema.cs PgProviderTypesSchema.cs PgSchemataSchema.cs PgSqlLanguagesSchema.cs PgTableConstraintsSchema.cs PgTablePrivilegesSchema.cs PgTablesSchema.cs PgTableStatisticsSchema.cs PgTriggersSchema.cs PgUsersSchema.cs PgViewPrivilegesSchema.cs PgViewsSchema.cs Added Files: PgDbSchema.cs Removed Files: IDbSchema.cs PgAbstractDbSchema.cs Log Message: Changes on Db Schema stuff Index: PgCastsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCastsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgCastsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgCastsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgCastsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgCastsSchema : PgDbSchema { #region Constructors Index: PgDbSchemaFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDbSchemaFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgDbSchemaFactory.cs 9 Feb 2004 14:19:48 -0000 1.2 --- PgDbSchemaFactory.cs 6 Apr 2004 14:17:33 -0000 1.3 *************** *** 23,29 **** internal class PgDbSchemaFactory { ! public static IDbSchema GetSchema(PgDbSchemaType schema) { ! IDbSchema returnSchema = null; switch(schema) --- 23,29 ---- internal class PgDbSchemaFactory { ! public static PgDbSchema GetSchema(PgDbSchemaType schema) { ! PgDbSchema returnSchema = null; switch(schema) Index: PgTriggersSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTriggersSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgTriggersSchema.cs 9 Feb 2004 14:19:48 -0000 1.6 --- PgTriggersSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTriggersSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTriggersSchema : PgDbSchema { #region Constructors Index: PgPrimaryKeysSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgPrimaryKeysSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgPrimaryKeysSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgPrimaryKeysSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgPrimaryKeysSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgPrimaryKeysSchema : PgDbSchema { #region Constructors --- NEW FILE: PgDbSchema.cs --- /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Data; using System.Text; using System.Text.RegularExpressions; using System.Collections; namespace PostgreSql.Data.PgSqlClient.DbSchema { #region Structures internal struct PgColumn { public string ColumnName; public string ColumnAlias; public string WhereColumnName; } internal struct PgTableJoin { public string JoinType; public string RightTable; public string Expression; } internal struct PgPrivilege { public string User; public MatchCollection Privileges; } #endregion internal abstract class PgDbSchema { #region Fields private ArrayList restrictionColumns; private ArrayList dataColumns; private ArrayList tables; private ArrayList joins; private ArrayList orderByColumns; private ArrayList whereFilters; private string tableName; #endregion #region Properties public ArrayList RestrictionColumns { get { return restrictionColumns; } } #endregion #region Constructors public PgDbSchema() { this.restrictionColumns = new ArrayList(); this.dataColumns = new ArrayList(); this.tables = new ArrayList(); this.joins = new ArrayList(); this.orderByColumns = new ArrayList(); this.whereFilters = new ArrayList(); this.AddTables(); this.AddRestrictionColumns(); this.AddDataColumns(); this.AddJoins(); this.AddOrderByColumns(); this.AddWhereFilters(); } public PgDbSchema(string tableName) : this() { this.tableName = tableName; } #endregion #region Abstract Methods public abstract void AddTables(); public abstract void AddRestrictionColumns(); public abstract void AddDataColumns(); public abstract void AddJoins(); public abstract void AddOrderByColumns(); public abstract void AddWhereFilters(); public abstract object[] ParseRestrictions(object[] restrictions); #endregion #region Add Methods public void AddTable(string tableName) { tables.Add(tableName); } public void AddRestrictionColumn(string columnName, string columnAlias, string whereColumnName) { PgColumn column = new PgColumn(); column.ColumnName = columnName; column.ColumnAlias = columnAlias; if (whereColumnName != null) { column.WhereColumnName = whereColumnName; } else { column.WhereColumnName = columnName; } restrictionColumns.Add(column); } public void AddDataColumn(string columnName, string columnAlias) { PgColumn column = new PgColumn(); column.ColumnName = columnName; column.ColumnAlias = columnAlias; dataColumns.Add(column); } public void AddJoin(string joinType, string rightTable, string expression) { PgTableJoin join = new PgTableJoin(); join.JoinType = joinType; join.RightTable = rightTable; join.Expression = expression; joins.Add(join); } public void AddOrderBy(string column) { orderByColumns.Add(column); } public void AddWhereFilter(string filter) { whereFilters.Add(filter); } #endregion #region Methods public virtual DataTable GetDbSchemaTable(PgConnection connection, object[] restrictions) { restrictions = ParseRestrictions(restrictions); DataSet dataSet = null; PgDataAdapter adapter = null; PgCommand command = new PgCommand(); try { command.Connection = connection; command.CommandText = GetCommandText(restrictions); if (connection.ActiveTransaction != null && !connection.ActiveTransaction.IsUpdated) { command.Transaction = connection.ActiveTransaction; } adapter = new PgDataAdapter(command); dataSet = new DataSet(tableName); adapter.Fill(dataSet, tableName); } catch (PgException pgex) { throw pgex; } catch (Exception ex) { throw new PgException(ex.Message); } finally { command.Dispose(); adapter.Dispose(); } return dataSet.Tables[tableName]; } public string GetCommandText(object[] restrictions) { StringBuilder sql = new StringBuilder(); // Add restriction columns sql.Append("SELECT "); foreach (PgColumn column in restrictionColumns) { sql.AppendFormat("{0} AS {1}", column.ColumnName, column.ColumnAlias); if ((restrictionColumns.IndexOf(column) + 1) < restrictionColumns.Count) { sql.Append(", "); } } // Add DataColumns if (restrictionColumns.Count > 0 && dataColumns.Count > 0) { sql.Append(", "); } foreach (PgColumn column in dataColumns) { sql.AppendFormat("{0} AS {1}", column.ColumnName, column.ColumnAlias); if ((dataColumns.IndexOf(column) + 1) < dataColumns.Count) { sql.Append(", "); } } // Add tables sql.Append(" FROM "); foreach (string table in tables) { sql.Append(table); if ((tables.IndexOf(table) + 1) < tables.Count) { sql.Append(", "); } } if (joins.Count != 0) { foreach (PgTableJoin join in joins) { sql.AppendFormat(" {0} {1} ON {2}", join.JoinType, join.RightTable, join.Expression); } } // Add restrictions StringBuilder whereFilter = new StringBuilder(); if (restrictions != null && restrictions.Length > 0) { for (int i = 0; i < restrictions.Length; i++) { if (restrictions[i] != null) { if (whereFilter.Length > 0) { whereFilter.Append(" AND "); } whereFilter.AppendFormat("{0} = '{1}'", ((PgColumn)restrictionColumns[i]).WhereColumnName, restrictions[i]); } } } if (whereFilters != null && whereFilters.Count > 0) { foreach (string condition in whereFilters) { if (whereFilter.Length > 0) { whereFilter.Append(" AND "); } whereFilter.Append(condition); } } if (whereFilter.Length > 0) { sql.AppendFormat(" WHERE {0}", whereFilter); } // Add Order By if (orderByColumns.Count > 0) { sql.Append(" ORDER BY "); foreach (string columnName in orderByColumns) { sql.Append(columnName); if ((orderByColumns.IndexOf(columnName) + 1) < orderByColumns.Count) { sql.Append(", "); } } } return sql.ToString(); } #endregion #region Protected Methods protected void AddPrivilegesColumns(DataTable table) { table.Columns.Add("INSERT", Type.GetType("System.Boolean")); table.Columns["INSERT"].DefaultValue = false; table.Columns.Add("INSERT_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["INSERT_WITH_GRANT"].DefaultValue = false; table.Columns.Add("SELECT", Type.GetType("System.Boolean")); table.Columns["SELECT"].DefaultValue = false; table.Columns.Add("SELECT_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["SELECT_WITH_GRANT"].DefaultValue = false; table.Columns.Add("UPDATE", Type.GetType("System.Boolean")); table.Columns["UPDATE"].DefaultValue = false; table.Columns.Add("UPDATE_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["UPDATE_WITH_GRANT"].DefaultValue = false; table.Columns.Add("DELETE", Type.GetType("System.Boolean")); table.Columns["DELETE"].DefaultValue = false; table.Columns.Add("DELETE_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["DELETE_WITH_GRANT"].DefaultValue = false; table.Columns.Add("RULE", Type.GetType("System.Boolean")); table.Columns["RULE"].DefaultValue = false; table.Columns.Add("RULE_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["RULE_WITH_GRANT"].DefaultValue = false; table.Columns.Add("REFERENCES", Type.GetType("System.Boolean")); table.Columns["REFERENCES"].DefaultValue = false; table.Columns.Add("REFERENCES_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["REFERENCES_WITH_GRANT"].DefaultValue = false; table.Columns.Add("TRIGGER", Type.GetType("System.Boolean")); table.Columns["TRIGGER"].DefaultValue = false; table.Columns.Add("TRIGGER_WITH_GRANT", Type.GetType("System.Boolean")); table.Columns["TRIGGER_WITH_GRANT"].DefaultValue = false; } protected PgPrivilege[] DecodePrivileges(string[] acl) { Regex search = new Regex(@"((a|r|w|d|R|x|t)\*?)"); PgPrivilege[] priv = new PgPrivilege[acl.Length]; for (int i = 0; i < acl.Length; i++) { priv[i].User = acl[i].Split('=')[0]; if (priv[i].User.Length == 0) { priv[i].User = "PUBLIC"; } string aclitem = acl[i].Split('=')[1]; aclitem = aclitem.Split('/')[0]; priv[i].Privileges = search.Matches(aclitem); } return priv; } protected void FillPrivileges(DataRow row, MatchCollection privileges) { foreach (Match privilege in privileges) { switch (privilege.Value) { case "a": case "a*": row["INSERT"] = true; if (privilege.Value.IndexOf("*") != -1) { row["INSERT_WITH_GRANT"] = true; } break; case "r": case "r*": row["SELECT"] = true; if (privilege.Value.IndexOf("*") != -1) { row["SELECT_WITH_GRANT"] = true; } break; case "w": case "w*": row["UPDATE"] = true; if (privilege.Value.IndexOf("*") != -1) { row["UPDATE_WITH_GRANT"] = true; } break; case "d": case "d*": row["DELETE"] = true; if (privilege.Value.IndexOf("*") != -1) { row["DELETE_WITH_GRANT"] = false; } break; case "R": case "R*": row["RULE"] = true; if (privilege.Value.IndexOf("*") != -1) { row["RULE_WITH_GRANT"] = true; } break; case "x": case "x*": row["REFERENCES"] = true; if (privilege.Value.IndexOf("*") != -1) { row["REFERENCES_WITH_GRANT"] = true; } break; case "t": case "t*": row["TRIGGER"] = true; if (privilege.Value.IndexOf("*") != -1) { row["TRIGGER_WITH_GRANT"] = true; } break; } } } #endregion } } Index: PgProviderTypesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgProviderTypesSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgProviderTypesSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgProviderTypesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgProviderTypesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgProviderTypesSchema : PgDbSchema { #region Constructors --- PgAbstractDbSchema.cs DELETED --- Index: PgDatabaseSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDatabaseSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgDatabaseSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgDatabaseSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgDatabaseSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgDatabaseSchema : PgDbSchema { #region Constructors Index: PgIndexesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgIndexesSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgIndexesSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgIndexesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgIndexesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgIndexesSchema : PgDbSchema { #region Constructors Index: PgSchemataSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgSchemataSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgSchemataSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgSchemataSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgSchemataSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgSchemataSchema : PgDbSchema { #region Constructors Index: PgTablePrivilegesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTablePrivilegesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgTablePrivilegesSchema.cs 9 Feb 2004 14:19:48 -0000 1.6 --- PgTablePrivilegesSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 *************** *** 24,28 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTablePrivilegesSchema : PgAbstractDbSchema { #region Constructors --- 24,28 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTablePrivilegesSchema : PgDbSchema { #region Constructors Index: PgFunctionPrivilegesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgFunctionPrivilegesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgFunctionPrivilegesSchema.cs 9 Feb 2004 14:19:48 -0000 1.6 --- PgFunctionPrivilegesSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgFunctionPrivilegesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgFunctionPrivilegesSchema : PgDbSchema { #region Constructors Index: PgSqlLanguagesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgSqlLanguagesSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgSqlLanguagesSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgSqlLanguagesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgSqlLanguagesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgSqlLanguagesSchema : PgDbSchema { #region Constructors Index: PgTableConstraintsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTableConstraintsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgTableConstraintsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgTableConstraintsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTableConstraintsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTableConstraintsSchema : PgDbSchema { #region Constructors Index: PgUsersSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgUsersSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgUsersSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgUsersSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgUsersSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgUsersSchema : PgDbSchema { #region Constructors Index: PgForeignKeysSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgForeignKeysSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgForeignKeysSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgForeignKeysSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgForeignKeysSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgForeignKeysSchema : PgDbSchema { #region Constructors Index: PgTablesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTablesSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgTablesSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgTablesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTablesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTablesSchema : PgDbSchema { #region Constructors Index: PgCheckConstraintsByTable.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCheckConstraintsByTable.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgCheckConstraintsByTable.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgCheckConstraintsByTable.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgCheckConstraintsByTableSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgCheckConstraintsByTableSchema : PgDbSchema { #region Constructors Index: PgFunctionsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgFunctionsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgFunctionsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgFunctionsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgFunctionsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgFunctionsSchema : PgDbSchema { #region Constructors Index: PgViewsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgViewsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgViewsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgViewsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgViewsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgViewsSchema : PgDbSchema { #region Constructors Index: PgTableStatisticsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTableStatisticsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgTableStatisticsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgTableStatisticsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 24,28 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTableStatisticsSchema : PgAbstractDbSchema { #region Constructors --- 24,28 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgTableStatisticsSchema : PgDbSchema { #region Constructors Index: PgCheckConstraints.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCheckConstraints.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgCheckConstraints.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgCheckConstraints.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgCheckConstraintsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgCheckConstraintsSchema : PgDbSchema { #region Constructors Index: PgColumnsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgColumnsSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgColumnsSchema.cs 9 Feb 2004 14:19:48 -0000 1.7 --- PgColumnsSchema.cs 6 Apr 2004 14:17:33 -0000 1.8 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgColumnsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgColumnsSchema : PgDbSchema { #region Constructors Index: PgGroupsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgGroupsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgGroupsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgGroupsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgGroupsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgGroupsSchema : PgDbSchema { #region Constructors Index: PgAggregatesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgAggregatesSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgAggregatesSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgAggregatesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgAggregatesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgAggregatesSchema : PgDbSchema { #region Constructors Index: PgViewPrivilegesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgViewPrivilegesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgViewPrivilegesSchema.cs 9 Feb 2004 14:19:48 -0000 1.6 --- PgViewPrivilegesSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgViewPrivilegesSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgViewPrivilegesSchema : PgDbSchema { #region Constructors Index: PgDomainsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDomainsSchema.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgDomainsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 --- PgDomainsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 *************** *** 23,27 **** namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgDomainsSchema : PgAbstractDbSchema { #region Constructors --- 23,27 ---- namespace PostgreSql.Data.PgSqlClient.DbSchema { ! internal class PgDomainsSchema : PgDbSchema { #region Constructors --- IDbSchema.cs DELETED --- |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-01 16:54:06
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22433 Modified Files: changelog.txt Log Message: 2004-04-1 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PgSqlClient/PgCommandBuilder.cs: * PostgreSql.Data.PgSqlClient/PgDataReader.cs: * PostgreSql.Data.PgSqlClient/PgCommand.cs: - Improved implementations of Command, Command builder and Data reader classes. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** changelog.txt 23 Mar 2004 15:06:39 -0000 1.110 --- changelog.txt 1 Apr 2004 16:42:06 -0000 1.111 *************** *** 2,8 **** ------------------------------------------------------- 2004-03-23 Carlos Guzman Alvarez <car...@te...> ! * PosrgreSql.Data.PgSqlClient/PgCommandBuilder.cs: - Improved command builder implementation. --- 2,18 ---- ------------------------------------------------------- + + 2004-04-1 Carlos Guzman Alvarez <car...@te...> + + * PostgreSql.Data.PgSqlClient/PgCommandBuilder.cs: + * PostgreSql.Data.PgSqlClient/PgDataReader.cs: + * PostgreSql.Data.PgSqlClient/PgCommand.cs: + + - Improved implementations of Command, + Command builder and Data reader classes. + 2004-03-23 Carlos Guzman Alvarez <car...@te...> ! * PostgreSql.Data.PgSqlClient/PgCommandBuilder.cs: - Improved command builder implementation. |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-01 16:53:39
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22247 Modified Files: PgCommand.cs PgCommandBuilder.cs PgDataReader.cs Log Message: 2004-04-1 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PgSqlClient/PgCommandBuilder.cs: * PostgreSql.Data.PgSqlClient/PgDataReader.cs: * PostgreSql.Data.PgSqlClient/PgCommand.cs: - Improved implementations of Command, Command builder and Data reader classes. Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** PgCommand.cs 23 Mar 2004 15:53:41 -0000 1.32 --- PgCommand.cs 1 Apr 2004 16:41:29 -0000 1.33 *************** *** 382,386 **** this.checkCommand(); ! commandBehavior = behavior; this.splitBatchCommands(true); --- 382,386 ---- this.checkCommand(); ! this.commandBehavior = behavior; this.splitBatchCommands(true); *************** *** 468,474 **** internal void InternalPrepare() { ! if (commands == null) { ! splitBatchCommands(false); } --- 468,474 ---- internal void InternalPrepare() { ! if (this.commands == null) { ! this.splitBatchCommands(false); } *************** *** 479,485 **** this.statement.Status == PgStatementStatus.Error) { ! if (commandType == CommandType.StoredProcedure) { ! commands[actualCommand] = parseSPCommandText(); } --- 479,485 ---- this.statement.Status == PgStatementStatus.Error) { ! if (this.commandType == CommandType.StoredProcedure) { ! this.commands[actualCommand] = parseSPCommandText(); } *************** *** 514,521 **** try { ! if (parameters.Count != 0) { // Set parameter values ! setParameterValues(); } --- 514,521 ---- try { ! if (this.parameters.Count != 0) { // Set parameter values ! this.setParameterValues(); } Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PgDataReader.cs 9 Mar 2004 12:39:36 -0000 1.19 --- PgDataReader.cs 1 Apr 2004 16:41:29 -0000 1.20 *************** *** 61,67 **** internal PgDataReader(PgCommand command, PgConnection connection) : this() { ! this.command = command; ! this.behavior = this.command.CommandBehavior; ! this.connection = connection; } --- 61,69 ---- internal PgDataReader(PgCommand command, PgConnection connection) : this() { ! this.command = command; ! this.behavior = this.command.CommandBehavior; ! this.connection = connection; ! this.connection.DataReader = this; ! this.fieldCount = this.command.Statement.RowDescriptor.Fields.Length; } *************** *** 380,389 **** public object this[int i] { ! get { return GetValue(i); } } public object this[string name] { ! get { return GetValue(GetOrdinal(name)); } } --- 382,391 ---- public object this[int i] { ! get { return this.GetValue(i); } } public object this[string name] { ! get { return this.GetValue(this.GetOrdinal(name)); } } *************** *** 399,403 **** public String GetName(int i) { - this.checkPosition(); this.checkIndex(i); --- 401,404 ---- *************** *** 408,412 **** public String GetDataTypeName(int i) { - this.checkPosition(); this.checkIndex(i); --- 409,412 ---- *************** *** 416,420 **** public Type GetFieldType(int i) { - this.checkPosition(); this.checkIndex(i); --- 416,419 ---- *************** *** 444,450 **** public int GetOrdinal(string name) { ! this.checkPosition(); ! return getOrdinal(name); } --- 443,452 ---- public int GetOrdinal(string name) { ! if (this.IsClosed) ! { ! throw new InvalidOperationException("Reader closed"); ! } ! return this.getOrdinal(name); } *************** *** 454,458 **** this.checkIndex(i); ! return Convert.ToBoolean(GetValue(i)); } --- 456,460 ---- this.checkIndex(i); ! return Convert.ToBoolean(this.GetValue(i)); } *************** *** 462,466 **** this.checkIndex(i); ! return Convert.ToByte(GetValue(i)); } --- 464,468 ---- this.checkIndex(i); ! return Convert.ToByte(this.GetValue(i)); } *************** *** 516,520 **** this.checkIndex(i); ! return Convert.ToChar(GetValue(i)); } --- 518,522 ---- this.checkIndex(i); ! return Convert.ToChar(this.GetValue(i)); } *************** *** 578,582 **** this.checkIndex(i); ! return Convert.ToInt16(GetValue(i)); } --- 580,584 ---- this.checkIndex(i); ! return Convert.ToInt16(this.GetValue(i)); } *************** *** 586,590 **** this.checkIndex(i); ! return Convert.ToInt32(GetValue(i)); } --- 588,592 ---- this.checkIndex(i); ! return Convert.ToInt32(this.GetValue(i)); } *************** *** 594,598 **** this.checkIndex(i); ! return Convert.ToInt64(GetValue(i)); } --- 596,600 ---- this.checkIndex(i); ! return Convert.ToInt64(this.GetValue(i)); } *************** *** 602,606 **** this.checkIndex(i); ! return Convert.ToSingle(GetValue(i)); } --- 604,608 ---- this.checkIndex(i); ! return Convert.ToSingle(this.GetValue(i)); } *************** *** 610,614 **** this.checkIndex(i); ! return Convert.ToDouble(GetValue(i)); } --- 612,616 ---- this.checkIndex(i); ! return Convert.ToDouble(this.GetValue(i)); } *************** *** 618,622 **** this.checkIndex(i); ! return Convert.ToString(GetValue(i)); } --- 620,624 ---- this.checkIndex(i); ! return Convert.ToString(this.GetValue(i)); } *************** *** 626,630 **** this.checkIndex(i); ! return Convert.ToDecimal(GetValue(i)); } --- 628,632 ---- this.checkIndex(i); ! return Convert.ToDecimal(this.GetValue(i)); } *************** *** 634,638 **** this.checkIndex(i); ! return Convert.ToDateTime(GetValue(i)); } --- 636,640 ---- this.checkIndex(i); ! return Convert.ToDateTime(this.GetValue(i)); } Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PgCommandBuilder.cs 23 Mar 2004 15:05:47 -0000 1.19 --- PgCommandBuilder.cs 1 Apr 2004 16:41:29 -0000 1.20 *************** *** 137,145 **** this.sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; this.whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; ! this.whereClausule2 = "({0} = ${1})"; ! this.setClausule = "{0} = ${1}"; this.separator = ", "; ! this.quotePrefix = String.Empty; ! this.quoteSuffix = String.Empty; GC.SuppressFinalize(this); --- 137,147 ---- this.sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; this.whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; ! // this.whereClausule2 = "({0} = ${1})"; ! // this.setClausule = "{0} = ${1}"; ! this.whereClausule2 = "({0} = {1})"; ! this.setClausule = "{0} = {1}"; this.separator = ", "; ! this.quotePrefix = String.Empty; ! this.quoteSuffix = String.Empty; GC.SuppressFinalize(this); *************** *** 165,171 **** --- 167,179 ---- this.RefreshSchema(); + if (this.adapterHandler != null) + { + this.dataAdapter.RowUpdating -= this.adapterHandler; + } + this.sqlInsert = null; this.sqlUpdate = null; this.sqlDelete = null; + this.whereClausule1 = null; this.whereClausule2 = null; this.setClausule = null; *************** *** 318,322 **** // Create a new command ! this.createCommand(ref this.deleteCommand); int i = 1; --- 326,330 ---- // Create a new command ! this.createCommand(ref this.insertCommand); int i = 1; *************** *** 401,412 **** } // Build Field name and append it to the string sets.AppendFormat( this.setClausule, this.getQuotedIdentifier(schemaRow["BaseColumnName"]), ! i); ! ! PgParameter parameter = this.createParameter(schemaRow, i, false); ! if (row != null && tableMapping != null) { --- 409,420 ---- } + PgParameter parameter = this.createParameter(schemaRow, i, false); + // Build Field name and append it to the string sets.AppendFormat( this.setClausule, this.getQuotedIdentifier(schemaRow["BaseColumnName"]), ! parameter.ParameterName); ! if (row != null && tableMapping != null) { *************** *** 442,446 **** PgParameter parameter = this.createParameter(schemaRow, i, true); ! where.AppendFormat(this.whereClausule2, quotedId, i); if (row != null && tableMapping != null) --- 450,457 ---- PgParameter parameter = this.createParameter(schemaRow, i, true); ! where.AppendFormat( ! this.whereClausule2, ! quotedId, ! parameter.ParameterName); if (row != null && tableMapping != null) *************** *** 505,509 **** PgParameter parameter = this.createParameter(schemaRow, i, true); ! where.AppendFormat(this.whereClausule2, quotedId, i); if (row != null && tableMapping != null) --- 516,523 ---- PgParameter parameter = this.createParameter(schemaRow, i, true); ! where.AppendFormat( ! this.whereClausule2, ! quotedId, ! parameter.ParameterName); if (row != null && tableMapping != null) *************** *** 717,726 **** if (command == null) { ! command = new PgCommand( ! String.Empty, ! this.SelectCommand.Connection, ! this.SelectCommand.Transaction); } command.CommandType = CommandType.Text; // None is the Default value for automatically generated commands --- 731,738 ---- if (command == null) { ! command = this.SelectCommand.Connection.CreateCommand(); } + command.Transaction = this.SelectCommand.Transaction; command.CommandType = CommandType.Text; // None is the Default value for automatically generated commands |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-23 16:04:10
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23132 Modified Files: PgCommand.cs Log Message: Fixed Clone implementation Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** PgCommand.cs 8 Mar 2004 16:23:25 -0000 1.31 --- PgCommand.cs 23 Mar 2004 15:53:41 -0000 1.32 *************** *** 307,316 **** object ICloneable.Clone() { ! PgCommand command = new PgCommand( ! this.commandText, ! this.connection, ! this.transaction); ! ! command.CommandType = this.commandType; return command; --- 307,322 ---- object ICloneable.Clone() { ! PgCommand command = new PgCommand(); ! ! command.CommandText = this.commandText; ! command.Connection = this.connection; ! command.Transaction = this.transaction; ! command.CommandType = this.CommandType; ! command.UpdatedRowSource = this.UpdatedRowSource; ! ! for (int i=0; i < this.Parameters.Count; i++) ! { ! command.Parameters.Add(((ICloneable)this.Parameters[i]).Clone()); ! } return command; |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-23 15:17:15
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11854 Modified Files: changelog.txt Log Message: 2004-03-23 Carlos Guzman Alvarez <car...@te...> * PosrgreSql.Data.PgSqlClient/PgCommandBuilder.cs: - Improved command builder implementation. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** changelog.txt 17 Mar 2004 16:35:20 -0000 1.109 --- changelog.txt 23 Mar 2004 15:06:39 -0000 1.110 *************** *** 2,5 **** --- 2,12 ---- ------------------------------------------------------- + 2004-03-23 Carlos Guzman Alvarez <car...@te...> + + * PosrgreSql.Data.PgSqlClient/PgCommandBuilder.cs: + + - Improved command builder implementation. + + 2004-03-17 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-23 15:16:14
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11648 Modified Files: PgCommandBuilder.cs Log Message: 2004-03-23 Carlos Guzman Alvarez <car...@te...> * PosrgreSql.Data.PgSqlClient/PgCommandBuilder.cs: - Improved command builder implementation. Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PgCommandBuilder.cs 8 Mar 2004 16:23:25 -0000 1.18 --- PgCommandBuilder.cs 23 Mar 2004 15:05:47 -0000 1.19 *************** *** 32,46 **** private PgDataAdapter dataAdapter; - private string sqlInsert; - private string sqlUpdate; - private string sqlDelete; private PgCommand insertCommand; private PgCommand updateCommand; private PgCommand deleteCommand; private string separator; ! // private string whereClausule1; [...1090 lines suppressed...] return; + } } ! try { *************** *** 747,757 **** e.Status = UpdateStatus.ErrorsOccurred; } - finally - { - if (mustClose) - { - this.dataAdapter.SelectCommand.Connection.Close(); - } - } } --- 816,819 ---- |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-19 22:55:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25229 Modified Files: changelog.txt Log Message: 2004-03-19 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Fixed cipher suite selection. * Mono.Security.Protocol.Tls/TlsServerSettings.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: - Added new CertificateRSA property. - Added new UpdateCErtfificateRSA method. * Mono.Security.Protocol.Tls/CipherSuite.cs: - Removed CertificateRSA() method. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** changelog.txt 18 Mar 2004 14:07:29 -0000 1.24 --- changelog.txt 19 Mar 2004 22:45:15 -0000 1.25 *************** *** 3,6 **** --- 3,26 ---- + 2004-03-19 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: + + - Fixed cipher suite selection. + + * Mono.Security.Protocol.Tls/TlsServerSettings.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: + + - Added new CertificateRSA property. + + - Added new UpdateCErtfificateRSA method. + + * Mono.Security.Protocol.Tls/CipherSuite.cs: + + - Removed CertificateRSA() method. + + 2004-03-18 Sebastien Pouliot <seb...@xi...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-19 22:54:40
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25083 Modified Files: CipherSuite.cs ServerContext.cs TlsServerSettings.cs Log Message: 2004-03-19 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Fixed cipher suite selection. * Mono.Security.Protocol.Tls/TlsServerSettings.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: - Added new CertificateRSA property. - Added new UpdateCErtfificateRSA method. * Mono.Security.Protocol.Tls/CipherSuite.cs: - Removed CertificateRSA() method. Index: TlsServerSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerSettings.cs 3 Mar 2004 16:22:36 -0000 1.2 --- TlsServerSettings.cs 19 Mar 2004 22:44:47 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- using System.Security.Cryptography; + using Mono.Security.Cryptography; using Mono.Security.X509; using Mono.Security.Protocol.Tls.Handshake; *************** *** 36,45 **** private X509CertificateCollection certificates; private bool serverKeyExchange; private bool certificateRequest; private ClientCertificateType[] certificateTypes; - private string[] distinguisedNames; - private RSAParameters rsaParameters; - private byte[] signedParams; #endregion --- 37,47 ---- private X509CertificateCollection certificates; + private RSA certificateRSA; + private RSAParameters rsaParameters; + private byte[] signedParams; + private string[] distinguisedNames; private bool serverKeyExchange; private bool certificateRequest; private ClientCertificateType[] certificateTypes; #endregion *************** *** 51,56 **** --- 53,69 ---- get { return this.serverKeyExchange; } set { this.serverKeyExchange = value; } + } + + public X509CertificateCollection Certificates + { + get { return this.certificates; } + set { this.certificates = value; } } + public RSA CertificateRSA + { + get { return this.certificateRSA; } + } + public RSAParameters RsaParameters { *************** *** 83,98 **** } ! public X509CertificateCollection Certificates { - get { return this.certificates; } - set { this.certificates = value; } } #endregion ! #region Constructors ! public TlsServerSettings() { } --- 96,126 ---- } ! #endregion ! ! #region Constructors ! ! public TlsServerSettings() { } #endregion ! #region Methods ! public void UpdateCertificateRSA() { + if (this.certificates == null || + this.certificates.Count == 0) + { + this.certificateRSA = null; + } + else + { + this.certificateRSA = new RSAManaged( + this.certificates[0].RSA.KeySize); + + this.certificateRSA.ImportParameters( + this.certificates[0].RSA.ExportParameters(false)); + } } Index: ServerContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ServerContext.cs 5 Mar 2004 23:21:55 -0000 1.2 --- ServerContext.cs 19 Mar 2004 22:44:47 -0000 1.3 *************** *** 72,75 **** --- 72,77 ---- this.ServerSettings.Certificates = new MonoX509.X509CertificateCollection(); this.ServerSettings.Certificates.Add(cert); + + this.ServerSettings.UpdateCertificateRSA(); } Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CipherSuite.cs 18 Mar 2004 14:06:31 -0000 1.11 --- CipherSuite.cs 19 Mar 2004 22:44:47 -0000 1.12 *************** *** 243,256 **** } - public RSA CertificateRSA() - { - RSA rsaCert = this.Context.ServerSettings.Certificates[0].RSA; - RSA rsa = new RSAManaged(rsaCert.KeySize); - - rsa.ImportParameters(rsaCert.ExportParameters(false)); - - return rsa; - } - public void UpdateClientCipherIV(byte[] iv) { --- 243,246 ---- |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-19 22:54:05
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24919 Modified Files: TlsClientKeyExchange.cs TlsServerCertificate.cs TlsServerKeyExchange.cs Log Message: 2004-03-19 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Fixed cipher suite selection. * Mono.Security.Protocol.Tls/TlsServerSettings.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: - Added new CertificateRSA property. - Added new UpdateCErtfificateRSA method. * Mono.Security.Protocol.Tls/CipherSuite.cs: - Removed CertificateRSA() method. Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsClientKeyExchange.cs 18 Mar 2004 14:05:29 -0000 1.5 --- TlsClientKeyExchange.cs 19 Mar 2004 22:44:11 -0000 1.6 *************** *** 59,63 **** else { ! rsa = this.Context.Cipher.CertificateRSA(); } --- 59,63 ---- else { ! rsa = this.Context.ServerSettings.CertificateRSA; } *************** *** 94,98 **** else { ! rsa = this.Context.Cipher.CertificateRSA(); } --- 94,98 ---- else { ! rsa = this.Context.ServerSettings.CertificateRSA; } Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsServerCertificate.cs 5 Mar 2004 23:16:29 -0000 1.7 --- TlsServerCertificate.cs 19 Mar 2004 22:44:11 -0000 1.8 *************** *** 59,63 **** { base.Update(); ! this.Context.ServerSettings.Certificates = certificates; } --- 59,64 ---- { base.Update(); ! this.Context.ServerSettings.Certificates = this.certificates; ! this.Context.ServerSettings.UpdateCertificateRSA(); } Index: TlsServerKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsServerKeyExchange.cs 3 Mar 2004 16:14:40 -0000 1.3 --- TlsServerKeyExchange.cs 19 Mar 2004 22:44:11 -0000 1.4 *************** *** 106,110 **** bool isValidSignature = hash.VerifySignature( ! this.Context.Cipher.CertificateRSA(), this.signedParams); --- 106,110 ---- bool isValidSignature = hash.VerifySignature( ! this.Context.ServerSettings.CertificateRSA, this.signedParams); |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-19 22:53:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24816 Modified Files: TlsClientHello.cs Log Message: 2004-03-19 Sebastien Pouliot <seb...@xi...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Fixed cipher suite selection. * Mono.Security.Protocol.Tls/TlsServerSettings.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: - Added new CertificateRSA property. - Added new UpdateCErtfificateRSA method. * Mono.Security.Protocol.Tls/CipherSuite.cs: - Removed CertificateRSA() method. Index: TlsClientHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsClientHello.cs 10 Mar 2004 15:50:12 -0000 1.7 --- TlsClientHello.cs 19 Mar 2004 22:43:34 -0000 1.8 *************** *** 133,137 **** if ((index = this.Context.SupportedCiphers.IndexOf(this.cipherSuites[i])) != -1) { ! this.Context.Cipher = this.Context.SupportedCiphers[index]; } } --- 133,138 ---- if ((index = this.Context.SupportedCiphers.IndexOf(this.cipherSuites[i])) != -1) { ! this.Context.Cipher = this.Context.SupportedCiphers[index]; ! break; } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-18 14:17:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5426 Modified Files: changelog.txt Log Message: 2004-03-18 Sebastien Pouliot <seb...@xi...> * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteFactory.cs: * Mono.Security.Protocol.Tls/SslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: - Added Support for exportable Cipher Suites. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** changelog.txt 17 Mar 2004 16:34:37 -0000 1.23 --- changelog.txt 18 Mar 2004 14:07:29 -0000 1.24 *************** *** 3,6 **** --- 3,17 ---- + 2004-03-18 Sebastien Pouliot <seb...@xi...> + + * Mono.Security.Protocol.Tls/CipherSuite.cs: + * Mono.Security.Protocol.Tls/CipherSuiteFactory.cs: + * Mono.Security.Protocol.Tls/SslCipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: + + - Added Support for exportable Cipher Suites. + + 2004-03-17 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-18 14:16:13
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5169 Modified Files: CipherSuite.cs CipherSuiteFactory.cs SslCipherSuite.cs TlsCipherSuite.cs Log Message: 2004-03-18 Sebastien Pouliot <seb...@xi...> * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteFactory.cs: * Mono.Security.Protocol.Tls/SslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: - Added Support for exportable Cipher Suites. Index: SslCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SslCipherSuite.cs 16 Mar 2004 16:33:38 -0000 1.2 --- SslCipherSuite.cs 18 Mar 2004 14:06:31 -0000 1.3 *************** *** 212,230 **** HashAlgorithm md5 = MD5.Create(); // Generate final write keys ! byte[] finalClientWriteKey = new byte[md5.HashSize]; ! md5.TransformBlock(this.Context.ClientWriteKey, 0, this.Context.ClientWriteKey.Length, finalClientWriteKey, 0); ! finalClientWriteKey = md5.TransformFinalBlock(this.Context.RandomCS, 0, this.Context.RandomCS.Length); ! byte[] finalServerWriteKey = new byte[md5.HashSize]; ! md5.TransformBlock(this.Context.ServerWriteKey, 0, this.Context.ServerWriteKey.Length, finalServerWriteKey, 0); ! finalClientWriteKey = md5.TransformFinalBlock(this.Context.RandomSC, 0, this.Context.RandomSC.Length); ! this.Context.ClientWriteKey = finalClientWriteKey; ! this.Context.ServerWriteKey = finalServerWriteKey; // Generate IV keys ! this.Context.ClientWriteIV = md5.TransformFinalBlock(this.Context.RandomCS, 0, this.Context.RandomCS.Length); ! this.Context.ServerWriteIV = md5.TransformFinalBlock(this.Context.RandomSC, 0, this.Context.RandomSC.Length); } --- 212,251 ---- HashAlgorithm md5 = MD5.Create(); + int keySize = (md5.HashSize >> 3); //in bytes not bits + byte[] temp = new byte [keySize]; + // Generate final write keys ! md5.TransformBlock(this.Context.ClientWriteKey, 0, this.Context.ClientWriteKey.Length, temp, 0); ! md5.TransformFinalBlock(this.Context.RandomCS, 0, this.Context.RandomCS.Length); ! byte[] finalClientWriteKey = new byte[this.ExpandedKeyMaterialSize]; ! Buffer.BlockCopy(md5.Hash, 0, finalClientWriteKey, 0, this.ExpandedKeyMaterialSize); ! md5.Initialize(); ! md5.TransformBlock(this.Context.ServerWriteKey, 0, this.Context.ServerWriteKey.Length, temp, 0); ! md5.TransformFinalBlock(this.Context.RandomSC, 0, this.Context.RandomSC.Length); ! byte[] finalServerWriteKey = new byte[this.ExpandedKeyMaterialSize]; ! Buffer.BlockCopy(md5.Hash, 0, finalServerWriteKey, 0, this.ExpandedKeyMaterialSize); ! this.Context.ClientWriteKey = finalClientWriteKey; ! this.Context.ServerWriteKey = finalServerWriteKey; // Generate IV keys ! if (this.IvSize > 0) ! { ! md5.Initialize(); ! temp = md5.ComputeHash(this.Context.RandomCS, 0, this.Context.RandomCS.Length); ! this.Context.ClientWriteIV = new byte[this.IvSize]; ! Buffer.BlockCopy(temp, 0, this.Context.ClientWriteIV, 0, this.IvSize); ! ! md5.Initialize(); ! temp = md5.ComputeHash(this.Context.RandomSC, 0, this.Context.RandomSC.Length); ! this.Context.ServerWriteIV = new byte[this.IvSize]; ! Buffer.BlockCopy(temp, 0, this.Context.ServerWriteIV, 0, this.IvSize); ! } ! else ! { ! this.Context.ClientWriteIV = CipherSuite.EmptyArray; ! this.Context.ServerWriteIV = CipherSuite.EmptyArray; ! } } Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CipherSuite.cs 15 Mar 2004 13:18:30 -0000 1.10 --- CipherSuite.cs 18 Mar 2004 14:06:31 -0000 1.11 *************** *** 380,384 **** HashAlgorithm sha1 = SHA1.Create(); ! int secretLen = secret.Length / 2; // Seed --- 380,398 ---- HashAlgorithm sha1 = SHA1.Create(); ! /* Secret Length calc exmplain from the RFC2246. Section 5 ! * ! * S1 and S2 are the two halves of the secret and each is the same ! * length. S1 is taken from the first half of the secret, S2 from the ! * second half. Their length is created by rounding up the length of the ! * overall secret divided by two; thus, if the original secret is an odd ! * number of bytes long, the last byte of S1 will be the same as the ! * first byte of S2. ! */ ! ! // split secret in 2 ! int secretLen = secret.Length >> 1; ! // rounding up ! if ((secret.Length & 0x1) == 0x1) ! secretLen++; // Seed *************** *** 395,399 **** // Secret2 byte[] secret2 = new byte[secretLen]; ! Buffer.BlockCopy(secret, secretLen, secret2, 0, secretLen); // Secret 1 processing --- 409,413 ---- // Secret2 byte[] secret2 = new byte[secretLen]; ! Buffer.BlockCopy(secret, (secret.Length - secretLen), secret2, 0, secretLen); // Secret 1 processing *************** *** 484,488 **** this.encryptionAlgorithm.Mode = this.cipherMode; this.encryptionAlgorithm.Padding = PaddingMode.None; ! this.encryptionAlgorithm.KeySize = this.keyMaterialSize * 8; this.encryptionAlgorithm.BlockSize = this.blockSize * 8; } --- 498,502 ---- this.encryptionAlgorithm.Mode = this.cipherMode; this.encryptionAlgorithm.Padding = PaddingMode.None; ! this.encryptionAlgorithm.KeySize = this.expandedKeyMaterialSize * 8; this.encryptionAlgorithm.BlockSize = this.blockSize * 8; } *************** *** 550,554 **** this.decryptionAlgorithm.Mode = this.cipherMode; this.decryptionAlgorithm.Padding = PaddingMode.None; ! this.decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; this.decryptionAlgorithm.BlockSize = this.blockSize * 8; } --- 564,568 ---- this.decryptionAlgorithm.Mode = this.cipherMode; this.decryptionAlgorithm.Padding = PaddingMode.None; ! this.decryptionAlgorithm.KeySize = this.expandedKeyMaterialSize * 8; this.decryptionAlgorithm.BlockSize = this.blockSize * 8; } Index: CipherSuiteFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CipherSuiteFactory.cs 3 Mar 2004 16:22:36 -0000 1.1 --- CipherSuiteFactory.cs 18 Mar 2004 14:06:31 -0000 1.2 *************** *** 60,63 **** --- 60,73 ---- scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); + // Supported exportable ciphers + scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 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) | 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) | 0x60, "TLS_RSA_EXPORT_WITH_RC4_56_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); + scs.Add((0x00 << 0x08) | 0x61, "TLS_RSA_EXPORT_WITH_RC2_CBC_56_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 7, 16, 56, 8, 8); + // 56 bits but we use 64 bits because of parity (DES is really 56 bits) + scs.Add((0x00 << 0x08) | 0x62, "TLS_RSA_EXPORT_WITH_DES_CBC_56_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 8, 8, 64, 8, 8); + scs.Add((0x00 << 0x08) | 0x64, "TLS_RSA_EXPORT_WITH_RC4_56_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 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); *************** *** 126,130 **** 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) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! // Default CipherSuite // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, true, false, 0, 0, 0, 0, 0); --- 136,150 ---- 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) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! ! // Supported exportable ciphers ! 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) | 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) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); ! scs.Add((0x00 << 0x08) | 0x60, "SSL_RSA_EXPORT_WITH_RC4_56_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); ! scs.Add((0x00 << 0x08) | 0x61, "SSL_RSA_EXPORT_WITH_RC2_CBC_56_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 7, 16, 56, 8, 8); ! // 56 bits but we use 64 bits because of parity (DES is really 56 bits) ! scs.Add((0x00 << 0x08) | 0x62, "SSL_RSA_EXPORT_WITH_DES_CBC_56_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 8, 8, 64, 8, 8); ! scs.Add((0x00 << 0x08) | 0x64, "SSL_RSA_EXPORT_WITH_RC4_56_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); ! // Default CipherSuite // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, true, false, 0, 0, 0, 0, 0); Index: TlsCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsCipherSuite.cs 15 Mar 2004 13:18:30 -0000 1.7 --- TlsCipherSuite.cs 18 Mar 2004 14:06:31 -0000 1.8 *************** *** 149,167 **** { // Generate final write keys ! byte[] finalClientWriteKey = PRF(this.Context.ClientWriteKey, "client write key", this.Context.RandomCS, this.KeyMaterialSize); ! byte[] finalServerWriteKey = PRF(this.Context.ServerWriteKey, "server write key", this.Context.RandomCS, this.KeyMaterialSize); this.Context.ClientWriteKey = finalClientWriteKey; this.Context.ServerWriteKey = finalServerWriteKey; ! // Generate IV block ! byte[] ivBlock = PRF(new byte[]{}, "IV block", this.Context.RandomCS, this.IvSize*2); ! // Generate IV keys ! this.Context.ClientWriteIV = new byte[this.IvSize]; ! Buffer.BlockCopy(ivBlock, 0, this.Context.ClientWriteIV, 0, this.Context.ClientWriteIV.Length); ! this.Context.ServerWriteIV = new byte[this.IvSize]; ! Buffer.BlockCopy(ivBlock, this.IvSize, this.Context.ServerWriteIV, 0, this.Context.ServerWriteIV.Length); } --- 149,175 ---- { // Generate final write keys ! byte[] finalClientWriteKey = PRF(this.Context.ClientWriteKey, "client write key", this.Context.RandomCS, this.ExpandedKeyMaterialSize); ! byte[] finalServerWriteKey = PRF(this.Context.ServerWriteKey, "server write key", this.Context.RandomCS, this.ExpandedKeyMaterialSize); this.Context.ClientWriteKey = finalClientWriteKey; this.Context.ServerWriteKey = finalServerWriteKey; ! if (this.IvSize > 0) ! { ! // Generate IV block ! byte[] ivBlock = PRF(CipherSuite.EmptyArray, "IV block", this.Context.RandomCS, this.IvSize*2); ! // Generate IV keys ! this.Context.ClientWriteIV = new byte[this.IvSize]; ! Buffer.BlockCopy(ivBlock, 0, this.Context.ClientWriteIV, 0, this.Context.ClientWriteIV.Length); ! this.Context.ServerWriteIV = new byte[this.IvSize]; ! Buffer.BlockCopy(ivBlock, this.IvSize, this.Context.ServerWriteIV, 0, this.Context.ServerWriteIV.Length); ! } ! else ! { ! this.Context.ClientWriteIV = CipherSuite.EmptyArray; ! this.Context.ServerWriteIV = CipherSuite.EmptyArray; ! } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-18 14:15:07
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4903 Modified Files: TlsClientKeyExchange.cs Log Message: 2004-03-18 Sebastien Pouliot <seb...@xi...> * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteFactory.cs: * Mono.Security.Protocol.Tls/SslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs: - Added Support for exportable Cipher Suites. Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsClientKeyExchange.cs 4 Mar 2004 15:39:45 -0000 1.4 --- TlsClientKeyExchange.cs 18 Mar 2004 14:05:29 -0000 1.5 *************** *** 27,30 **** --- 27,32 ---- using System.Security.Cryptography; + using Mono.Security.Cryptography; + namespace Mono.Security.Protocol.Tls.Handshake.Client { *************** *** 48,52 **** // Create a new RSA key ! RSA rsa = this.Context.Cipher.CertificateRSA(); // Encrypt premaster_sercret --- 50,64 ---- // Create a new RSA key ! RSA rsa = null; ! if (this.Context.ServerSettings.ServerKeyExchange) ! { ! // this is the case for "exportable" ciphers ! rsa = new RSAManaged (); ! rsa.ImportParameters (this.Context.ServerSettings.RsaParameters); ! } ! else ! { ! rsa = this.Context.Cipher.CertificateRSA(); ! } // Encrypt premaster_sercret *************** *** 73,77 **** // Create a new RSA key ! RSA rsa = this.Context.Cipher.CertificateRSA(); // Encrypt premaster_sercret --- 85,99 ---- // Create a new RSA key ! RSA rsa = null; ! if (this.Context.ServerSettings.ServerKeyExchange) ! { ! // this is the case for "exportable" ciphers ! rsa = new RSAManaged (); ! rsa.ImportParameters (this.Context.ServerSettings.RsaParameters); ! } ! else ! { ! rsa = this.Context.Cipher.CertificateRSA(); ! } // Encrypt premaster_sercret |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-17 16:44:53
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15636 Modified Files: changelog.txt Log Message: 2004-03-17 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs: - Initial implementation. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** changelog.txt 16 Mar 2004 16:34:26 -0000 1.108 --- changelog.txt 17 Mar 2004 16:35:20 -0000 1.109 *************** *** 2,5 **** --- 2,12 ---- ------------------------------------------------------- + 2004-03-17 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs: + + - Initial implementation. + 2004-03-16 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-17 16:44:21
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15442 Modified Files: changelog.txt Log Message: 2004-03-17 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs: - Initial implementation. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** changelog.txt 16 Mar 2004 16:34:03 -0000 1.22 --- changelog.txt 17 Mar 2004 16:34:37 -0000 1.23 *************** *** 3,6 **** --- 3,14 ---- + 2004-03-17 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs: + + - Initial implementation. + + 2004-03-16 Carlos Guzman Alvarez <car...@te...> *************** *** 43,47 **** * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs: ! - Fixed meesage type definition. * Mono.Security.Protocol.Tls/Ciphersuite.cs: --- 51,55 ---- * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs: ! - Fixed message type definition. * Mono.Security.Protocol.Tls/Ciphersuite.cs: |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-17 16:43:43
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15345 Modified Files: RecordProtocol.cs Log Message: Minor change Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RecordProtocol.cs 15 Mar 2004 13:18:30 -0000 1.13 --- RecordProtocol.cs 17 Mar 2004 16:34:11 -0000 1.14 *************** *** 371,375 **** try { - // Decrypt message this.context.Cipher.DecryptRecord(fragment, ref dcrFragment, ref dcrMAC); } --- 371,374 ---- |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-17 16:43:05
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15202 Modified Files: TlsClientCertificate.cs TlsServerKeyExchange.cs Log Message: 2004-03-17 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs: - Initial implementation. Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsClientCertificate.cs 3 Mar 2004 16:15:42 -0000 1.3 --- TlsClientCertificate.cs 17 Mar 2004 16:33:36 -0000 1.4 *************** *** 31,34 **** --- 31,40 ---- internal class TlsClientCertificate : HandshakeMessage { + #region Fields + + private X509Certificate clientCertificate; + + #endregion + #region Constructors *************** *** 44,48 **** public override void Update() { ! throw new NotSupportedException(); } --- 50,54 ---- public override void Update() { ! this.Context.ClientSettings.Certificates.Add(clientCertificate); } *************** *** 58,62 **** protected override void ProcessAsTls1() { ! throw new NotSupportedException(); } --- 64,71 ---- protected override void ProcessAsTls1() { ! int length = this.ReadInt24(); ! this.clientCertificate = new X509Certificate(this.ReadBytes(length)); ! ! #warning "Is client certificate validation needed ??" } Index: TlsServerKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsServerKeyExchange.cs 3 Mar 2004 16:15:43 -0000 1.3 --- TlsServerKeyExchange.cs 17 Mar 2004 16:33:36 -0000 1.4 *************** *** 26,29 **** --- 26,31 ---- using System.Security.Cryptography; + using SX509 = System.Security.Cryptography.X509Certificates; + using Mono.Security.Cryptography; using Mono.Security.X509; *************** *** 60,64 **** protected override void ProcessAsTls1() { ! throw new NotSupportedException(); } --- 62,107 ---- protected override void ProcessAsTls1() { ! ServerContext context = (ServerContext)this.Context; ! ! // Select the private key information ! RSA rsa = (RSA)context.SslStream.PrivateKeyCertSelectionDelegate( ! new SX509.X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! RSAParameters rsaParams = rsa.ExportParameters(false); ! ! // Write Modulus ! this.WriteInt24(rsaParams.Modulus.Length); ! this.Write(rsaParams.Modulus, 0, rsaParams.Modulus.Length); ! ! // Write exponent ! this.WriteInt24(rsaParams.Exponent.Length); ! this.Write(rsaParams.Exponent, 0, rsaParams.Exponent.Length); ! ! // Write signed params ! byte[] signature = this.createSignature(rsa, this.ToArray()); ! this.WriteInt24(signature.Length); ! this.Write(signature); ! } ! ! #endregion ! ! #region Private Methods ! ! private byte[] createSignature(RSA rsa, byte[] buffer) ! { ! MD5SHA1 hash = new MD5SHA1(); ! ! // Create server params array ! TlsStream stream = new TlsStream(); ! ! stream.Write(this.Context.RandomCS); ! stream.Write(buffer, 0, buffer.Length); ! ! hash.ComputeHash(stream.ToArray()); ! ! stream.Reset(); ! ! return hash.CreateSignature(rsa); } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-16 16:43:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9675 Modified Files: changelog.txt Log Message: 2004-03-16 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/SslCipherSuite.cs: - Added changes for allow it to work as server or client. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** changelog.txt 9 Mar 2004 22:09:47 -0000 1.107 --- changelog.txt 16 Mar 2004 16:34:26 -0000 1.108 *************** *** 2,5 **** --- 2,36 ---- ------------------------------------------------------- + 2004-03-16 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/SslCipherSuite.cs: + + - Added changes for allow it to work as server or client. + + + 2004-03-15 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/TlsStream.cs: + * Mono.Security.Protocol.Tls/CipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: + * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Cryptography/MD5SHA1.cs: + + - Use Buffer.BlockCopy instead of System.Array.Copy + + + 2004-03-10 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + + - Implemented some server alerts. + + * Mono.Security.Protocol.Tls/Context.cs: + + - Added new RecordProtocol property. + 2004-03-09 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-03-16 16:43:28
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9565 Modified Files: changelog.txt Log Message: 2004-03-16 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/SslCipherSuite.cs: - Added changes for allow it to work as server or client. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** changelog.txt 10 Mar 2004 15:52:32 -0000 1.21 --- changelog.txt 16 Mar 2004 16:34:03 -0000 1.22 *************** *** 2,5 **** --- 2,25 ---- --------------- ----------- ----------------------------------------- + + 2004-03-16 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/SslCipherSuite.cs: + + - Added changes for allow it to work as server or client. + + + 2004-03-15 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/TlsStream.cs: + * Mono.Security.Protocol.Tls/CipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: + * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Cryptography/MD5SHA1.cs: + + - Use Buffer.BlockCopy instead of System.Array.Copy + + 2004-03-10 Carlos Guzman Alvarez <car...@te...> |