pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 26)
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
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Math.Prime.Generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30376 Removed Files: NextPrimeFinder.cs PrimeGeneratorBase.cs SequentialSearchPrimeGeneratorBase.cs Log Message: Reorganization to match mono:: cvs structure --- NextPrimeFinder.cs DELETED --- --- PrimeGeneratorBase.cs DELETED --- --- SequentialSearchPrimeGeneratorBase.cs DELETED --- |
From: <car...@us...> - 2004-02-10 09:32:18
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Math.Prime In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30184 Removed Files: ConfidenceFactor.cs PrimalityTests.cs Log Message: Reorganization to match mono:: cvs structure --- ConfidenceFactor.cs DELETED --- --- PrimalityTests.cs DELETED --- |
From: <car...@us...> - 2004-02-10 09:31:38
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30135 Removed Files: BigInteger.cs Log Message: Reorganization to match mono:: cvs structure --- BigInteger.cs DELETED --- |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30063 Removed Files: AssemblyInfo.cs CipherAlgorithmType.cs CipherSuite.cs ExchangeAlgorithmType.cs HashAlgorithmType.cs RSASslSignatureDeformatter.cs RSASslSignatureFormatter.cs SecurityCompressionType.cs SecurityProtocolType.cs SslClientStream.cs SslServerStream.cs TlsCipherSuite.cs TlsCipherSuiteCollection.cs TlsCipherSuiteFactory.cs TlsClientSettings.cs TlsContentType.cs TlsContext.cs TlsException.cs TlsServerSettings.cs TlsSslCipherSuite.cs TlsSslHandshakeHash.cs TlsStream.cs Log Message: Reorganization to match mono:: cvs structure --- AssemblyInfo.cs DELETED --- --- CipherAlgorithmType.cs DELETED --- --- CipherSuite.cs DELETED --- --- ExchangeAlgorithmType.cs DELETED --- --- HashAlgorithmType.cs DELETED --- --- RSASslSignatureDeformatter.cs DELETED --- --- RSASslSignatureFormatter.cs DELETED --- --- SecurityCompressionType.cs DELETED --- --- SecurityProtocolType.cs DELETED --- --- SslClientStream.cs DELETED --- --- SslServerStream.cs DELETED --- --- TlsCipherSuite.cs DELETED --- --- TlsCipherSuiteCollection.cs DELETED --- --- TlsCipherSuiteFactory.cs DELETED --- --- TlsClientSettings.cs DELETED --- --- TlsContentType.cs DELETED --- --- TlsContext.cs DELETED --- --- TlsException.cs DELETED --- --- TlsServerSettings.cs DELETED --- --- TlsSslCipherSuite.cs DELETED --- --- TlsSslHandshakeHash.cs DELETED --- --- TlsStream.cs DELETED --- |
From: <car...@us...> - 2004-02-10 08:54:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22697 Modified Files: changelog.txt Log Message: Updated Changelog Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/changelog.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** changelog.txt 23 Dec 2003 18:26:33 -0000 1.19 --- changelog.txt 10 Feb 2004 08:50:55 -0000 1.20 *************** *** 1,345 **** ! TLS/SSL library - PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! --------------- ----------- ----------------------------------------- ! ! ! 2003-12-23 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Try to improve record reading. ! ! 2003-12-21 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: ! ! - Send always the first certificate. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: ! ! - Added changes for correct verification of the signed data sent ! by the server. ! ! * Mono.Security.Cryptography/PKCS1.cs: ! ! - Added change to Encode_v15 method for allow correct ! encoding of hash algorithms that doesn't have an OID ! like the MD5SHA1 hash used in SSL/TLS protocols. ! ! * Added files from mono:: project that are going to be needed ! for client authentication: ! ! Mono.Math/* ! ! Mono.Math.Prime/* ! ! Mono.Math.Prime.Generator/* ! ! Mono.Security.Cryptography/RSAManaged.cs ! ! * Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs: ! ! - Create RSA as an RSAManaged instance. ! ! * Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs: ! * Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs: ! ! - Changed key field to be of RSA type. ! ! 2003-12-14 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs: ! * Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs: ! ! - Added new classes for implement in the future RSA-SSL signatures. ! ! * Changed #region names in all source files. ! ! 2003-12-09 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Handshake.Client/TlsServerCertificate.cs: ! ! - Fixed message (but not working yet - we need RSA signing ! capabilitites with MD5SHA1 hash). ! ! * Mono.Security.Protocol.Handshake.Client/TlsServerCertificate.cs: ! ! - Retrict certificate validation to the first validation. ! ( real validation needs to be made using a chain ) ! ! - Improved domain validation by making a IP checking between ! the target host IP and the certificate domain IP. ! ! - Fixed error list handling on certificate validation. ! ! 2003-11-28 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Added new exceptions. ! ! 2003-11-23 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslServerStream.cs: ! ! - Added new SslServerStream class with empty methods. ! ! * Mono.Security.Protocol.Tls.Handshake.Server: ! ! - New directory with class definitions of handshake message classes ! for the server implementation. ! ! - Class names for server handshake messages are the same as for ! client implementation. ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Throw exception in constrctors when the targetHost or the streams are invalid. ! ! - Added correct exception throwing in read/write methods. ! ! - Added initial implementation of BeginRead and EndRead methods. ! ! * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs: ! ! - Added new constructor. ! ! - Changed UpdateSession() method to Update() and replaced method ! name in derived classes. ! ! ------------------------- Updated Mono Sources ---------------------- ! ! 2003-11-22 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! ! - Better handling of padding bytes on message encryption. ! ! * Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs: ! ! - Uncommented AES ciphersuites. ! ! ! 2003-11-21 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Add correct implementation of RaiseClientCertificateSelection ! ! 2003-11-17 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! Removed ReadByte method, use innerStream.ReadByte() method instead. ! ! 2003-11-13 Carlos Guzmán Álvarez <car...@te...> ! ! * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. ! ! The next files are no more needed: ! ! - TlsSession.cs ! ! - TlsNetworkStream.cs ! ! - TlsSocket.cs ! ! - TlsSessionState.cs ! ! The next files are renamed: ! ! - TlsSessionSettings.cs -> TlsClientSettings.cs ! ! - TlsSessionContext.cs -> TlsContext.cs ! ! The next files are new: ! ! - SslClientStream.cs ( the name is non definitive yet ) ! ! The next files where changed to reflect the new canges: ! ! - TlsHandshakeMessage.cs ! ! - TlsClientCertificate.cs ! ! - TlsClientCertificateVerify.cs ! ! - TlsClientFinished.cs ! ! - TlsClientHello.cs ! ! - TlsClientKeyExchange.cs ! ! - TlsServerCertificate.cs ! ! - TlsServerCertificateRequest.cs ! ! - TlsServerFinished.cs ! ! - TlsServerHello.cs ! ! - TlsServerHelloDone.cs ! ! - TlsServerKeyExchange.cs ! ! - TlsAlert.cs ! ! - TlsCloseNotifyAlert.cs ! ! ! 2003-11-12 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: ! ! - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) ! ! * Mono.Security.Protocol.Tls/TlsProtocol.cs: ! ! - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) ! ! * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: ! ! - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) ! ! * Mono.Security.Cryptography/TlsCompressionMethod.cs: ! ! - Renamed to SecurityCompressionType. ! ! * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: ! * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: ! * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: ! ! - New enumerations that matches .NET 1.2 definitions with some minor differences. ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Added changes for make use of new enumerations. ! ! * Mono.Security.Protocol.Tls/TlsClientStream.cs: ! ! - Added new informative properties that matches .NET 1.2 SslClientStream ! ( Not all the properties are implemented yet ). ! ! ! 2003-11-10 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: ! ! - Fixed invalid alert message. ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: ! * Mono.Security.Cryptography/HMAC.cs: ! * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: ! ! - Changed ( Thanks to Sebastién Pouliot for his feedback ) ! ! SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider(); ! MD5CryptoServiceProvider sha = new MD5CryptoServiceProvider(); ! ! to ! ! HashAlgorithm sha = SHA1.Create(); ! HashAlgorithm md5 = MD5.Create(); ! ! ! 2003-11-04 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: ! ! - Commented server certificate signature verification. ! ! * Mono.Security.Protocol.Tls/TlsServerSettings.cs: ! ! - Renamed ServerCertificates property to Certificates. ! ! ! ----------------- Updated Mono Sources ----------------------- ! ! ! ! 2003-11-04 Carlos Guzmán Álvarez <car...@te...> ! ! * CipherSuite.cs: ! ! - Added custom padding for record encryption. ! ! ! 2003-11-03 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessages.cs: ! ! - Removed file. ! ! * Mono.Security.Protocol.Tls/TlsSslHandshakeHash.cs: ! ! - New class for handshake hashes calculation on SSL3 protocol. ! ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Fixed mac keys clearing for SSL3 protocol. ! ! * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs: ! ! - Added changes for make use of new TlsSslHandshakeHash class. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs: ! ! - Added initial implementation for SSL3 protocol. ! ! * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: ! ! - New class for md5-sha hash calculation. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsHandshakeMessage.cs: ! ! - Make use of new MD5SHA1CryptoServiceProvider class. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: ! ! - Added initial implementation (not finished). ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: ! ! - Minor change to message processing. ! ! - Changed verify method name to verifySignature. ! ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Changed handshakeHashes member to be an TlsStream. ! ! 2003-10-28 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSessionSettings.cs: ! * Mono.Security.Protocol.Tls/TlsServerSettings.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.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 changes for make use of X509 classes from mono. ! ! * Mono.Security/ASN1Convert.cs: ! * Mono.Security.X509/*.*: ! ! - New files from mono for allow basic certificate validation. ! ! ! 2003-10-21 Carlos Guzmán Álvarez <car...@te...> ! ! * Added specific changelog file for the TLS/SSL implementation. ! ! * Added partial implementation of SSL3 protocol. ! ! ! ! --- 1,355 ---- ! TLS/SSL library - PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! --------------- ----------- ----------------------------------------- ! ! ! 2004-2-10 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Cryptography/PKCS1.cs ! ! - Fixed typo. ! ! 2004-2-09 Carlos Guzmán Álvarez <car...@te...> ! ! * Changed license headers to remove accents. ! ! 2003-12-23 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Try to improve record reading. ! ! 2003-12-21 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: ! ! - Send always the first certificate. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: ! ! - Added changes for correct verification of the signed data sent ! by the server. ! ! * Mono.Security.Cryptography/PKCS1.cs: ! ! - Added change to Encode_v15 method for allow correct ! encoding of hash algorithms that doesn't have an OID ! like the MD5SHA1 hash used in SSL/TLS protocols. ! ! * Added files from mono:: project that are going to be needed ! for client authentication: ! ! Mono.Math/* ! ! Mono.Math.Prime/* ! ! Mono.Math.Prime.Generator/* ! ! Mono.Security.Cryptography/RSAManaged.cs ! ! * Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs: ! ! - Create RSA as an RSAManaged instance. ! ! * Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs: ! * Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs: ! ! - Changed key field to be of RSA type. ! ! 2003-12-14 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs: ! * Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs: ! ! - Added new classes for implement in the future RSA-SSL signatures. ! ! * Changed #region names in all source files. ! ! 2003-12-09 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Handshake.Client/TlsServerCertificate.cs: ! ! - Fixed message (but not working yet - we need RSA signing ! capabilitites with MD5SHA1 hash). ! ! * Mono.Security.Protocol.Handshake.Client/TlsServerCertificate.cs: ! ! - Retrict certificate validation to the first validation. ! ( real validation needs to be made using a chain ) ! ! - Improved domain validation by making a IP checking between ! the target host IP and the certificate domain IP. ! ! - Fixed error list handling on certificate validation. ! ! 2003-11-28 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Added new exceptions. ! ! 2003-11-23 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslServerStream.cs: ! ! - Added new SslServerStream class with empty methods. ! ! * Mono.Security.Protocol.Tls.Handshake.Server: ! ! - New directory with class definitions of handshake message classes ! for the server implementation. ! ! - Class names for server handshake messages are the same as for ! client implementation. ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Throw exception in constrctors when the targetHost or the streams are invalid. ! ! - Added correct exception throwing in read/write methods. ! ! - Added initial implementation of BeginRead and EndRead methods. ! ! * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs: ! ! - Added new constructor. ! ! - Changed UpdateSession() method to Update() and replaced method ! name in derived classes. ! ! ------------------------- Updated Mono Sources ---------------------- ! ! 2003-11-22 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! ! - Better handling of padding bytes on message encryption. ! ! * Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs: ! ! - Uncommented AES ciphersuites. ! ! ! 2003-11-21 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! - Add correct implementation of RaiseClientCertificateSelection ! ! 2003-11-17 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/SslClientStream.cs: ! ! Removed ReadByte method, use innerStream.ReadByte() method instead. ! ! 2003-11-13 Carlos Guzmán Álvarez <car...@te...> ! ! * Added implementation of an SslClientStream class similar to the MS .NET Framework 1.2 documentation. ! ! The next files are no more needed: ! ! - TlsSession.cs ! ! - TlsNetworkStream.cs ! ! - TlsSocket.cs ! ! - TlsSessionState.cs ! ! The next files are renamed: ! ! - TlsSessionSettings.cs -> TlsClientSettings.cs ! ! - TlsSessionContext.cs -> TlsContext.cs ! ! The next files are new: ! ! - SslClientStream.cs ( the name is non definitive yet ) ! ! The next files where changed to reflect the new canges: ! ! - TlsHandshakeMessage.cs ! ! - TlsClientCertificate.cs ! ! - TlsClientCertificateVerify.cs ! ! - TlsClientFinished.cs ! ! - TlsClientHello.cs ! ! - TlsClientKeyExchange.cs ! ! - TlsServerCertificate.cs ! ! - TlsServerCertificateRequest.cs ! ! - TlsServerFinished.cs ! ! - TlsServerHello.cs ! ! - TlsServerHelloDone.cs ! ! - TlsServerKeyExchange.cs ! ! - TlsAlert.cs ! ! - TlsCloseNotifyAlert.cs ! ! ! 2003-11-12 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: ! ! - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) ! ! * Mono.Security.Protocol.Tls/TlsProtocol.cs: ! ! - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) ! ! * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: ! ! - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) ! ! * Mono.Security.Cryptography/TlsCompressionMethod.cs: ! ! - Renamed to SecurityCompressionType. ! ! * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: ! * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: ! * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: ! ! - New enumerations that matches .NET 1.2 definitions with some minor differences. ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Added changes for make use of new enumerations. ! ! * Mono.Security.Protocol.Tls/TlsClientStream.cs: ! ! - Added new informative properties that matches .NET 1.2 SslClientStream ! ( Not all the properties are implemented yet ). ! ! ! 2003-11-10 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: ! ! - Fixed invalid alert message. ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: ! * Mono.Security.Cryptography/HMAC.cs: ! * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: ! ! - Changed ( Thanks to Sebastién Pouliot for his feedback ) ! ! SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider(); ! MD5CryptoServiceProvider sha = new MD5CryptoServiceProvider(); ! ! to ! ! HashAlgorithm sha = SHA1.Create(); ! HashAlgorithm md5 = MD5.Create(); ! ! ! 2003-11-04 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: ! ! - Commented server certificate signature verification. ! ! * Mono.Security.Protocol.Tls/TlsServerSettings.cs: ! ! - Renamed ServerCertificates property to Certificates. ! ! ! ----------------- Updated Mono Sources ----------------------- ! ! ! ! 2003-11-04 Carlos Guzmán Álvarez <car...@te...> ! ! * CipherSuite.cs: ! ! - Added custom padding for record encryption. ! ! ! 2003-11-03 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessages.cs: ! ! - Removed file. ! ! * Mono.Security.Protocol.Tls/TlsSslHandshakeHash.cs: ! ! - New class for handshake hashes calculation on SSL3 protocol. ! ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Fixed mac keys clearing for SSL3 protocol. ! ! * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs: ! ! - Added changes for make use of new TlsSslHandshakeHash class. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs: ! ! - Added initial implementation for SSL3 protocol. ! ! * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: ! ! - New class for md5-sha hash calculation. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsHandshakeMessage.cs: ! ! - Make use of new MD5SHA1CryptoServiceProvider class. ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: ! ! - Added initial implementation (not finished). ! ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: ! ! - Minor change to message processing. ! ! - Changed verify method name to verifySignature. ! ! * Mono.Security.Protocol.Tls/TlsSessionContext.cs: ! ! - Changed handshakeHashes member to be an TlsStream. ! ! 2003-10-28 Carlos Guzmán Álvarez <car...@te...> ! ! * Mono.Security.Protocol.Tls/CipherSuite.cs: ! * Mono.Security.Protocol.Tls/TlsSessionSettings.cs: ! * Mono.Security.Protocol.Tls/TlsServerSettings.cs: ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.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 changes for make use of X509 classes from mono. ! ! * Mono.Security/ASN1Convert.cs: ! * Mono.Security.X509/*.*: ! ! - New files from mono for allow basic certificate validation. ! ! ! 2003-10-21 Carlos Guzmán Álvarez <car...@te...> ! ! * Added specific changelog file for the TLS/SSL implementation. ! ! * Added partial implementation of SSL3 protocol. ! ! ! ! |
From: <car...@us...> - 2004-02-10 08:52:46
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.Cryptography In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22517 Modified Files: PKCS1.cs Log Message: Fixed typo Index: PKCS1.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.Cryptography/PKCS1.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PKCS1.cs 21 Dec 2003 14:52:03 -0000 1.2 --- PKCS1.cs 10 Feb 2004 08:49:33 -0000 1.3 *************** *** 270,274 **** // NOTE: some signatures don't include the hash OID (pretty lame but real) // and compatible with MS implementation ! if ((EM2 [0] != 0x00) || (EM2 [0] != 0x01)) return false; // TODO: add more validation --- 270,274 ---- // NOTE: some signatures don't include the hash OID (pretty lame but real) // and compatible with MS implementation ! if ((EM2 [0] != 0x00) || (EM2 [1] != 0x01)) return false; // TODO: add more validation *************** *** 294,306 **** byte[] t = null; ! string oid = CryptoConfig.MapNameToOID (hash.ToString ()); ! if (oid != null) ! { ! ASN1 digestAlgorithm = new ASN1 (0x30); ! digestAlgorithm.Add (new ASN1 (CryptoConfig.EncodeOID (oid))); ! digestAlgorithm.Add (new ASN1 (0x05)); // NULL ! ASN1 digest = new ASN1 (0x04, hashValue); ! ASN1 digestInfo = new ASN1 (0x30); ! digestInfo.Add (digestAlgorithm); digestInfo.Add (digest); --- 294,306 ---- byte[] t = null; ! string oid = CryptoConfig.MapNameToOID (hash.ToString ()); ! if (oid != null) ! { ! ASN1 digestAlgorithm = new ASN1 (0x30); ! digestAlgorithm.Add (new ASN1 (CryptoConfig.EncodeOID (oid))); ! digestAlgorithm.Add (new ASN1 (0x05)); // NULL ! ASN1 digest = new ASN1 (0x04, hashValue); ! ASN1 digestInfo = new ASN1 (0x30); ! digestInfo.Add (digestAlgorithm); digestInfo.Add (digest); |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12340 Modified Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHello.cs TlsClientKeyExchange.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHello.cs TlsServerHelloDone.cs TlsServerKeyExchange.cs Log Message: Updated license headers Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TlsClientCertificate.cs 8 Feb 2004 22:26:17 -0000 1.14 --- TlsClientCertificate.cs 9 Feb 2004 14:17:41 -0000 1.15 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TlsClientCertificateVerify.cs 8 Feb 2004 22:26:17 -0000 1.18 --- TlsClientCertificateVerify.cs 9 Feb 2004 14:17:41 -0000 1.19 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: TlsClientFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TlsClientFinished.cs 14 Dec 2003 15:01:54 -0000 1.14 --- TlsClientFinished.cs 9 Feb 2004 14:17:41 -0000 1.15 *************** *** 1,86 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsClientFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientFinished(TlsContext context) ! : base(context, TlsHandshakeType.Finished) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! this.Reset(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Context.MasterSecret); ! ! TlsStream data = new TlsStream(); ! data.Write(this.Context.HandshakeMessages.ToArray()); ! data.Write((int)0x434C4E54); ! ! hash.TransformFinalBlock(data.ToArray(), 0, (int)data.Length); ! ! this.Write(hash.Hash); ! ! data.Reset(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Compute handshake messages hash ! HashAlgorithm hash = new MD5SHA1(); ! hash.ComputeHash( ! this.Context.HandshakeMessages.ToArray(), ! 0, ! (int)this.Context.HandshakeMessages.Length); ! ! // Write message ! Write(this.Context.Cipher.PRF(this.Context.MasterSecret, "client finished", hash.Hash, 12)); ! } ! ! #endregion ! } ! } --- 1,86 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsClientFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientFinished(TlsContext context) ! : base(context, TlsHandshakeType.Finished) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! this.Reset(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Context.MasterSecret); ! ! TlsStream data = new TlsStream(); ! data.Write(this.Context.HandshakeMessages.ToArray()); ! data.Write((int)0x434C4E54); ! ! hash.TransformFinalBlock(data.ToArray(), 0, (int)data.Length); ! ! this.Write(hash.Hash); ! ! data.Reset(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Compute handshake messages hash ! HashAlgorithm hash = new MD5SHA1(); ! hash.ComputeHash( ! this.Context.HandshakeMessages.ToArray(), ! 0, ! (int)this.Context.HandshakeMessages.Length); ! ! // Write message ! Write(this.Context.Cipher.PRF(this.Context.MasterSecret, "client finished", hash.Hash, 12)); ! } ! ! #endregion ! } ! } Index: TlsClientHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TlsClientHello.cs 14 Dec 2003 15:01:54 -0000 1.12 --- TlsClientHello.cs 9 Feb 2004 14:17:41 -0000 1.13 *************** *** 1,114 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsClientHello : TlsHandshakeMessage ! { ! #region Fields ! ! private byte[] random; ! ! #endregion ! ! #region Constructors ! ! public TlsClientHello(TlsContext context) ! : base(context, TlsHandshakeType.ClientHello) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! this.Context.ClientRandom = random; ! ! random = null; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Client Version ! this.Write((short)this.Context.Protocol); ! ! // Random bytes - Unix time + Radom bytes [28] ! TlsStream clientRandom = new TlsStream(); ! clientRandom.Write(this.Context.GetUnixTime()); ! clientRandom.Write(this.Context.GetSecureRandomBytes(28)); ! this.random = clientRandom.ToArray(); ! clientRandom.Reset(); ! ! this.Write(this.random); ! ! // Session id ! // Send the session ID empty ! if (this.Context.SessionId != null) ! { ! this.Write((byte)this.Context.SessionId.Length); ! if (this.Context.SessionId.Length > 0) ! { ! this.Write(this.Context.SessionId); ! } ! } ! else ! { ! this.Write((byte)0); ! } ! ! // Write length of Cipher suites ! this.Write((short)(this.Context.SupportedCiphers.Count*2)); ! ! // Write Supported Cipher suites ! for (int i = 0; i < this.Context.SupportedCiphers.Count; i++) ! { ! this.Write((short)this.Context.SupportedCiphers[i].Code); ! } ! ! // Compression methods length ! this.Write((byte)1); ! ! // Compression methods ( 0 = none ) ! this.Write((byte)this.Context.CompressionMethod); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,114 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsClientHello : TlsHandshakeMessage ! { ! #region Fields ! ! private byte[] random; ! ! #endregion ! ! #region Constructors ! ! public TlsClientHello(TlsContext context) ! : base(context, TlsHandshakeType.ClientHello) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! this.Context.ClientRandom = random; ! ! random = null; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Client Version ! this.Write((short)this.Context.Protocol); ! ! // Random bytes - Unix time + Radom bytes [28] ! TlsStream clientRandom = new TlsStream(); ! clientRandom.Write(this.Context.GetUnixTime()); ! clientRandom.Write(this.Context.GetSecureRandomBytes(28)); ! this.random = clientRandom.ToArray(); ! clientRandom.Reset(); ! ! this.Write(this.random); ! ! // Session id ! // Send the session ID empty ! if (this.Context.SessionId != null) ! { ! this.Write((byte)this.Context.SessionId.Length); ! if (this.Context.SessionId.Length > 0) ! { ! this.Write(this.Context.SessionId); ! } ! } ! else ! { ! this.Write((byte)0); ! } ! ! // Write length of Cipher suites ! this.Write((short)(this.Context.SupportedCiphers.Count*2)); ! ! // Write Supported Cipher suites ! for (int i = 0; i < this.Context.SupportedCiphers.Count; i++) ! { ! this.Write((short)this.Context.SupportedCiphers[i].Code); ! } ! ! // Compression methods length ! this.Write((byte)1); ! ! // Compression methods ( 0 = none ) ! this.Write((byte)this.Context.CompressionMethod); ! } ! ! #endregion ! } } \ No newline at end of file Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TlsClientKeyExchange.cs 14 Dec 2003 15:01:54 -0000 1.12 --- TlsClientKeyExchange.cs 9 Feb 2004 14:17:41 -0000 1.13 *************** *** 1,98 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsClientKeyExchange : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientKeyExchange (TlsContext context) : ! base(context, ! TlsHandshakeType.ClientKeyExchange) ! { ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Compute pre master secret ! byte[] preMasterSecret = this.Context.Cipher.CreatePremasterSecret(); ! ! // Create a new RSA key ! RSA rsa = this.Context.Cipher.CertificateRSA(); ! ! // Encrypt premaster_sercret ! RSAPKCS1KeyExchangeFormatter formatter = new RSAPKCS1KeyExchangeFormatter(rsa); ! ! // Write the preMasterSecret encrypted ! byte[] buffer = formatter.CreateKeyExchange(preMasterSecret); ! this.Write(buffer); ! ! // Create master secret ! this.Context.Cipher.ComputeMasterSecret(preMasterSecret); ! ! // Create keys ! this.Context.Cipher.ComputeKeys(); ! ! // Clear resources ! rsa.Clear(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Compute pre master secret ! byte[] preMasterSecret = this.Context.Cipher.CreatePremasterSecret(); ! ! // Create a new RSA key ! RSA rsa = this.Context.Cipher.CertificateRSA(); ! ! // Encrypt premaster_sercret ! RSAPKCS1KeyExchangeFormatter formatter = new RSAPKCS1KeyExchangeFormatter(rsa); ! ! // Write the preMasterSecret encrypted ! byte[] buffer = formatter.CreateKeyExchange(preMasterSecret); ! this.Write((short)buffer.Length); ! this.Write(buffer); ! ! // Create master secret ! this.Context.Cipher.ComputeMasterSecret(preMasterSecret); ! ! // Create keys ! this.Context.Cipher.ComputeKeys(); ! ! // Clear resources ! rsa.Clear(); ! } ! ! #endregion ! } ! } --- 1,98 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsClientKeyExchange : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientKeyExchange (TlsContext context) : ! base(context, ! TlsHandshakeType.ClientKeyExchange) ! { ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Compute pre master secret ! byte[] preMasterSecret = this.Context.Cipher.CreatePremasterSecret(); ! ! // Create a new RSA key ! RSA rsa = this.Context.Cipher.CertificateRSA(); ! ! // Encrypt premaster_sercret ! RSAPKCS1KeyExchangeFormatter formatter = new RSAPKCS1KeyExchangeFormatter(rsa); ! ! // Write the preMasterSecret encrypted ! byte[] buffer = formatter.CreateKeyExchange(preMasterSecret); ! this.Write(buffer); ! ! // Create master secret ! this.Context.Cipher.ComputeMasterSecret(preMasterSecret); ! ! // Create keys ! this.Context.Cipher.ComputeKeys(); ! ! // Clear resources ! rsa.Clear(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Compute pre master secret ! byte[] preMasterSecret = this.Context.Cipher.CreatePremasterSecret(); ! ! // Create a new RSA key ! RSA rsa = this.Context.Cipher.CertificateRSA(); ! ! // Encrypt premaster_sercret ! RSAPKCS1KeyExchangeFormatter formatter = new RSAPKCS1KeyExchangeFormatter(rsa); ! ! // Write the preMasterSecret encrypted ! byte[] buffer = formatter.CreateKeyExchange(preMasterSecret); ! this.Write((short)buffer.Length); ! this.Write(buffer); ! ! // Create master secret ! this.Context.Cipher.ComputeMasterSecret(preMasterSecret); ! ! // Create keys ! this.Context.Cipher.ComputeKeys(); ! ! // Clear resources ! rsa.Clear(); ! } ! ! #endregion ! } ! } Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TlsServerCertificate.cs 26 Dec 2003 11:17:14 -0000 1.16 --- TlsServerCertificate.cs 9 Feb 2004 14:17:41 -0000 1.17 *************** *** 1,222 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Net; ! using System.Collections; ! using System.Text.RegularExpressions; ! using System.Security.Cryptography; ! using X509Cert = System.Security.Cryptography.X509Certificates; ! ! using Mono.Security.Protocol.Tls.Alerts; ! using Mono.Security.X509; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerCertificate : TlsHandshakeMessage ! { ! #region Fields ! ! private X509CertificateCollection certificates; ! ! #endregion ! ! #region Constructors ! ! public TlsServerCertificate(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Certificate, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! this.Context.ServerSettings.Certificates = certificates; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! this.certificates = new X509CertificateCollection(); ! ! int readed = 0; ! int length = this.ReadInt24(); ! ! while (readed < length) ! { ! // Read certificate length ! int certLength = ReadInt24(); ! ! // Increment readed ! readed += 3; ! ! if (certLength > 0) ! { ! // Read certificate data ! byte[] buffer = this.ReadBytes(certLength); ! ! // Create a new X509 Certificate ! X509Certificate certificate = new X509Certificate(buffer); ! certificates.Add(certificate); ! ! /* ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! ! b.AppendFormat( ! "\r\nCertificate {0} | Issuer name {1} | Self signed {2} ({3} bytes) \r\n", ! certificates.Count, ! certificate.IssuerName, ! certificate.IsSelfSigned, ! buffer.Length); ! ! b.Append("Contents: \r\n"); ! ! int byteCount = 0; ! for (int i = 0; i < buffer.Length; i++) ! { ! if (byteCount == 25) ! { ! byteCount = 0; ! b.Append("\r\n"); ! } ! ! b.AppendFormat("{0} ", buffer[i].ToString("x2")); ! ! byteCount++; ! } ! ! System.Diagnostics.Trace.Write(b.ToString()); ! */ ! ! readed += certLength; ! } ! } ! ! #warning Correct validation needs to be made using a certificate chain ! ! // Restrict validation to the first certificate ! this.validateCertificate(certificates[0]); ! } ! ! #endregion ! ! #region Private Methods ! ! private void validateCertificate(X509Certificate certificate) ! { ! ArrayList errors = new ArrayList(); ! ! // 1 step : Validate dates ! if (!certificate.IsCurrent) ! { ! // errors.Add(0x800B0101); ! errors.Add(0x01); ! } ! ! // 2 step: Validate CA ! ! ! // 3 step: Validate digital sign ! /* ! if (!certificate.VerifySignature(certificate.RSA)) ! { ! throw this.Context.CreateException("Certificate received from the server has invalid signature."); ! } ! */ ! ! // 4 step: Validate domain name ! if (!this.checkDomainName(certificate.SubjectName)) ! { ! // errors.Add(0x800B010F); ! errors.Add(0x02); ! } ! ! if (errors.Count > 0) ! { ! int[] certificateErrors = (int[])errors.ToArray(typeof(int)); ! ! if (!this.Context.SslStream.RaiseServerCertificateValidation( ! new X509Cert.X509Certificate(certificate.RawData), ! new int[]{})) ! { ! throw this.Context.CreateException("Invalid certificate received form server."); ! } ! } ! } ! ! private bool checkDomainName(string subjectName) ! { ! string domainName = String.Empty; ! Regex search = new Regex(@"([\w\s\d]*)\s*=\s*([^,]*)"); ! ! MatchCollection elements = search.Matches(subjectName); ! ! foreach (Match element in elements) ! { ! switch (element.Groups[1].Value.Trim().ToUpper()) ! { ! case "CN": ! domainName = element.Groups[2].Value; ! break; ! } ! } ! ! if (domainName == String.Empty) ! { ! return false; ! } ! else ! { ! string targetHost = this.Context.ClientSettings.TargetHost; ! ! // Check that the IP is correct ! try ! { ! IPAddress ipHost = Dns.Resolve(targetHost).AddressList[0]; ! IPAddress ipDomain = Dns.Resolve(domainName).AddressList[0]; ! ! return (ipHost.Address == ipDomain.Address); ! } ! catch (Exception) ! { ! return false; ! } ! } ! } ! ! #endregion ! } ! } --- 1,222 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Net; ! using System.Collections; ! using System.Text.RegularExpressions; ! using System.Security.Cryptography; ! using X509Cert = System.Security.Cryptography.X509Certificates; ! ! using Mono.Security.Protocol.Tls.Alerts; ! using Mono.Security.X509; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerCertificate : TlsHandshakeMessage ! { ! #region Fields ! ! private X509CertificateCollection certificates; ! ! #endregion ! ! #region Constructors ! ! public TlsServerCertificate(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Certificate, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! this.Context.ServerSettings.Certificates = certificates; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! this.certificates = new X509CertificateCollection(); ! ! int readed = 0; ! int length = this.ReadInt24(); ! ! while (readed < length) ! { ! // Read certificate length ! int certLength = ReadInt24(); ! ! // Increment readed ! readed += 3; ! ! if (certLength > 0) ! { ! // Read certificate data ! byte[] buffer = this.ReadBytes(certLength); ! ! // Create a new X509 Certificate ! X509Certificate certificate = new X509Certificate(buffer); ! certificates.Add(certificate); ! ! /* ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! ! b.AppendFormat( ! "\r\nCertificate {0} | Issuer name {1} | Self signed {2} ({3} bytes) \r\n", ! certificates.Count, ! certificate.IssuerName, ! certificate.IsSelfSigned, ! buffer.Length); ! ! b.Append("Contents: \r\n"); ! ! int byteCount = 0; ! for (int i = 0; i < buffer.Length; i++) ! { ! if (byteCount == 25) ! { ! byteCount = 0; ! b.Append("\r\n"); ! } ! ! b.AppendFormat("{0} ", buffer[i].ToString("x2")); ! ! byteCount++; ! } ! ! System.Diagnostics.Trace.Write(b.ToString()); ! */ ! ! readed += certLength; ! } ! } ! ! #warning Correct validation needs to be made using a certificate chain ! ! // Restrict validation to the first certificate ! this.validateCertificate(certificates[0]); ! } ! ! #endregion ! ! #region Private Methods ! ! private void validateCertificate(X509Certificate certificate) ! { ! ArrayList errors = new ArrayList(); ! ! // 1 step : Validate dates ! if (!certificate.IsCurrent) ! { ! // errors.Add(0x800B0101); ! errors.Add(0x01); ! } ! ! // 2 step: Validate CA ! ! ! // 3 step: Validate digital sign ! /* ! if (!certificate.VerifySignature(certificate.RSA)) ! { ! throw this.Context.CreateException("Certificate received from the server has invalid signature."); ! } ! */ ! ! // 4 step: Validate domain name ! if (!this.checkDomainName(certificate.SubjectName)) ! { ! // errors.Add(0x800B010F); ! errors.Add(0x02); ! } ! ! if (errors.Count > 0) ! { ! int[] certificateErrors = (int[])errors.ToArray(typeof(int)); ! ! if (!this.Context.SslStream.RaiseServerCertificateValidation( ! new X509Cert.X509Certificate(certificate.RawData), ! new int[]{})) ! { ! throw this.Context.CreateException("Invalid certificate received form server."); ! } ! } ! } ! ! private bool checkDomainName(string subjectName) ! { ! string domainName = String.Empty; ! Regex search = new Regex(@"([\w\s\d]*)\s*=\s*([^,]*)"); ! ! MatchCollection elements = search.Matches(subjectName); ! ! foreach (Match element in elements) ! { ! switch (element.Groups[1].Value.Trim().ToUpper()) ! { ! case "CN": ! domainName = element.Groups[2].Value; ! break; ! } ! } ! ! if (domainName == String.Empty) ! { ! return false; ! } ! else ! { ! string targetHost = this.Context.ClientSettings.TargetHost; ! ! // Check that the IP is correct ! try ! { ! IPAddress ipHost = Dns.Resolve(targetHost).AddressList[0]; ! IPAddress ipDomain = Dns.Resolve(domainName).AddressList[0]; ! ! return (ipHost.Address == ipDomain.Address); ! } ! catch (Exception) ! { ! return false; ! } ! } ! } ! ! #endregion ! } ! } Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsServerCertificateRequest.cs 14 Dec 2003 15:01:54 -0000 1.9 --- TlsServerCertificateRequest.cs 9 Feb 2004 14:17:41 -0000 1.10 *************** *** 1,112 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Text; ! using Mono.Security; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerCertificateRequest : TlsHandshakeMessage ! { ! #region Fields ! ! private TlsClientCertificateType[] certificateTypes; ! private string[] distinguisedNames; ! ! #endregion ! ! #region Constructors ! ! public TlsServerCertificateRequest(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! this.Context.ServerSettings.CertificateTypes = this.certificateTypes; ! this.Context.ServerSettings.DistinguisedNames = this.distinguisedNames; ! this.Context.ServerSettings.CertificateRequest = true; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! throw new NotSupportedException(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Read requested certificate types ! int typesCount = this.ReadByte(); ! ! this.certificateTypes = new TlsClientCertificateType[typesCount]; ! ! for (int i = 0; i < typesCount; i++) ! { ! this.certificateTypes[i] = (TlsClientCertificateType)this.ReadByte(); ! } ! ! /* ! * Read requested certificate authorities (Distinguised Names) ! * ! * Name ::= SEQUENCE OF RelativeDistinguishedName ! * ! * RelativeDistinguishedName ::= SET OF AttributeValueAssertion ! * ! * AttributeValueAssertion ::= SEQUENCE { ! * attributeType OBJECT IDENTIFIER ! * attributeValue ANY } ! */ ! if (this.ReadInt16() != 0) ! { ! ASN1 rdn = new ASN1(this.ReadBytes(this.ReadInt16())); ! ! distinguisedNames = new string[rdn.Count]; ! ! #warning "needs testing" ! for (int i = 0; i < rdn.Count; i++) ! { ! // element[0] = attributeType ! // element[1] = attributeValue ! ASN1 element = new ASN1(rdn[i].Value); ! ! distinguisedNames[i] = Encoding.UTF8.GetString(element[1].Value); ! } ! } ! } ! ! #endregion ! } ! } --- 1,112 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Text; ! using Mono.Security; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerCertificateRequest : TlsHandshakeMessage ! { ! #region Fields ! ! private TlsClientCertificateType[] certificateTypes; ! private string[] distinguisedNames; ! ! #endregion ! ! #region Constructors ! ! public TlsServerCertificateRequest(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! this.Context.ServerSettings.CertificateTypes = this.certificateTypes; ! this.Context.ServerSettings.DistinguisedNames = this.distinguisedNames; ! this.Context.ServerSettings.CertificateRequest = true; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! throw new NotSupportedException(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Read requested certificate types ! int typesCount = this.ReadByte(); ! ! this.certificateTypes = new TlsClientCertificateType[typesCount]; ! ! for (int i = 0; i < typesCount; i++) ! { ! this.certificateTypes[i] = (TlsClientCertificateType)this.ReadByte(); ! } ! ! /* ! * Read requested certificate authorities (Distinguised Names) ! * ! * Name ::= SEQUENCE OF RelativeDistinguishedName ! * ! * RelativeDistinguishedName ::= SET OF AttributeValueAssertion ! * ! * AttributeValueAssertion ::= SEQUENCE { ! * attributeType OBJECT IDENTIFIER ! * attributeValue ANY } ! */ ! if (this.ReadInt16() != 0) ! { ! ASN1 rdn = new ASN1(this.ReadBytes(this.ReadInt16())); ! ! distinguisedNames = new string[rdn.Count]; ! ! #warning "needs testing" ! for (int i = 0; i < rdn.Count; i++) ! { ! // element[0] = attributeType ! // element[1] = attributeValue ! ASN1 element = new ASN1(rdn[i].Value); ! ! distinguisedNames[i] = Encoding.UTF8.GetString(element[1].Value); ! } ! } ! } ! ! #endregion ! } ! } Index: TlsServerFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TlsServerFinished.cs 14 Dec 2003 15:01:54 -0000 1.14 --- TlsServerFinished.cs 9 Feb 2004 14:17:41 -0000 1.15 *************** *** 1,118 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerFinished(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! // Reset Hahdshake messages information ! this.Context.HandshakeMessages.Reset(); ! ! // Hahdshake is finished ! this.Context.HandshakeFinished = true; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Context.MasterSecret); ! ! TlsStream data = new TlsStream(); ! data.Write(this.Context.HandshakeMessages.ToArray()); ! data.Write((int)0x53525652); ! ! hash.TransformFinalBlock(data.ToArray(), 0, (int)data.Length); ! ! data.Reset(); ! ! byte[] serverHash = this.ReadBytes((int)Length); ! byte[] clientHash = hash.Hash; ! ! // Check server prf against client prf ! if (clientHash.Length != serverHash.Length) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! for (int i = 0; i < serverHash.Length; i++) ! { ! if (clientHash[i] != serverHash[i]) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! } ! } ! ! protected override void ProcessAsTls1() ! { ! byte[] serverPRF = this.ReadBytes((int)Length); ! HashAlgorithm hash = new MD5SHA1(); ! ! hash.ComputeHash( ! this.Context.HandshakeMessages.ToArray(), ! 0, ! (int)this.Context.HandshakeMessages.Length); ! ! byte[] clientPRF = this.Context.Cipher.PRF(this.Context.MasterSecret, "server finished", hash.Hash, 12); ! ! // Check server prf against client prf ! if (clientPRF.Length != serverPRF.Length) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! for (int i = 0; i < serverPRF.Length; i++) ! { ! if (clientPRF[i] != serverPRF[i]) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! } ! } ! ! #endregion ! } ! } --- 1,118 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerFinished(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! // Reset Hahdshake messages information ! this.Context.HandshakeMessages.Reset(); ! ! // Hahdshake is finished ! this.Context.HandshakeFinished = true; ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Compute handshake messages hashes ! HashAlgorithm hash = new TlsSslHandshakeHash(this.Context.MasterSecret); ! ! TlsStream data = new TlsStream(); ! data.Write(this.Context.HandshakeMessages.ToArray()); ! data.Write((int)0x53525652); ! ! hash.TransformFinalBlock(data.ToArray(), 0, (int)data.Length); ! ! data.Reset(); ! ! byte[] serverHash = this.ReadBytes((int)Length); ! byte[] clientHash = hash.Hash; ! ! // Check server prf against client prf ! if (clientHash.Length != serverHash.Length) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! for (int i = 0; i < serverHash.Length; i++) ! { ! if (clientHash[i] != serverHash[i]) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! } ! } ! ! protected override void ProcessAsTls1() ! { ! byte[] serverPRF = this.ReadBytes((int)Length); ! HashAlgorithm hash = new MD5SHA1(); ! ! hash.ComputeHash( ! this.Context.HandshakeMessages.ToArray(), ! 0, ! (int)this.Context.HandshakeMessages.Length); ! ! byte[] clientPRF = this.Context.Cipher.PRF(this.Context.MasterSecret, "server finished", hash.Hash, 12); ! ! // Check server prf against client prf ! if (clientPRF.Length != serverPRF.Length) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! for (int i = 0; i < serverPRF.Length; i++) ! { ! if (clientPRF[i] != serverPRF[i]) ! { ! throw new TlsException("Invalid ServerFinished message received."); ! } ! } ! } ! ! #endregion ! } ! } Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TlsServerHello.cs 14 Dec 2003 15:01:54 -0000 1.15 --- TlsServerHello.cs 9 Feb 2004 14:17:41 -0000 1.16 *************** *** 1,139 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerHello : TlsHandshakeMessage ! { ! #region Fields ! ! private SecurityProtocolType protocol; ! private SecurityCompressionType compressionMethod; ! private byte[] random; ! private byte[] sessionId; ! private CipherSuite cipherSuite; ! ! #endregion ! ! #region Constructors ! ! public TlsServerHello(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! this.Context.SessionId = this.sessionId; ! this.Context.ServerRandom = this.random; ! this.Context.Cipher = this.cipherSuite; ! this.Context.CompressionMethod = this.compressionMethod; ! this.Context.Cipher.Context = this.Context; ! ! // Compute ClientRandom + ServerRandom ! TlsStream random = new TlsStream(); ! random.Write(this.Context.ClientRandom); ! random.Write(this.Context.ServerRandom); ! this.Context.RandomCS = random.ToArray(); ! ! // Server Random + Client Random ! random.Reset(); ! random.Write(this.Context.ServerRandom); ! random.Write(this.Context.ClientRandom); ! ! this.Context.RandomSC = random.ToArray(); ! random.Reset(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Read protocol version ! this.protocol = (SecurityProtocolType)this.ReadInt16(); ! ! // Read random - Unix time + Random bytes ! this.random = this.ReadBytes(32); ! ! // Read Session id ! int length = (int)ReadByte(); ! if (length > 0) ! { ! this.sessionId = this.ReadBytes(length); ! } ! ! // Read cipher suite ! short cipherCode = this.ReadInt16(); ! if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) ! { ! // The server has sent an invalid ciphersuite ! throw new TlsException("Invalid cipher suite received from server"); ! } ! this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; ! ! // Read compression methods ( always 0 ) ! this.compressionMethod = (SecurityCompressionType)this.ReadByte(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Read protocol version ! this.protocol = (SecurityProtocolType)this.ReadInt16(); ! ! // Read random - Unix time + Random bytes ! this.random = this.ReadBytes(32); ! ! // Read Session id ! int length = (int)ReadByte(); ! if (length > 0) ! { ! this.sessionId = this.ReadBytes(length); ! } ! ! // Read cipher suite ! short cipherCode = this.ReadInt16(); ! if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) ! { ! // The server has sent an invalid ciphersuite ! throw new TlsException("Invalid cipher suite received from server"); ! } ! this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; ! ! // Read compression methods ( always 0 ) ! this.compressionMethod = (SecurityCompressionType)this.ReadByte(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,139 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerHello : TlsHandshakeMessage ! { ! #region Fields ! ! private SecurityProtocolType protocol; ! private SecurityCompressionType compressionMethod; ! private byte[] random; ! private byte[] sessionId; ! private CipherSuite cipherSuite; ! ! #endregion ! ! #region Constructors ! ! public TlsServerHello(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ServerHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! base.Update(); ! ! this.Context.SessionId = this.sessionId; ! this.Context.ServerRandom = this.random; ! this.Context.Cipher = this.cipherSuite; ! this.Context.CompressionMethod = this.compressionMethod; ! this.Context.Cipher.Context = this.Context; ! ! // Compute ClientRandom + ServerRandom ! TlsStream random = new TlsStream(); ! random.Write(this.Context.ClientRandom); ! random.Write(this.Context.ServerRandom); ! this.Context.RandomCS = random.ToArray(); ! ! // Server Random + Client Random ! random.Reset(); ! random.Write(this.Context.ServerRandom); ! random.Write(this.Context.ClientRandom); ! ! this.Context.RandomSC = random.ToArray(); ! random.Reset(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! // Read protocol version ! this.protocol = (SecurityProtocolType)this.ReadInt16(); ! ! // Read random - Unix time + Random bytes ! this.random = this.ReadBytes(32); ! ! // Read Session id ! int length = (int)ReadByte(); ! if (length > 0) ! { ! this.sessionId = this.ReadBytes(length); ! } ! ! // Read cipher suite ! short cipherCode = this.ReadInt16(); ! if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) ! { ! // The server has sent an invalid ciphersuite ! throw new TlsException("Invalid cipher suite received from server"); ! } ! this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; ! ! // Read compression methods ( always 0 ) ! this.compressionMethod = (SecurityCompressionType)this.ReadByte(); ! } ! ! protected override void ProcessAsTls1() ! { ! // Read protocol version ! this.protocol = (SecurityProtocolType)this.ReadInt16(); ! ! // Read random - Unix time + Random bytes ! this.random = this.ReadBytes(32); ! ! // Read Session id ! int length = (int)ReadByte(); ! if (length > 0) ! { ! this.sessionId = this.ReadBytes(length); ! } ! ! // Read cipher suite ! short cipherCode = this.ReadInt16(); ! if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) ! { ! // The server has sent an invalid ciphersuite ! throw new TlsException("Invalid cipher suite received from server"); ! } ! this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; ! ! // Read compression methods ( always 0 ) ! this.compressionMethod = (SecurityCompressionType)this.ReadByte(); ! } ! ! #endregion ! } } \ No newline at end of file Index: TlsServerHelloDone.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsServerHelloDone.cs 14 Dec 2003 15:01:54 -0000 1.8 --- TlsServerHelloDone.cs 9 Feb 2004 14:17:41 -0000 1.9 *************** *** 1,63 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Client ! { ! internal class TlsServerHelloDone : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerHelloDone(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.... [truncated message content] |
From: <car...@us...> - 2004-02-10 03:07:36
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.Cryptography In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12935 Modified Files: HMAC.cs MD5SHA1.cs Log Message: Updated license headers Index: HMAC.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.Cryptography/HMAC.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HMAC.cs 14 Dec 2003 14:59:55 -0000 1.4 --- HMAC.cs 9 Feb 2004 14:18:39 -0000 1.5 *************** *** 1,191 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Cryptography ! { ! /* ! * References: ! * RFC 2104 (http://www.ietf.org/rfc/rfc2104.txt) ! * RFC 2202 (http://www.ietf.org/rfc/rfc2202.txt) ! * MSDN: ! * ! * Extending the KeyedHashAlgorithm Class (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconextendingkeyedhashalgorithmclass.asp) ! */ ! internal class HMAC : System.Security.Cryptography.KeyedHashAlgorithm ! { ! #region Fields ! ! private HashAlgorithm hash; ! private bool hashing; ! ! private byte[] innerPad; ! private byte[] outerPad; ! ! #endregion ! ! #region Properties ! ! public override byte[] Key ! { ! get { return (byte[])KeyValue.Clone(); } ! set ! { ! if (hashing) ! { ! throw new Exception("Cannot change key during hash operation."); ! } ! ! /* if key is longer than 64 bytes reset it to rgbKey = Hash(rgbKey) */ ! if (value.Length > 64) ! { ! KeyValue = hash.ComputeHash(value); ! } ! else ! { ! KeyValue = (byte[])value.Clone(); ! } ! ! initializePad(); ! } ! } ! ! #endregion ! ! #region Constructors ! ! public HMAC() ! { ! // Create the hash ! hash = MD5.Create(); ! // Set HashSizeValue ! HashSizeValue = hash.HashSize; ! ! // Generate a radom key ! byte[] rgbKey = new byte[64]; ! RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); ! rng.GetNonZeroBytes(rgbKey); ! ! KeyValue = (byte[])rgbKey.Clone(); ! ! this.Initialize(); ! } ! ! public HMAC(string hashName, byte[] rgbKey) ! { ! // Create the hash ! if (hashName == null || hashName.Length == 0) ! { ! hashName = "MD5"; ! } ! hash = HashAlgorithm.Create(hashName); ! // Set HashSizeValue ! HashSizeValue = hash.HashSize; ! ! /* if key is longer than 64 bytes reset it to rgbKey = Hash(rgbKey) */ ! if (rgbKey.Length > 64) ! { ! KeyValue = hash.ComputeHash(rgbKey); ! } ! else ! { ! KeyValue = (byte[])rgbKey.Clone(); ! } ! ! this.Initialize(); ! } ! ! #endregion ! ! #region Methods ! ! public override void Initialize() ! { ! hash.Initialize(); ! initializePad(); ! hashing = false; ! } ! ! protected override byte[] HashFinal() ! { ! if (!hashing) ! { ! hash.TransformBlock(innerPad, 0, innerPad.Length, innerPad, 0); ! hashing = true; ! } ! // Finalize the original hash ! hash.TransformFinalBlock(new byte[0], 0, 0); ! ! byte[] firstResult = hash.Hash; ! ! hash.Initialize(); ! hash.TransformBlock(outerPad, 0, outerPad.Length, outerPad, 0); ! hash.TransformFinalBlock(firstResult, 0, firstResult.Length); ! ! Initialize(); ! ! return hash.Hash; ! } ! ! protected override void HashCore( ! byte[] array, ! int ibStart, ! int cbSize) ! { ! if (!hashing) ! { ! hash.TransformBlock(innerPad, 0, innerPad.Length, innerPad, 0); ! hashing = true; ! } ! hash.TransformBlock(array, ibStart, cbSize, array, ibStart); ! } ! ! #endregion ! ! #region Private Methods ! ! private void initializePad() ! { ! // Fill pad arrays ! innerPad = new byte[64]; ! outerPad = new byte[64]; ! ! /* Pad the key for inner and outer digest */ ! for (int i = 0 ; i < KeyValue.Length; ++i) ! { ! innerPad[i] = (byte)(KeyValue[i] ^ 0x36); ! outerPad[i] = (byte)(KeyValue[i] ^ 0x5C); ! } ! for (int i = KeyValue.Length; i < 64; ++i) ! { ! innerPad[i] = 0x36; ! outerPad[i] = 0x5C; ! } ! } ! ! #endregion ! } ! } --- 1,191 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Cryptography ! { ! /* ! * References: ! * RFC 2104 (http://www.ietf.org/rfc/rfc2104.txt) ! * RFC 2202 (http://www.ietf.org/rfc/rfc2202.txt) ! * MSDN: ! * ! * Extending the KeyedHashAlgorithm Class (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconextendingkeyedhashalgorithmclass.asp) ! */ ! internal class HMAC : System.Security.Cryptography.KeyedHashAlgorithm ! { ! #region Fields ! ! private HashAlgorithm hash; ! private bool hashing; ! ! private byte[] innerPad; ! private byte[] outerPad; ! ! #endregion ! ! #region Properties ! ! public override byte[] Key ! { ! get { return (byte[])KeyValue.Clone(); } ! set ! { ! if (hashing) ! { ! throw new Exception("Cannot change key during hash operation."); ! } ! ! /* if key is longer than 64 bytes reset it to rgbKey = Hash(rgbKey) */ ! if (value.Length > 64) ! { ! KeyValue = hash.ComputeHash(value); ! } ! else ! { ! KeyValue = (byte[])value.Clone(); ! } ! ! initializePad(); ! } ! } ! ! #endregion ! ! #region Constructors ! ! public HMAC() ! { ! // Create the hash ! hash = MD5.Create(); ! // Set HashSizeValue ! HashSizeValue = hash.HashSize; ! ! // Generate a radom key ! byte[] rgbKey = new byte[64]; ! RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); ! rng.GetNonZeroBytes(rgbKey); ! ! KeyValue = (byte[])rgbKey.Clone(); ! ! this.Initialize(); ! } ! ! public HMAC(string hashName, byte[] rgbKey) ! { ! // Create the hash ! if (hashName == null || hashName.Length == 0) ! { ! hashName = "MD5"; ! } ! hash = HashAlgorithm.Create(hashName); ! // Set HashSizeValue ! HashSizeValue = hash.HashSize; ! ! /* if key is longer than 64 bytes reset it to rgbKey = Hash(rgbKey) */ ! if (rgbKey.Length > 64) ! { ! KeyValue = hash.ComputeHash(rgbKey); ! } ! else ! { ! KeyValue = (byte[])rgbKey.Clone(); ! } ! ! this.Initialize(); ! } ! ! #endregion ! ! #region Methods ! ! public override void Initialize() ! { ! hash.Initialize(); ! initializePad(); ! hashing = false; ! } ! ! protected override byte[] HashFinal() ! { ! if (!hashing) ! { ! hash.TransformBlock(innerPad, 0, innerPad.Length, innerPad, 0); ! hashing = true; ! } ! // Finalize the original hash ! hash.TransformFinalBlock(new byte[0], 0, 0); ! ! byte[] firstResult = hash.Hash; ! ! hash.Initialize(); ! hash.TransformBlock(outerPad, 0, outerPad.Length, outerPad, 0); ! hash.TransformFinalBlock(firstResult, 0, firstResult.Length); ! ! Initialize(); ! ! return hash.Hash; ! } ! ! protected override void HashCore( ! byte[] array, ! int ibStart, ! int cbSize) ! { ! if (!hashing) ! { ! hash.TransformBlock(innerPad, 0, innerPad.Length, innerPad, 0); ! hashing = true; ! } ! hash.TransformBlock(array, ibStart, cbSize, array, ibStart); ! } ! ! #endregion ! ! #region Private Methods ! ! private void initializePad() ! { ! // Fill pad arrays ! innerPad = new byte[64]; ! outerPad = new byte[64]; ! ! /* Pad the key for inner and outer digest */ ! for (int i = 0 ; i < KeyValue.Length; ++i) ! { ! innerPad[i] = (byte)(KeyValue[i] ^ 0x36); ! outerPad[i] = (byte)(KeyValue[i] ^ 0x5C); ! } ! for (int i = KeyValue.Length; i < 64; ++i) ! { ! innerPad[i] = 0x36; ! outerPad[i] = 0x5C; ! } ! } ! ! #endregion ! } ! } Index: MD5SHA1.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MD5SHA1.cs 14 Dec 2003 15:06:18 -0000 1.4 --- MD5SHA1.cs 9 Feb 2004 14:18:39 -0000 1.5 *************** *** 1,127 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Protocol.Tls; ! ! namespace Mono.Security.Cryptography ! { ! internal class MD5SHA1 : HashAlgorithm ! { ! #region Fields ! ! private HashAlgorithm md5; ! private HashAlgorithm sha; ! private bool hashing; ! ! #endregion ! ! #region Constructors ! ! public MD5SHA1() : base() ! { ! this.md5 = MD5.Create(); ! this.sha = SHA1.Create(); ! ! // Set HashSizeValue ! this.HashSizeValue = this.md5.HashSize + this.sha.HashSize; ! } ! ! #endregion ! ! #region Methods ! ! public override void Initialize() ! { ! this.md5.Initialize(); ! this.sha.Initialize(); ! this.hashing = false; ! } ! ! protected override byte[] HashFinal() ! { ! if (!hashing) ! { ! this.hashing = true; ! } ! // Finalize the original hash ! this.md5.TransformFinalBlock(new byte[0], 0, 0); ! this.sha.TransformFinalBlock(new byte[0], 0, 0); ! ! byte[] hash = new byte[36]; ! ! System.Array.Copy(this.md5.Hash, 0, hash, 0, 16); ! System.Array.Copy(this.sha.Hash, 0, hash, 16, 20); ! ! return hash; ! } ! ! protected override void HashCore( ! byte[] array, ! int ibStart, ! int cbSize) ! { ! if (!hashing) ! { ! hashing = true; ! } ! this.md5.TransformBlock(array, ibStart, cbSize, array, ibStart); ! this.sha.TransformBlock(array, ibStart, cbSize, array, ibStart); ! } ! ! public byte[] CreateSignature(RSA rsa) ! { ! if (rsa == null) ! { ! throw new CryptographicUnexpectedOperationException ("missing key"); ! } ! ! RSASslSignatureFormatter f = new RSASslSignatureFormatter(rsa); ! f.SetHashAlgorithm("MD5SHA1"); ! ! 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("MD5SHA1"); ! ! return d.VerifySignature(this.Hash, rgbSignature); ! } ! ! #endregion ! } ! } --- 1,127 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Protocol.Tls; ! ! namespace Mono.Security.Cryptography ! { ! internal class MD5SHA1 : HashAlgorithm ! { ! #region Fields ! ! private HashAlgorithm md5; ! private HashAlgorithm sha; ! private bool hashing; ! ! #endregion ! ! #region Constructors ! ! public MD5SHA1() : base() ! { ! this.md5 = MD5.Create(); ! this.sha = SHA1.Create(); ! ! // Set HashSizeValue ! this.HashSizeValue = this.md5.HashSize + this.sha.HashSize; ! } ! ! #endregion ! ! #region Methods ! ! public override void Initialize() ! { ! this.md5.Initialize(); ! this.sha.Initialize(); ! this.hashing = false; ! } ! ! protected override byte[] HashFinal() ! { ! if (!hashing) ! { ! this.hashing = true; ! } ! // Finalize the original hash ! this.md5.TransformFinalBlock(new byte[0], 0, 0); ! this.sha.TransformFinalBlock(new byte[0], 0, 0); ! ! byte[] hash = new byte[36]; ! ! System.Array.Copy(this.md5.Hash, 0, hash, 0, 16); ! System.Array.Copy(this.sha.Hash, 0, hash, 16, 20); ! ! return hash; ! } ! ! protected override void HashCore( ! byte[] array, ! int ibStart, ! int cbSize) ! { ! if (!hashing) ! { ! hashing = true; ! } ! this.md5.TransformBlock(array, ibStart, cbSize, array, ibStart); ! this.sha.TransformBlock(array, ibStart, cbSize, array, ibStart); ! } ! ! public byte[] CreateSignature(RSA rsa) ! { ! if (rsa == null) ! { ! throw new CryptographicUnexpectedOperationException ("missing key"); ! } ! ! RSASslSignatureFormatter f = new RSASslSignatureFormatter(rsa); ! f.SetHashAlgorithm("MD5SHA1"); ! ! 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("MD5SHA1"); ! ! return d.VerifySignature(this.Hash, rgbSignature); ! } ! ! #endregion ! } ! } |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12509 Modified Files: TlsAlert.cs TlsCloseNotifyAlert.cs TlsWarningAlertEventArgs.cs Log Message: Updated license headers Index: TlsAlert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsAlert.cs 14 Dec 2003 15:01:27 -0000 1.7 --- TlsAlert.cs 9 Feb 2004 14:18:23 -0000 1.8 *************** *** 1,276 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using Mono.Security.Protocol.Tls; ! ! namespace Mono.Security.Protocol.Tls.Alerts ! { ! #region Enumerations ! ! public enum TlsAlertLevel : byte ! { ! Warning = 1, ! Fatal = 2 ! } ! ! public enum TlsAlertDescription : byte ! { ! CloseNotify = 0, ! UnexpectedMessage = 10, ! BadRecordMAC = 20, ! DecryptionFailed = 21, ! RecordOverflow = 22, ! DecompressionFailiure = 30, ! HandshakeFailiure = 40, ! BadCertificate = 42, ! UnsupportedCertificate = 43, ! CertificateRevoked = 44, ! CertificateExpired = 45, ! CertificateUnknown = 46, ! IlegalParameter = 47, ! UnknownCA = 48, ! AccessDenied = 49, ! DecodeError = 50, ! DecryptError = 51, ! ExportRestriction = 60, ! ProtocolVersion = 70, ! InsuficientSecurity = 71, ! InternalError = 80, ! UserCancelled = 90, ! NoRenegotiation = 100 ! } ! ! #endregion ! ! internal abstract class TlsAlert : TlsStream ! { ! #region Fields ! ! private TlsContext context; ! private TlsAlertLevel level; ! private TlsAlertDescription description; ! ! #endregion ! ! #region Properties ! ! public TlsContext Context ! { ! get { return this.context; } ! } ! ! #endregion ! ! #region Constructors ! ! public TlsAlert(TlsContext context, ! TlsAlertLevel level, ! TlsAlertDescription description) : base() ! { ! this.context = context; ! this.level = level; ! this.description = description; ! ! this.fill(); ! } ! ! #endregion ! ! #region Abstract Methods ! ! public abstract void Update(); ! ! #endregion ! ! #region Constructors ! ! private void fill() ! { ! Write((byte)level); ! Write((byte)description); ! } ! ! #endregion ! ! #region Static Methods ! ! internal static string GetAlertMessage(TlsAlertDescription description) ! { ! #if (DEBUG) ! switch (description) ! { ! case TlsAlertDescription.AccessDenied: ! return "An inappropriate message was received."; ! ! case TlsAlertDescription.BadCertificate: ! return "TLSCiphertext decrypted in an invalid way."; ! ! case TlsAlertDescription.BadRecordMAC: ! return "Record with an incorrect MAC."; ! ! case TlsAlertDescription.CertificateExpired: ! return "Certificate has expired or is not currently valid"; ! ! case TlsAlertDescription.CertificateRevoked: ! return "Certificate was revoked by its signer."; ! ! case TlsAlertDescription.CertificateUnknown: ! return "Certificate Unknown."; ! ! case TlsAlertDescription.CloseNotify: ! return "Connection closed"; ! ! case TlsAlertDescription.DecodeError: ! return "A message could not be decoded because some field was out of the specified range or the length of the message was incorrect."; ! ! case TlsAlertDescription.DecompressionFailiure: ! return "The decompression function received improper input (e.g. data that would expand to excessive length)."; ! ! case TlsAlertDescription.DecryptError: ! return "TLSCiphertext decrypted in an invalid way: either it wasn`t an even multiple of the block length or its padding values, when checked, weren`t correct."; ! ! case TlsAlertDescription.DecryptionFailed: ! return "Handshake cryptographic operation failed, including being unable to correctly verify a signature, decrypt a key exchange, or validate finished message."; ! ! case TlsAlertDescription.ExportRestriction: ! return "Negotiation not in compliance with export restrictions was detected."; ! ! case TlsAlertDescription.HandshakeFailiure: ! return "Unable to negotiate an acceptable set of security parameters given the options available."; ! ! case TlsAlertDescription.IlegalParameter: ! return "A field in the handshake was out of range or inconsistent with other fields."; ! ! case TlsAlertDescription.InsuficientSecurity: ! return "Negotiation has failed specifically because the server requires ciphers more secure than those supported by the client."; ! ! case TlsAlertDescription.InternalError: ! return "Internal error unrelated to the peer or the correctness of the protocol makes it impossible to continue."; ! ! case TlsAlertDescription.NoRenegotiation: ! return "Invalid renegotiation."; ! ! case TlsAlertDescription.ProtocolVersion: ! return "Unsupported protocol version."; ! ! case TlsAlertDescription.RecordOverflow: ! return "Invalid length on TLSCiphertext record or TLSCompressed record."; ! ! case TlsAlertDescription.UnexpectedMessage: ! return "Invalid message received."; ! ! case TlsAlertDescription.UnknownCA: ! return "CA can't be identified as a trusted CA."; ! ! case TlsAlertDescription.UnsupportedCertificate: ! return "Certificate was of an unsupported type."; ! ! case TlsAlertDescription.UserCancelled: ! return "Handshake cancelled by user."; ! ! default: ! return ""; ! } ! #else ! switch (description) ! { ! case TlsAlertDescription.AccessDenied: ! return "Invalid message."; ! ! case TlsAlertDescription.BadCertificate: ! return "Handshake failiure."; ! ! case TlsAlertDescription.BadRecordMAC: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.CertificateExpired: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CertificateRevoked: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CertificateUnknown: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CloseNotify: ! return "Connection closed."; ! ! case TlsAlertDescription.DecodeError: ! return "Invalid message."; ! ! case TlsAlertDescription.DecompressionFailiure: ! return "Compression error."; ! ! case TlsAlertDescription.DecryptError: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.DecryptionFailed: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.ExportRestriction: ! return "Handshake failiure."; ! ! case TlsAlertDescription.HandshakeFailiure: ! return "Handshake failiure."; ! ! case TlsAlertDescription.IlegalParameter: ! return "Handshake failiure."; ! ! case TlsAlertDescription.InsuficientSecurity: ! return "Handshake failiure."; ! ! case TlsAlertDescription.InternalError: ! return "Fatal failiure."; ! ! case TlsAlertDescription.NoRenegotiation: ! return "Handshake failiure."; ! ! case TlsAlertDescription.ProtocolVersion: ! return "Handshake failiure."; ! ! case TlsAlertDescription.RecordOverflow: ! return "Incorrect message."; ! ! case TlsAlertDescription.UnexpectedMessage: ! return "Incorrect message."; ! ! case TlsAlertDescription.UnknownCA: ! return "Handshake failiure."; ! ! case TlsAlertDescription.UnsupportedCertificate: ! return "Handshake failiure."; ! ! case TlsAlertDescription.UserCancelled: ! return "Handshake cancelled by user."; ! ! default: ! return ""; ! } ! #endif ! } ! ! #endregion ! } ! } --- 1,276 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using Mono.Security.Protocol.Tls; ! ! namespace Mono.Security.Protocol.Tls.Alerts ! { ! #region Enumerations ! ! public enum TlsAlertLevel : byte ! { ! Warning = 1, ! Fatal = 2 ! } ! ! public enum TlsAlertDescription : byte ! { ! CloseNotify = 0, ! UnexpectedMessage = 10, ! BadRecordMAC = 20, ! DecryptionFailed = 21, ! RecordOverflow = 22, ! DecompressionFailiure = 30, ! HandshakeFailiure = 40, ! BadCertificate = 42, ! UnsupportedCertificate = 43, ! CertificateRevoked = 44, ! CertificateExpired = 45, ! CertificateUnknown = 46, ! IlegalParameter = 47, ! UnknownCA = 48, ! AccessDenied = 49, ! DecodeError = 50, ! DecryptError = 51, ! ExportRestriction = 60, ! ProtocolVersion = 70, ! InsuficientSecurity = 71, ! InternalError = 80, ! UserCancelled = 90, ! NoRenegotiation = 100 ! } ! ! #endregion ! ! internal abstract class TlsAlert : TlsStream ! { ! #region Fields ! ! private TlsContext context; ! private TlsAlertLevel level; ! private TlsAlertDescription description; ! ! #endregion ! ! #region Properties ! ! public TlsContext Context ! { ! get { return this.context; } ! } ! ! #endregion ! ! #region Constructors ! ! public TlsAlert(TlsContext context, ! TlsAlertLevel level, ! TlsAlertDescription description) : base() ! { ! this.context = context; ! this.level = level; ! this.description = description; ! ! this.fill(); ! } ! ! #endregion ! ! #region Abstract Methods ! ! public abstract void Update(); ! ! #endregion ! ! #region Constructors ! ! private void fill() ! { ! Write((byte)level); ! Write((byte)description); ! } ! ! #endregion ! ! #region Static Methods ! ! internal static string GetAlertMessage(TlsAlertDescription description) ! { ! #if (DEBUG) ! switch (description) ! { ! case TlsAlertDescription.AccessDenied: ! return "An inappropriate message was received."; ! ! case TlsAlertDescription.BadCertificate: ! return "TLSCiphertext decrypted in an invalid way."; ! ! case TlsAlertDescription.BadRecordMAC: ! return "Record with an incorrect MAC."; ! ! case TlsAlertDescription.CertificateExpired: ! return "Certificate has expired or is not currently valid"; ! ! case TlsAlertDescription.CertificateRevoked: ! return "Certificate was revoked by its signer."; ! ! case TlsAlertDescription.CertificateUnknown: ! return "Certificate Unknown."; ! ! case TlsAlertDescription.CloseNotify: ! return "Connection closed"; ! ! case TlsAlertDescription.DecodeError: ! return "A message could not be decoded because some field was out of the specified range or the length of the message was incorrect."; ! ! case TlsAlertDescription.DecompressionFailiure: ! return "The decompression function received improper input (e.g. data that would expand to excessive length)."; ! ! case TlsAlertDescription.DecryptError: ! return "TLSCiphertext decrypted in an invalid way: either it wasn`t an even multiple of the block length or its padding values, when checked, weren`t correct."; ! ! case TlsAlertDescription.DecryptionFailed: ! return "Handshake cryptographic operation failed, including being unable to correctly verify a signature, decrypt a key exchange, or validate finished message."; ! ! case TlsAlertDescription.ExportRestriction: ! return "Negotiation not in compliance with export restrictions was detected."; ! ! case TlsAlertDescription.HandshakeFailiure: ! return "Unable to negotiate an acceptable set of security parameters given the options available."; ! ! case TlsAlertDescription.IlegalParameter: ! return "A field in the handshake was out of range or inconsistent with other fields."; ! ! case TlsAlertDescription.InsuficientSecurity: ! return "Negotiation has failed specifically because the server requires ciphers more secure than those supported by the client."; ! ! case TlsAlertDescription.InternalError: ! return "Internal error unrelated to the peer or the correctness of the protocol makes it impossible to continue."; ! ! case TlsAlertDescription.NoRenegotiation: ! return "Invalid renegotiation."; ! ! case TlsAlertDescription.ProtocolVersion: ! return "Unsupported protocol version."; ! ! case TlsAlertDescription.RecordOverflow: ! return "Invalid length on TLSCiphertext record or TLSCompressed record."; ! ! case TlsAlertDescription.UnexpectedMessage: ! return "Invalid message received."; ! ! case TlsAlertDescription.UnknownCA: ! return "CA can't be identified as a trusted CA."; ! ! case TlsAlertDescription.UnsupportedCertificate: ! return "Certificate was of an unsupported type."; ! ! case TlsAlertDescription.UserCancelled: ! return "Handshake cancelled by user."; ! ! default: ! return ""; ! } ! #else ! switch (description) ! { ! case TlsAlertDescription.AccessDenied: ! return "Invalid message."; ! ! case TlsAlertDescription.BadCertificate: ! return "Handshake failiure."; ! ! case TlsAlertDescription.BadRecordMAC: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.CertificateExpired: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CertificateRevoked: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CertificateUnknown: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CloseNotify: ! return "Connection closed."; ! ! case TlsAlertDescription.DecodeError: ! return "Invalid message."; ! ! case TlsAlertDescription.DecompressionFailiure: ! return "Compression error."; ! ! case TlsAlertDescription.DecryptError: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.DecryptionFailed: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.ExportRestriction: ! return "Handshake failiure."; ! ! case TlsAlertDescription.HandshakeFailiure: ! return "Handshake failiure."; ! ! case TlsAlertDescription.IlegalParameter: ! return "Handshake failiure."; ! ! case TlsAlertDescription.InsuficientSecurity: ! return "Handshake failiure."; ! ! case TlsAlertDescription.InternalError: ! return "Fatal failiure."; ! ! case TlsAlertDescription.NoRenegotiation: ! return "Handshake failiure."; ! ! case TlsAlertDescription.ProtocolVersion: ! return "Handshake failiure."; ! ! case TlsAlertDescription.RecordOverflow: ! return "Incorrect message."; ! ! case TlsAlertDescription.UnexpectedMessage: ! return "Incorrect message."; ! ! case TlsAlertDescription.UnknownCA: ! return "Handshake failiure."; ! ! case TlsAlertDescription.UnsupportedCertificate: ! return "Handshake failiure."; ! ! case TlsAlertDescription.UserCancelled: ! return "Handshake cancelled by user."; ! ! default: ! return ""; ! } ! #endif ! } ! ! #endregion ! } ! } Index: TlsCloseNotifyAlert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsCloseNotifyAlert.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsCloseNotifyAlert.cs 23 Nov 2003 12:51:54 -0000 1.3 --- TlsCloseNotifyAlert.cs 9 Feb 2004 14:18:23 -0000 1.4 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: TlsWarningAlertEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsWarningAlertEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsWarningAlertEventArgs.cs 14 Dec 2003 15:01:27 -0000 1.2 --- TlsWarningAlertEventArgs.cs 9 Feb 2004 14:18:23 -0000 1.3 *************** *** 1,71 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Alerts ! { ! public delegate void TlsWarningAlertEventHandler(object sender, TlsWarningAlertEventArgs e); ! ! public sealed class TlsWarningAlertEventArgs ! { ! #region Fields ! ! private TlsAlertLevel level; ! private TlsAlertDescription description; ! private string message; ! ! #endregion ! ! #region Properties ! ! public TlsAlertLevel Level ! { ! get { return level; } ! } ! ! public TlsAlertDescription Description ! { ! get { return description; } ! } ! ! public string Message ! { ! get { return message; } ! } ! ! #endregion ! ! #region Constructors ! ! internal TlsWarningAlertEventArgs(TlsAlertLevel level, TlsAlertDescription description) ! { ! this.level = level; ! this.description = description; ! this.message = TlsAlert.GetAlertMessage(description); ! } ! ! #endregion ! } ! } --- 1,71 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Alerts ! { ! public delegate void TlsWarningAlertEventHandler(object sender, TlsWarningAlertEventArgs e); ! ! public sealed class TlsWarningAlertEventArgs ! { ! #region Fields ! ! private TlsAlertLevel level; ! private TlsAlertDescription description; ! private string message; ! ! #endregion ! ! #region Properties ! ! public TlsAlertLevel Level ! { ! get { return level; } ! } ! ! public TlsAlertDescription Description ! { ! get { return description; } ! } ! ! public string Message ! { ! get { return message; } ! } ! ! #endregion ! ! #region Constructors ! ! internal TlsWarningAlertEventArgs(TlsAlertLevel level, TlsAlertDescription description) ! { ! this.level = level; ! this.description = description; ! this.message = TlsAlert.GetAlertMessage(description); ! } ! ! #endregion ! } ! } |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13324 Modified Files: AssemblyInfo.cs PgCommand.cs PgCommandBuilder.cs PgConnection.cs PgConnectionPool.cs PgDataAdapter.cs PgDataReader.cs PgDbConnection.cs PgDbSchemaType.cs PgDbType.cs PgError.cs PgErrorCollection.cs PgException.cs PgInfoMessageEventArgs.cs PgNotificationEventArgs.cs PgParameter.cs PgParameterCollection.cs PgRowUpdatedEventArgs.cs PgRowUpdatingEventArgs.cs PgTransaction.cs Log Message: Updated license headers Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/AssemblyInfo.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AssemblyInfo.cs 2 Aug 2003 19:42:59 -0000 1.1.1.1 --- AssemblyInfo.cs 9 Feb 2004 14:19:22 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** PgCommand.cs 3 Jan 2004 15:41:38 -0000 1.25 --- PgCommand.cs 9 Feb 2004 14:19:22 -0000 1.26 *************** *** 1,851 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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 [...1675 lines suppressed...] ! for (int i = 0; i < matches.Count; i++) ! { ! if (matches[i].Value.Trim() != String.Empty) ! { ! this.commands[count] = matches[i].Value.Trim(); ! count++; ! } ! } ! } ! else ! { ! this.commands = new string[]{this.commandText}; ! } ! } ! } ! ! #endregion ! } } \ No newline at end of file Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PgCommandBuilder.cs 18 Dec 2003 10:27:32 -0000 1.15 --- PgCommandBuilder.cs 9 Feb 2004 14:19:22 -0000 1.16 *************** *** 1,781 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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 [...1533 lines suppressed...] ! e.Status = UpdateStatus.Continue; ! } ! } ! catch (Exception exception) ! { ! e.Errors = exception; ! e.Status = UpdateStatus.ErrorsOccurred; ! } ! finally ! { ! if (mustClose) ! { ! dataAdapter.SelectCommand.Connection.Close(); ! } ! } ! } ! ! #endregion ! } ! } Index: PgConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PgConnection.cs 18 Dec 2003 10:27:32 -0000 1.11 --- PgConnection.cs 9 Feb 2004 14:19:22 -0000 1.12 *************** *** 1,659 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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 [...1289 lines suppressed...] ! X509CertificateCollection clientCertificates, ! X509Certificate serverCertificate, ! string targetHost, ! X509CertificateCollection serverRequestedCertificates) ! { ! if (this.ClientCertSelection != null) ! { ! return this.ClientCertSelection( ! clientCertificates, ! serverCertificate, ! targetHost, ! serverRequestedCertificates); ! } ! ! return null; ! } ! ! #endregion ! } ! } Index: PgConnectionPool.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnectionPool.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgConnectionPool.cs 19 Dec 2003 11:51:23 -0000 1.3 --- PgConnectionPool.cs 9 Feb 2004 14:19:22 -0000 1.4 *************** *** 1,238 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Collections; ! using System.Threading; ! using PostgreSql.Data.NPgClient; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! internal class PgConnectionPool : MarshalByRefObject ! { ! #region Fields ! ! private static PgPoolManager pool = null; ! ! #endregion ! ! #region Methods ! ! public static void Initialize() ! { ! if (pool == null) ! { ! pool = new PgPoolManager(); ! } ! } ! ! public static PgDbConnection GetConnection(string connectionString) ! { ! Initialize(); ! ! return ((PgDbConnection)pool.CheckOut(connectionString)); ! } ! ! public static void FreeConnection(PgDbConnection c) ! { ! pool.CheckIn(c); ! } ! ! #endregion ! } ! ! internal class PgPoolManager ! { ! #region Fields ! ! private ArrayList locked; ! private ArrayList unlocked; ! private Thread cleanUpThread; ! ! #endregion ! ! #region Constructors ! ! public PgPoolManager() ! { ! locked = ArrayList.Synchronized(new ArrayList()); ! unlocked = ArrayList.Synchronized(new ArrayList()); ! ! cleanUpThread = new Thread(new ThreadStart(RunCleanUp)); ! cleanUpThread.Name = "CleanUp Thread"; ! cleanUpThread.Start(); ! cleanUpThread.IsBackground = true; ! } ! ! #endregion ! ! #region Methods ! ! public PgDbConnection CheckOut(string connectionString) ! { ! PgDbConnection newConnection = null; ! long now = System.DateTime.Now.Ticks; ! ! lock (typeof(PgConnectionPool)) ! { ! if (unlocked.Count > 0) ! { ! PgDbConnection[] list = new PgDbConnection[unlocked.Count]; ! unlocked.CopyTo(0, list, 0, list.Length); ! ! foreach(PgDbConnection connection in list) ! { ! if (Validate(connection, connectionString)) ! { ! if (connection.Lifetime != 0) ! { ! if ((now - connection.Created) > connection.Lifetime) ! { ! unlocked.Remove(connection); ! Expire(connection); ! } ! else ! { ! unlocked.Remove(connection); ! locked.Add(connection); ! ! return(connection); ! } ! } ! else ! { ! unlocked.Remove(connection); ! locked.Add(connection); ! ! return(connection); ! } ! } ! else ! { ! unlocked.Remove(connection); ! Expire(connection); ! } ! } ! } ! ! newConnection = Create(connectionString); ! newConnection.Created = System.DateTime.Now.Ticks; ! ! locked.Add(newConnection); ! } ! ! return(newConnection); ! } ! ! public void CheckIn(PgDbConnection connection) ! { ! lock (typeof(PgDbConnection)) ! { ! connection.Created = System.DateTime.Now.Ticks; ! ! locked.Remove(connection); ! unlocked.Add(connection); ! } ! } ! ! private void RunCleanUp() ! { ! TimeSpan interval = new TimeSpan(0, 0, 10); ! ! while (true) ! { ! CleanUp(null); ! ! Thread.Sleep(interval); ! } ! } ! ! private PgDbConnection Create(string connectionString) ! { ! try ! { ! PgDbConnection connection = new PgDbConnection(connectionString); ! connection.Connect(); ! connection.Pooled = true; ! ! return connection; ! } ! catch (PgClientException ex) ! { ! throw ex; ! } ! } ! ! private bool Validate(PgDbConnection connection, string connectionString) ! { ! try ! { ! return (connection.ConnectionString == connectionString && ! connection.VerifyConnection()); ! } ! catch (Exception ex) ! { ! throw ex; ! } ! } ! ! private void Expire(PgDbConnection connection) ! { ! try ! { ! if (connection.VerifyConnection()) ! { ! connection.Disconnect(); ! } ! } ! catch (Exception) ! { ! throw new PgException("Error closing database connection."); ! } ! } ! ! private void CleanUp(object State) ! { ! long now = System.DateTime.Now.Ticks; ! ! lock (unlocked.SyncRoot) ! { ! if (unlocked.Count > 0) ! { ! PgDbConnection[] list = new PgDbConnection[unlocked.Count]; ! ! unlocked.CopyTo(0, list, 0, list.Length); ! foreach (PgDbConnection connection in list) ! { ! if (connection.Lifetime != 0) ! { ! if ((now - connection.Created) >= connection.Lifetime) ! { ! unlocked.Remove(connection); ! Expire(connection); ! } ! } ! } ! } ! } ! } ! ! #endregion ! } ! } --- 1,238 ---- ! /* 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.Collections; ! using System.Threading; ! using PostgreSql.Data.NPgClient; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! internal class PgConnectionPool : MarshalByRefObject ! { ! #region Fields ! ! private static PgPoolManager pool = null; ! ! #endregion ! ! #region Methods ! ! public static void Initialize() ! { ! if (pool == null) ! { ! pool = new PgPoolManager(); ! } ! } ! ! public static PgDbConnection GetConnection(string connectionString) ! { ! Initialize(); ! ! return ((PgDbConnection)pool.CheckOut(connectionString)); ! } ! ! public static void FreeConnection(PgDbConnection c) ! { ! pool.CheckIn(c); ! } ! ! #endregion ! } ! ! internal class PgPoolManager ! { ! #region Fields ! ! private ArrayList locked; ! private ArrayList unlocked; ! private Thread cleanUpThread; ! ! #endregion ! ! #region Constructors ! ! public PgPoolManager() ! { ! locked = ArrayList.Synchronized(new ArrayList()); ! unlocked = ArrayList.Synchronized(new ArrayList()); ! ! cleanUpThread = new Thread(new ThreadStart(RunCleanUp)); ! cleanUpThread.Name = "CleanUp Thread"; ! cleanUpThread.Start(); ! cleanUpThread.IsBackground = true; ! } ! ! #endregion ! ! #region Methods ! ! public PgDbConnection CheckOut(string connectionString) ! { ! PgDbConnection newConnection = null; ! long now = System.DateTime.Now.Ticks; ! ! lock (typeof(PgConnectionPool)) ! { ! if (unlocked.Count > 0) ! { ! PgDbConnection[] list = new PgDbConnection[unlocked.Count]; ! unlocked.CopyTo(0, list, 0, list.Length); ! ! foreach(PgDbConnection connection in list) ! { ! if (Validate(connection, connectionString)) ! { ! if (connection.Lifetime != 0) ! { ! if ((now - connection.Created) > connection.Lifetime) ! { ! unlocked.Remove(connection); ! Expire(connection); ! } ! else ! { ! unlocked.Remove(connection); ! locked.Add(connection); ! ! return(connection); ! } ! } ! else ! { ! unlocked.Remove(connection); ! locked.Add(connection); ! ! return(connection); ! } ! } ! else ! { ! unlocked.Remove(connection); ! Expire(connection); ! } ! } ! } ! ! newConnection = Create(connectionString); ! newConnection.Created = System.DateTime.Now.Ticks; ! ! locked.Add(newConnection); ! } ! ! return(newConnection); ! } ! ! public void CheckIn(PgDbConnection connection) ! { ! lock (typeof(PgDbConnection)) ! { ! connection.Created = System.DateTime.Now.Ticks; ! ! locked.Remove(connection); ! unlocked.Add(connection); ! } ! } ! ! private void RunCleanUp() ! { ! TimeSpan interval = new TimeSpan(0, 0, 10); ! ! while (true) ! { ! CleanUp(null); ! ! Thread.Sleep(interval); ! } ! } ! ! private PgDbConnection Create(string connectionString) ! { ! try ! { ! PgDbConnection connection = new PgDbConnection(connectionString); ! connection.Connect(); ! connection.Pooled = true; ! ! return connection; ! } ! catch (PgClientException ex) ! { ! throw ex; ! } ! } ! ! private bool Validate(PgDbConnection connection, string connectionString) ! { ! try ! { ! return (connection.ConnectionString == connectionString && ! connection.VerifyConnection()); ! } ! catch (Exception ex) ! { ! throw ex; ! } ! } ! ! private void Expire(PgDbConnection connection) ! { ! try ! { ! if (connection.VerifyConnection()) ! { ! connection.Disconnect(); ! } ! } ! catch (Exception) ! { ! throw new PgException("Error closing database connection."); ! } ! } ! ! private void CleanUp(object State) ! { ! long now = System.DateTime.Now.Ticks; ! ! lock (unlocked.SyncRoot) ! { ! if (unlocked.Count > 0) ! { ! PgDbConnection[] list = new PgDbConnection[unlocked.Count]; ! ! unlocked.CopyTo(0, list, 0, list.Length); ! foreach (PgDbConnection connection in list) ! { ! if (connection.Lifetime != 0) ! { ! if ((now - connection.Created) >= connection.Lifetime) ! { ! unlocked.Remove(connection); ! Expire(connection); ! } ! } ! } ! } ! } ! } ! ! #endregion ! } ! } Index: PgDataAdapter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataAdapter.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgDataAdapter.cs 18 Dec 2003 10:27:32 -0000 1.5 --- PgDataAdapter.cs 9 Feb 2004 14:19:22 -0000 1.6 *************** *** 1,223 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Drawing; ! using System.Data.Common; ! using System.ComponentModel; ! using System.ComponentModel.Design; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! #region DELEGATES ! ! public delegate void PgRowUpdatedEventHandler(object sender, PgRowUpdatedEventArgs e); ! public delegate void PgRowUpdatingEventHandler(object sender, PgRowUpdatingEventArgs e); ! ! #endregion ! ! [ToolboxItem(true), ! ToolboxBitmap(typeof(PgDataAdapter), "Resources.ToolBox.PgDataAdapter.bmp"), ! DefaultEvent("RowUpdated")] ! public sealed class PgDataAdapter : DbDataAdapter, IDbDataAdapter ! { ! #region Events ! ! private static readonly object EventRowUpdated = new object(); ! private static readonly object EventRowUpdating = new object(); ! ! #endregion ! ! #region Fields ! ! private PgCommand selectCommand; ! private PgCommand insertCommand; ! private PgCommand updateCommand; ! private PgCommand deleteCommand; ! private bool disposed; ! ! #endregion ! ! #region Properties ! ! IDbCommand IDbDataAdapter.SelectCommand ! { ! get { return selectCommand; } ! set { selectCommand = (PgCommand)value; } ! } ! ! IDbCommand IDbDataAdapter.InsertCommand ! { ! get { return insertCommand; } ! set { insertCommand = (PgCommand)value; } ! } ! ! IDbCommand IDbDataAdapter.UpdateCommand ! { ! get { return updateCommand; } ! set { updateCommand = (PgCommand)value; } ! } ! ! IDbCommand IDbDataAdapter.DeleteCommand ! { ! get { return deleteCommand; } ! set { deleteCommand = (PgCommand)value; } ! } ! ! [Category("DataCategory_Update"), DefaultValue(null)] ! public PgCommand SelectCommand ! { ! get { return selectCommand; } ! set { selectCommand = value; } ! } ! ! [Category("DataCategory_Update"), DefaultValue(null)] ! public PgCommand InsertCommand ! { ! get { return insertCommand; } ! set { insertCommand = value; } ! } ! ! [Category("DataCategory_Fill"), DefaultValue(null)] ! public PgCommand UpdateCommand ! { ! get { return updateCommand; } ! set { updateCommand = value; } ! } ! ! [Category("DataCategory_Update"), DefaultValue(null)] ! public PgCommand DeleteCommand ! { ! get { return deleteCommand; } ! set { deleteCommand = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgDataAdapter() : base() ! { ! GC.SuppressFinalize(this); ! } ! ! public PgDataAdapter(PgCommand selectCommand) : this() ! { ! this.selectCommand = selectCommand; ! } ! ! public PgDataAdapter(string commandText, PgConnection connection) : this() ! { ! this.selectCommand = new PgCommand(commandText, connection); ! } ! ! public PgDataAdapter(string commandText, string connectionString) : this() ! { ! this.selectCommand = new PgCommand(commandText, new PgConnection(connectionString)); ! } ! ! #endregion ! ! #region IDisposable Methods ! ! protected override void Dispose(bool disposing) ! { ! if (!disposed) ! { ! try ! { ! if (disposing) ! { ! if (selectCommand != null) ! { ! selectCommand.Dispose(); ! } ! if (insertCommand != null) ! { ! insertCommand.Dispose(); ! } ! if (updateCommand != null) ! { ! updateCommand.Dispose(); ! } ! } ! ! // release any unmanaged resources ! ! disposed = true; ! } ! finally ! { ! base.Dispose(disposing); ! } ! } ! } ! ! #endregion ! ! #region Methods ! ! public event PgRowUpdatedEventHandler RowUpdated ! { ! add { Events.AddHandler(EventRowUpdated, value); } ! remove { Events.RemoveHandler(EventRowUpdated, value); } ! } ! ! [Category("DataCategory_Update")] ! public event PgRowUpdatingEventHandler RowUpdating ! { ! add { Events.AddHandler(EventRowUpdating, value); } ! remove { Events.RemoveHandler(EventRowUpdating, value); } ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) ! { ! return new PgRowUpdatedEventArgs(dataRow, command, statementType, tableMapping); ! } ! ! protected override void OnRowUpdated(RowUpdatedEventArgs value) ! { ! PgRowUpdatedEventHandler handler = (PgRowUpdatedEventHandler) Events[EventRowUpdated]; ! if ((null != handler) && (value is PgRowUpdatedEventArgs)) ! { ! handler(this, (PgRowUpdatedEventArgs) value); ! } ! } ! ! protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) ! { ! return new PgRowUpdatingEventArgs(dataRow, command, statementType, tableMapping); ! } ! ! protected override void OnRowUpdating(RowUpdatingEventArgs value) ! { ! PgRowUpdatingEventHandler handler = (PgRowUpdatingEventHandler) Events[EventRowUpdating]; ! if ((null != handler) && (value is PgRowUpdatingEventArgs)) ! { ! handler(this, (PgRowUpdatingEventArgs) value); ! } ! } ! ! #endregion ! } ! } --- 1,223 ---- ! /* 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.Drawing; ! using System.Data.Common; ! using System.ComponentModel; ! using System.ComponentModel.Design; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! #region DELEGATES ! ! public delegate void PgRowUpdatedEventHandler(object sender, PgRowUpdatedEventArgs e); ! public delegate void PgRowUpdatingEventHandler(object sender, PgRowUpdatingEventArgs e); ! ! #endregion ! ! [ToolboxItem(true), ! ToolboxBitmap(typeof(PgDataAdapter), "Resources.ToolBox.PgDataAdapter.bmp"), ! DefaultEvent("RowUpdated")] ! public sealed class PgDataAdapter : DbDataAdapter, IDbDataAdapter ! { ! #region Events ! ! private static readonly object EventRowUpdated = new object(); ! private static readonly object EventRowUpdating = new object(); ! ! #endregion ! ! #region Fields ! ! private PgCommand selectCommand; ! private PgCommand insertCommand; ! private PgCommand updateCommand; ! private PgCommand deleteCommand; ! private bool disposed; ! ! #endregion ! ! #region Properties ! ! IDbCommand IDbDataAdapter.SelectCommand ! { ! get { return selectCommand; } ! set { selectCommand = (PgCommand)value; } ! } ! ! IDbCommand IDbDataAdapter.InsertCommand ! { ! get { return insertCommand; } ! set { insertCommand = (PgCommand)value; } ! } ! ! IDbCommand IDbDataAdapter.UpdateCommand ! { ! get { return updateCommand; } ! set { updateCommand = (PgCommand)value; } ! } ! ! IDbCommand IDbDataAdapter.DeleteCommand ! { ! get { return deleteCommand; } ! set { deleteCommand = (PgCommand)value; } ! } ! ! [Category("DataCategory_Update"), DefaultValue(null)] ! public PgCommand SelectCommand ! { ! get { return selectCommand; } ! set { selectCommand = value; } ! } ! ! [Category("DataCategory_Update"), DefaultValue(null)] ! public PgCommand InsertCommand ! { ! get { return insertCommand; } ! set { insertCommand = value; } ! } ! ! [Category("DataCategory_Fill"), DefaultValue(null)] ! public PgCommand UpdateCommand ! { ! get { return updateCommand; } ! set { updateCommand = value; } ! } ! ! [Category("DataCategory_Update"), DefaultValue(null)] ! public PgCommand DeleteCommand ! { ! get { return deleteCommand; } ! set { deleteCommand = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgDataAdapter() : base() ! { ! GC.SuppressFinalize(this); ! } ! ! public PgDataAdapter(PgCommand selectCommand) : this() ! { ! this.selectCommand = selectCommand; ! } ! ! public PgDataAdapter(string commandText, PgConnection connection) : this() ! { ! this.selectCommand = new PgCommand(commandText, connection); ! } ! ! public PgDataAdapter(string commandText, string connectionString) : this() ! { ! this.selectCommand = new PgCommand(commandText, new PgConnection(connectionString)); ! } ! ! #endregion ! ! #region IDisposable Methods ! ! protected override void Dispose(bool disposing) ! { ! if (!disposed) ! { ! try ! { ! if (disposing) ! { ! if (selectCommand != null) ! { ! selectCommand.Dispose(); ! } ! if (insertCommand != null) ! { ! insertCommand.Dispose(); ! } ! if (updateCommand != null) ! { ! updateCommand.Dispose(); ! } ! } ! ! // release any unmanaged resources ! ! disposed = true; ! } ! finally ! { ! base.Dispose(disposing); ! } ! } ! } ! ! #endregion ! ! #region Methods ! ! public event PgRowUpdatedEventHandler RowUpdated ! { ! add { Events.AddHandler(EventRowUpdated, value); } ! remove { Events.RemoveHandler(EventRowUpdated, value); } ! } ! ! [Category("DataCategory_Update")] ! public event PgRowUpdatingEventHandler RowUpdating ! { ! add { Events.AddHandler(EventRowUpdating, value); } ! remove { Events.RemoveHandler(EventRowUpdating, value); } ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) ! { ! return new PgRowUpdatedEventArgs(dataRow, command, statementType, tableMapping); ! } ! ! protected override void OnRowUpdated(RowUpdatedEventArgs value) ! { ! PgRowUpdatedEventHandler handler = (PgRowUpdatedEventHandler) Events[EventRowUpdated]; ! if ((null != handler) && (value is PgRowUpdatedEventArgs)) ! { ! handler(this, (PgRowUpdatedEventArgs) value); ! } ! } ! ! protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) ! { ! return new PgRowUpdatingEventArgs(dataRow, command, statementType, tableMapping); ! } ! ! protected override void OnRowUpdating(RowUpdatingEventArgs value) ! { ! PgRowUpdatingEventHandler handler = (PgRowUpdatingEventHandler) Events[EventRowUpdating]; ! if ((null != handler) && (value is PgRowUpdatingEventArgs)) ! { ! handler(this, (PgRowUpdatingEventArgs) value); ! } ! } ! ! #endregion ! } ! } Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PgDataReader.cs 18 Dec 2003 10:27:32 -0000 1.16 --- PgDataReader.cs 9 Feb 2004 14:19:22 -0000 1.17 *************** *** 1,843 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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 [...1659 lines suppressed...] ! } ! } ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } } \ No newline at end of file Index: PgDbConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbConnection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgDbConnection.cs 19 Dec 2003 11:51:23 -0000 1.5 --- PgDbConnection.cs 9 Feb 2004 14:19:22 -0000 1.6 *************** *** 1,220 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Text; ! using System.Collections; ! using System.Text.RegularExpressions; ! ! using PostgreSql.Data.NPgClient; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! internal sealed class PgDbConnection : MarshalByRefObject ! { ! #region Fields ! ! private PgDbClient db; ! private string connectionString; ! private PgConnectionParams settings; ! private long created; ! private long lifetime; ! private bool pooled; ! private Regex search; ! ! #endregion ! ! #region Properties ! ! public PgDbClient DB ! { ! get { return db; } ! } ! ! public string ConnectionString ! { ! get { return connectionString; } ! } ! ! public long Lifetime ! { ! get { return lifetime; } ! } ! public long Created ! { ! get { return created; } ! set { created = value; } ! } ! ! public bool Pooled ! { ! get { return pooled; } ! set { pooled = value; } ! } ! ! public PgConnectionParams Settings ! { ! get { return settings; } ! } ! ! #endregion ! ! #region Constructors ! ! private PgDbConnection() ! { ! settings = new PgConnectionParams(); ! search = new Regex(@"([\w\s\d]*)\s*=\s*([^;]*)"); ! ! connectionString = String.Empty; ! lifetime = 0; ! created = 0; ! pooled = true; ! } ! ! public PgDbConnection(string connectionString) : this() ! { ! this.connectionString = connectionString; ! parseConnectionString(); ! } ! ! #endregion ! ! #region Methods ! ! public void Connect() ! { ! try ! { ! db = new PgDbClient(settings); ! db.Connect(); ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } ! } ! ! public void Disconnect() ! { ! try ! { ! db.Disconnect(); ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } ! } ! ! private void parseConnectionString() ! { ! MatchCollection elements = search.Matches(connectionString); ! ! foreach (Match element in elements) ! { ! if (element.Groups[2].Value.Trim().Length > 0) ! { ! switch (element.Groups[1].Value.Trim().ToLower()) ! { ! case "datasource": ! case "server": ! case "host": ! settings.ServerName = element.Groups[2].Value.Trim(); ! break; ! ! case "database": ! settings.Database = element.Groups[2].Value.Trim(); ! break; ! ! case "user name": ! case "user": ! settings.UserName = element.Groups[2].Value.Trim(); ! break; ! ! case "user password": ! case "password": ! settings.UserPassword = element.Groups[2].Value.Trim(); ! break; ! ! case "port": ! settings.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "connection lifetime": ! lifetime = Int32.Parse(element.Groups[2].Value.Trim()); ! lifetime *= TimeSpan.TicksPerSecond; ! break; ! ! case "timeout": ! case "connection timeout": ! settings.Timeout = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "packet size": ! settings.PacketSize = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "pooling": ! settings.Pooling = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "ssl": ! settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! } ! } ! } ! ! if (settings.UserName == String.Empty || settings.ServerName == String.Empty || settings.ServerPort == 0) ! { ! throw new ArgumentException("An invalid connection string argument has been supplied or a required connection string argument has not been supplied."); ! } ! else ! { ! if (settings.PacketSize < 512 || settings.PacketSize > 32767) ! { ! StringBuilder msg = new StringBuilder(); ! ! msg.AppendFormat("'Packet Size' value of {0} is not valid.\r\nThe value should be an integer >= 512 and <= 32767.", settings.PacketSize); ! ! throw new ArgumentException(msg.ToString()); ! } ! } ! } ! ! internal bool VerifyConnection() ! { ! bool isValid = true; ! ! try ! { ! // Try to send a Sync message to the PostgreSQL Server ! this.db.Sync(); ! } ! catch (Exception) ! { ! isValid = false; ! } ! ! return isValid; ! } ! ! #endregion ! } } \ No newline at end of file --- 1,220 ---- ! /* 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.Text; ! using System.Collections; ! using System.Text.RegularExpressions; ! ! using PostgreSql.Data.NPgClient; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! internal sealed class PgDbConnection : MarshalByRefObject ! { ! #region Fields ! ! private PgDbClient db; ! private string connectionString; ! private PgConnectionParams settings; ! private long created; ! private long lifetime; ! private bool pooled; ! private Regex search; ! ! #endregion ! ! #region Properties ! ! public PgDbClient DB ! { ! get { return db; } ! } ! ! public string ConnectionString ! { ! get { return connectionString; } ! } ! ! public long Lifetime ! { ! get { return lifetime; } ! } ! public long Created ! { ! get { return created; } ! set { created = value; } ! } ! ! public bool Pooled ! { ! get { return pooled; } ! set { pooled = value; } ! } ! ! public PgConnectionParams Settings ! { ! get { return settings; } ! } ! ! #endregion ! ! #region Constructors ! ! private PgDbConnection() ! { ! settings = new PgConnectionParams(); ! search = new Regex(@"([\w\s\d]*)\s*=\s*([^;]*)"); ! ! connectionString = String.Empty; ! lifetime = 0; ! created = 0; ! pooled = true; ! } ! ! public PgDbConnection(string connectionString) : this() ! { ! this.connectionString = connectionString; ! parseConnectionString(); ! } ! ! #endregion ! ! #region Methods ! ! public void Connect() ! { ! try ! { ! db = new PgDbClient(settings); ! db.Connect(); ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } ! } ! ! public void Disconnect() ! { ! try ! { ! db.Disconnect(); ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } ! } ! ! private void parseConnectionString() ! { ! MatchCollection elements = search.Matches(connectionString); ! ! foreach (Match element in elements) ! { ! if (element.Groups[2].Value.Trim().Length > 0) ! { ! switch (element.Groups[1].Value.Trim().ToLower()) ! { ! case "datasource": ! case "server": ! case "host": ! settings.ServerName = element.Groups[2].Value.Trim(); ! break; ! ! case "database": ! settings.Database = element.Groups[2].Value.Trim(); ! break; ! ! case "user name": ! case "user": ! settings.UserName = element.Groups[2].Value.Trim(); ! break; ! ! case "user password": ! case "password": ! settings.UserPassword = element.Groups[2].Value.Trim(); ! break; ! ! case "port": ! settings.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "connection lifetime": ! lifetime = Int32.Parse(element.Groups[2].Value.Trim()); ! lifetime *= TimeSpan.TicksPerSecond; ! break; ! ! case "timeout": ! case "connection timeout": ! settings.Timeout = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "packet size": ! settings.PacketSize = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "pooling": ! settings.Pooling = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! ! case "ssl": ! settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! } ! } ! } ! ! if (settings.UserName == String.Empty || settings.ServerName == String.Empty || settings.ServerPort == 0) ! { ! throw new ArgumentException("An invalid connection string argument has been supplied or a required connection string argument has not been supplied."); ! } ! else ! { ! if (settings.PacketSize < 512 || settings.PacketSize > 32767) ! { ! StringBuilder msg = new StringBuilder(); ! ! msg.AppendFormat("'Packet Size' value of {0} is not valid.\r\nThe value should be an integer >= 512 and <= 32767.", settings.PacketSize); ! ! throw new ArgumentException(msg.ToString()); ! } ! } ! } ! ! internal bool VerifyConnection() ! { ! bool isValid = true; ! ! try ! { ! // Try to send a Sync message to the PostgreSQL Server ! this.db.Sync(); ! } ! catch (Exception) ! { ! isValid = false; ! } ! ! return isValid; ! } ! ! #endregion ! } } \ No newline at end of file Index: PgDbSchemaType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbSchemaType.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgDbSchemaType.cs 2 Aug 2003 19:43:01 -0000 1.1.1.1 --- PgDbSchemaType.cs 9 Feb 2004 14:19:22 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgDbType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgDbType.cs 26 Oct 2003 11:31:59 -0000 1.5 --- PgDbType.cs 9 Feb 2004 14:19:22 -0000 1.6 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgError.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgError.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgError.cs 14 Dec 2003 15:06:50 -0000 1.2 --- PgError.cs 9 Feb 2004 14:19:22 -0000 1.3 *************** *** 1,125 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! [Serializable] ! public sealed class PgError ! { ! #region Fields ! ! private string severity; ! private string code; ! private string message; ! private string detail; ! private string hint; ! private string where; ! private string position; ! private string file; ! private int line; ! private string routine; ! ! #endregion ! ! #region Properties ! ! public string Severity ! { ! get { return severity; } ! set { severity = value; } ! } ! ! public string Message ! { ! get { return message; } ! set { message = value; } ! } ! ! public string Code ! { ! get { return code; } ! set { code = value; } ! } ! ! public string Detail ! { ! get { return detail; } ! set { detail = value; } ! } ! ! public string Hint ! { ! get { return hint; } ! set { hint = value; } ! } ! ! public string Where ! { ! get { return where; } ! set { where = value; } ! } ! ! public string Position ! { ! get { return position; } ! set { position = value; } ! } ! ! public string File ! { ! get { return file; } ! set { file = value; } ! } ! ! public int Line ! { ! get { return line; } ! set { line = value; } ! } ! ! public string Routine ! { ! get { return routine; } ! set { routine = value; } ! } ! ! #endregion ! ! #region Constructors ! ! internal PgError() ! { ! } ! ! internal PgError(string message) ! { ! this.message = message; ! } ! ! internal PgError(string severity, string code, string message) ! { ! this.severity = severity; ! this.code = code; ! this.message = message; ! } ! ! #endregion ! } ! } --- 1,125 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! [Serializable] ! public sealed class PgError ! { ! #region Fields ! ! private string severity; ! private string code; ! private string message; ! private string detail; ! private string hint; ! private string where; ! private string position; ! private string file; ! private int line; ! private string routine; ! ! #endregion ! ! #region Properties ! ! public string Severity ! { ! get { return severity; } ! set { severity = value; } ! } ! ! public string Message ! { ! get { return message; } ! set { message = value; } ! } ! ! public string Code ! { ! get { return code; } ! set { code = value; } ! } ! ! public string Detail ! { ! get { return detail; } ! set { detail = value; } ! } ! ! public string Hint ! { ! get { return hint; } ! set { hint = value; } ! } ! ! public string Where ! { ! get { return where; } ! set { where = value; } ! } ! ! public string Position ! { ! get { return position; } ! set { position = value; } ! } ! ! public string File ! { ! get { return file; } ! set { file = value; } ! } ! ! public int Line ! { ! get { return line; } ! set { line = value; } ! } ! ! public string Routine ! { ! get { return routine; } ! set { routine = value; } ! } ! ! #endregion ! ! #region Constructors ! ! internal PgError() ! { ! } ! ! internal PgError(string message) ! { ! this.message = message; ! } ! ! internal PgError(string severity, string code, string message) ! { ! this.severity = severity; ! this.code = code; ! this.message = message; ! } ! ! #endregion ! } ! } Index: PgErrorCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgErrorCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgErrorCollection.cs 14 Dec 2003 15:06:50 -0000 1.3 --- PgErrorCollection.cs 9 Feb 2004 14:19:22 -0000 1.4 *************** *** 1,116 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Collections; ! using System.ComponentModel; ! using System.Globalization; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! [Serializable, ! ListBindable(false)] ! public sealed class PgErrorCollection : ICollection, IEnumerable ! { ! #region Fields ! ! private ArrayList errors; ! ! #endregion ! ! #region Properties ! ! public PgError this[string errorMessage] ! { ! get { return (PgError)errors[errors.IndexOf(errorMessage)]; } ! set { errors[errors.IndexOf(errorMessage)] = (PgError)value; } ! } ! ! public PgError this[int errorIndex] ! { ! get { return (PgError)errors[errorIndex]; } ! set { errors[errorIndex] = (PgError)value; } ! } ! ! public int Count ! { ! get { return errors.Count; } ! } ! ! public bool IsSynchronized ! { ! get { return errors.IsSynchronized; } ! } ! ! public object SyncRoot ! { ! get { return errors.SyncRoot; } ! } ! ! #endregion ! ! #region constructors ! ! internal PgErrorCollection() ! { ! errors = new ArrayList(); ! } ! ! #endregion ! ! #region Methods ! ! public IEnumerator GetEnumerator() ! { ! return errors.GetEnumerator(); ! } ! ! public void CopyTo(Array array, int index) ! { ! errors.CopyTo(array, index); ! } ! ! internal PgError Add(PgError error) ! { ! errors.Add(error); ! ! return error; ! } ! ! internal PgError Add(string severity, string message, string code) ! { ! PgError error = new PgError(severity, code, message); ! ! return Add(error); ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } --- 1,116 ---- ! /* 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.Collections; ! using System.ComponentModel; ! using System.Globalization; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! [Serializable, ! ListBindable(false)] ! public sealed class PgErrorCollection : ICollection, IEnumerable ! { ! #region Fields ! ! private ArrayList errors; ! ! #endregion ! ! #region Properties ! ! public PgError this[string errorMessage] ! { ! get { return (PgError)errors[errors.IndexOf(errorMessage)]; } ! set { errors[errors.IndexOf(errorMessage)] = (PgError)value; } ! } ! ! public PgError this[int errorIndex] ! { ! get { return (PgError)errors[errorIndex]; } ! set { errors[errorIndex] = (PgError)value; } ! } ! ! public int Count ! { ! get { return errors.Count; } ! } ! ! public bool IsSynchronized ! { ! get { return errors.IsSynchronized; } ! } ! ! public object SyncRoot ! { ! get { return errors.SyncRoot; } ! } ! ! #endregion ! ! #region constructors ! ! internal PgErrorCollection() ! { ! errors = new ArrayList(); ! } ! ! #endregion ! ! #region Methods ! ! public IEnumerator GetEnumerator() ! { ! return errors.GetEnumerator(); ! } ! ! public void CopyTo(Array array, int index) ! { ! errors.CopyTo(array, index); ! } ! ! internal PgError Add(PgError error) ! { ! errors.Add(error); ! ! return error; ! } ! ! internal PgError Add(string severity, string message, string code) ! { ! PgError error = new PgError(severity, code, message); ! ! return Add(error); ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } Index: PgException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgException.cs 14 Dec 2003 15:06:50 -0000 1.2 --- PgException.cs 9 Feb 2004 14:19:22 -0000 1.3 *************** *** 1,97 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Text; ! using System.ComponentModel; ! using System.Runtime.Serialization; ! using PostgreSql.Data.NPgClient; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! [Serializable] ! public class PgException : Exception ! { ! #region Fields ! ! private PgErrorCollection errors; ! ! #endregion ! ! #region Properties ! ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] ! public PgErrorCollection Errors ! { ! get { return errors; } ! } ! ! #endregion ! ! #region Constructors ! ! internal PgException() : base() ! { ! errors = new PgErrorCollection(); ! } ! ! internal PgException(string message) : base(message) ! { ! errors = new PgErrorCollection(); ! } ! ! internal PgException(SerializationInfo info, StreamingContext context) : base(info, context) ! { ! errors = new PgErrorCollection(); ! } ! ! internal PgException(string message, PgClientException ex) : base(message, ex) ! { ! errors = new PgErrorCollection(); ! Source = ex.Source; ! ! getPgExceptionErrors(ex); ! } ! ! #endregion ! ! #region Methods ! ! private void getPgExceptionErrors(PgClientException ex) ! { ! foreach (PgClientError error in ex.Errors) ! { ! PgError newError = new PgError(); ! ! newError.Severity = error.Severity; ! newError.Code = error.Code; ! newError.Message = error.Message; ! newError.Detail = error.Detail; ! newError.Hint = error.Hint; ! newError.Line = error.Line; ! newError.Where = error.Where; ! newError.Position = error.Position; ! newError.Routine = error.Routine; ! ! errors.Add(newError); ! } ! } ! ! #endregion ! } } \ No newline at end of file --- 1,97 ---- ! /* 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.Text; ! using System.ComponentModel; ! using System.Runtime.Serialization; ! using PostgreSql.Data.NPgClient; ! ! namespace PostgreSql.Data.PgSqlClient ! { ! [Serializable] ! public class PgException : Exception ! { ! #region Fields ! ! private PgErrorCollection errors; ! ! #endregion ! ! #region Properties ! ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] ! public PgErrorCollection Errors ! { ! get { return errors; } ! } ! ! #endregion ! ! #region Constructors ! ! internal PgException() : base() ! { ! errors = new PgErrorCollection(); ! } ! ! internal PgException(string message) : base(message) ! { ! errors = new PgErrorCollection(); ! } ! ! internal PgException(SerializationInfo info, StreamingContext context) : base(info, context) ! { ! errors = new PgErrorCollection(); ! } ! ! internal PgException(string message, PgClientException ex) : base(message, ex) ! { ! ... [truncated message content] |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13939 Modified Files: AssemblyInfo.cs PgArrayTest.cs PgBaseTest.cs PgCommandBuilderTest.cs PgCommandTest.cs PgConnectionTest.cs PgDataAdapterTest.cs PgDatabaseSchemaTest.cs PgDataReaderTest.cs PgGeometicTypesTest.cs PgTransactionTest.cs Log Message: Updated license headers Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/AssemblyInfo.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AssemblyInfo.cs 2 Aug 2003 19:43:03 -0000 1.1.1.1 --- AssemblyInfo.cs 9 Feb 2004 14:21:30 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgArrayTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgArrayTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgArrayTest.cs 20 Sep 2003 10:49:15 -0000 1.1 --- PgArrayTest.cs 9 Feb 2004 14:21:31 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgBaseTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgBaseTest.cs 18 Dec 2003 10:10:47 -0000 1.9 --- PgBaseTest.cs 9 Feb 2004 14:21:31 -0000 1.10 *************** *** 1,368 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Text; ! using System.Data; ! using System.Configuration; ! using NUnit.Framework; ! ! using PostgreSql.Data.PgSqlClient; ! using PostgreSql.Data.PgTypes; ! ! namespace PostgreSql.Data.PgSqlClient.UnitTests ! { ! public class PgBaseTest ! { ! private PgConnection connection; ! ! public PgConnection Connection ! { ! get { return connection; } ! } ! ! public PgBaseTest() ! { ! } ! ! [SetUp] ! public void SetUp() ! { ! try ! { ! dropDatabase(); ! } ! catch{} ! ! createDatabase(); ! ! // Build the connection string ! StringBuilder connString = new StringBuilder(); ! connString.AppendFormat( ! "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}", ! ConfigurationSettings.AppSettings["User"], ! ConfigurationSettings.AppSettings["Password"], ! ConfigurationSettings.AppSettings["Database"], ! ConfigurationSettings.AppSettings["DataSource"], ! ConfigurationSettings.AppSettings["Port"], ! ConfigurationSettings.AppSettings["SSL"]); ! ! connection = new PgConnection(connString.ToString()); ! connection.StateChange += new StateChangeEventHandler(stateChange); ! connection.Open(); ! ! createTables(); ! createFunctions(); ! } ! ! [TearDown] ! public void TearDown() ! { ! connection.Close(); ! } ! ! private void stateChange(object sender, StateChangeEventArgs e) ! { ! Console.WriteLine("Connection state changed from {0} to {1}", ! e.OriginalState, e.CurrentState); ! } ! ! private void createDatabase() ! { ! StringBuilder connString = new StringBuilder(); ! connString.AppendFormat( ! "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}", ! ConfigurationSettings.AppSettings["User"], ! ConfigurationSettings.AppSettings["Password"], ! String.Empty, ! ConfigurationSettings.AppSettings["DataSource"], ! ConfigurationSettings.AppSettings["Port"], ! ConfigurationSettings.AppSettings["SSL"]); ! ! PgConnection connection = new PgConnection(connString.ToString()); ! connection.Open(); ! ! connection.CreateDatabase( ! ConfigurationSettings.AppSettings["Database"], ! null, ! null, ! null, ! "UNICODE"); ! ! connection.Close(); ! } ! ! private void dropDatabase() ! { ! StringBuilder connString = new StringBuilder(); ! connString.AppendFormat( ! "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}", ! ConfigurationSettings.AppSettings["User"], ! ConfigurationSettings.AppSettings["Password"], ! String.Empty, ! ConfigurationSettings.AppSettings["DataSource"], ! ConfigurationSettings.AppSettings["Port"], ! ConfigurationSettings.AppSettings["SSL"]); ! ! PgConnection connection = new PgConnection(connString.ToString()); ! connection.Open(); ! ! StringBuilder commandText = new StringBuilder(); ! ! commandText.AppendFormat( ! "drop database {0}", ! ConfigurationSettings.AppSettings["Database"]); ! ! PgCommand command = new PgCommand(commandText.ToString(), connection); ! ! command.ExecuteNonQuery(); ! command.Dispose(); ! ! connection.Close(); ! } ! ! private void createTables() ! { ! StringBuilder commandText = new StringBuilder(); ! ! // Table for general purpouse tests ! commandText.Append("CREATE TABLE public.test_table("); ! commandText.Append("int4_field int4 NOT NULL,"); ! commandText.Append("char_field char(10),"); ! commandText.Append("varchar_field varchar(30),"); ! commandText.Append("single_field float4,"); ! commandText.Append("double_field float8,"); ! commandText.Append("date_field date,"); ! commandText.Append("time_field time,"); ! commandText.Append("timestamp_field timestamp,"); ! commandText.Append("blob_field bytea,"); ! commandText.Append("bool_field bool,"); ! commandText.Append("int2_field int2,"); ! commandText.Append("int8_field int8,"); ! commandText.Append("money_field money,"); ! commandText.Append("numeric_field numeric(8,2),"); ! commandText.Append("bool_array bool[],"); ! commandText.Append("int2_array int2[],"); ! commandText.Append("int4_array int4[],"); ! commandText.Append("int8_array int8[],"); ! commandText.Append("mint2_array int2[][],"); ! commandText.Append("serial_field serial NOT NULL,"); ! commandText.Append("macaddr_field macaddr,"); ! commandText.Append("inet_field inet,"); ! commandText.Append("name_field name,"); ! commandText.Append("CONSTRAINT test_table_pkey PRIMARY KEY (int4_field)"); ! commandText.Append(") WITH OIDS;"); ! ! PgCommand command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! commandText = new StringBuilder(); ! ! // Table for Geometric types tests ! commandText.Append("CREATE TABLE public.geometric_table("); ! commandText.Append("pk int4 NOT NULL,"); ! commandText.Append("point_field point,"); ! commandText.Append("box_field box,"); ! commandText.Append("circle_field circle,"); ! commandText.Append("lseg_field lseg,"); ! commandText.Append("path_field path,"); ! commandText.Append("polygon_field polygon,"); ! commandText.Append("point_array point[],"); ! commandText.Append("box_array box[],"); ! commandText.Append("circle_array circle[],"); ! commandText.Append("lseg_array lseg[],"); ! commandText.Append("path_array path[],"); ! commandText.Append("polygon_array polygon[],"); ! commandText.Append("line_field line,"); ! commandText.Append("line_array line[],"); ! commandText.Append("CONSTRAINT geometric_test_pkey PRIMARY KEY (pk)"); ! commandText.Append(") WITH OIDS;"); ! ! command.CommandText = commandText.ToString(); ! command.ExecuteNonQuery(); ! command.Dispose(); ! ! insertTestData(); ! insertGeometricTestData(); ! } ! ! private void createFunctions() ! { ! // Create language functions ! StringBuilder commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.plpgsql_call_handler()"); ! commandText.Append("RETURNS language_handler AS"); ! commandText.Append("'$libdir/plpgsql', 'plpgsql_call_handler'"); ! commandText.Append("LANGUAGE 'c' VOLATILE;"); ! ! PgCommand command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! // Create languages ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler;"); ! ! command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! // Create test function public.TestCount() ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.TestCount()"); ! commandText.Append("RETURNS int8 AS"); ! commandText.Append("'"); ! commandText.Append("select count(*) from test_table;"); ! commandText.Append("'"); ! commandText.Append("LANGUAGE 'sql' VOLATILE;"); ! ! command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! // Create test function public.DeriveCount() ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.DeriveCount(int4)"); ! commandText.Append("RETURNS int8 AS"); ! commandText.Append("'"); ! commandText.Append("select count(*) from test_table where int4_field < $1;"); ! commandText.Append("'"); ! commandText.Append("LANGUAGE 'sql' VOLATILE;"); ! ! command.CommandText = commandText.ToString(); ! command.ExecuteNonQuery(); ! ! // Create test function public.DeleteRows() ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.DeleteRows(int4)\r\n"); ! commandText.Append("RETURNS BOOLEAN AS '\r\n"); ! commandText.Append("DECLARE\r\n"); ! commandText.Append("\t\trows INTEGER;\r\n"); ! commandText.Append("BEGIN\r\n"); ! commandText.Append("DELETE FROM public.test_table WHERE int4_field > $1;\r\n"); ! commandText.Append("GET DIAGNOSTICS rows = ROW_COUNT;\r\n"); ! commandText.Append("IF rows > 0 THEN\r\n"); ! commandText.Append("\t\tRETURN TRUE;\r\n"); ! commandText.Append("ELSE\r\n"); ! commandText.Append("\t\tRETURN FALSE;\r\n"); ! commandText.Append("END IF;\r\n"); ! commandText.Append("END;\r\n"); ! commandText.Append("'\r\n"); ! commandText.Append("LANGUAGE 'plpgsql' VOLATILE;"); ! ! command.CommandText = commandText.ToString(); ! command.ExecuteNonQuery(); ! ! command.Dispose(); ! } ! ! private void insertTestData() ! { ! string commandText = "insert into public.test_table values(@int4_field, @char_field, @varchar_field, @single_field, @double_field, @date_Field, @time_field, @timestamp_field)"; ! ! PgTransaction transaction = connection.BeginTransaction(); ! PgCommand command = new PgCommand(commandText, connection, transaction); ! ! try ! { ! // Add command parameters ! command.Parameters.Add("@int4_field", PgDbType.Int4); ! command.Parameters.Add("@char_field", PgDbType.Char); ! command.Parameters.Add("@varchar_field", PgDbType.VarChar); ! command.Parameters.Add("@single_field", PgDbType.Float); ! command.Parameters.Add("@double_field", PgDbType.Double); ! command.Parameters.Add("@date_field", PgDbType.Date); ! command.Parameters.Add("@time_field", PgDbType.Time); ! command.Parameters.Add("@timestamp_field", PgDbType.Timestamp); ! ! for (int i = 0; i < 100; i++) ! { ! command.Parameters["@int4_field"].Value = i; ! command.Parameters["@char_field"].Value = "IRow " + i.ToString(); ! command.Parameters["@varchar_field"].Value = "IRow Number" + i.ToString(); ! command.Parameters["@single_field"].Value = (float)(i + 10)/5; ! command.Parameters["@double_field"].Value = Math.Log(i, 10); ! command.Parameters["@date_field"].Value = DateTime.Now; ! command.Parameters["@time_field"].Value = DateTime.Now; ! command.Parameters["@timestamp_field"].Value = DateTime.Now; ! ! command.ExecuteNonQuery(); ! } ! ! // Commit transaction ! transaction.Commit(); ! } ! catch (PgException ex) ! { ! transaction.Rollback(); ! throw ex; ! } ! finally ! { ! command.Dispose(); ! } ! } ! ! private void insertGeometricTestData() ! { ! string commandText = "insert into public.geometric_table values(@pk, @point, @box, @circle, @lseg, @path, @polygon)"; ! ! PgTransaction transaction = connection.BeginTransaction(); ! PgCommand command = new PgCommand(commandText, connection, transaction); ! ! try ! { ! // Add command parameters ! command.Parameters.Add("@pk", PgDbType.Int4); ! command.Parameters.Add("@point", PgDbType.Point); ! command.Parameters.Add("@box", PgDbType.Box); ! command.Parameters.Add("@circle", PgDbType.Circle); ! command.Parameters.Add("@lseg", PgDbType.LSeg); ! command.Parameters.Add("@path", PgDbType.Path); ! command.Parameters.Add("@polygon", PgDbType.Polygon); ! ! for (int i = 0; i < 100; i++) ! { ! command.Parameters["@pk"].Value = i; ! command.Parameters["@point"].Value = new PgPoint(i, i + 10); ! command.Parameters["@box"].Value = new PgBox(new PgPoint(0,i), new PgPoint(i, i)); ! command.Parameters["@circle"].Value = new PgCircle(new PgPoint(i, 0), i); ! command.Parameters["@lseg"].Value = new PgLSeg(new PgPoint(-1,0), new PgPoint(1,0)); ! command.Parameters["@path"].Value = new PgPath(false, new PgPoint[]{new PgPoint(0,0), new PgPoint(1,0)}); ! command.Parameters["@polygon"].Value= new PgPolygon(new PgPoint[]{new PgPoint(1,1), new PgPoint(0,0)}); ! ! command.ExecuteNonQuery(); ! } ! ! // Commit transaction ! transaction.Commit(); ! } ! catch (PgException ex) ! { ! transaction.Rollback(); ! throw ex; ! } ! finally ! { ! command.Dispose(); ! } ! } ! } } \ No newline at end of file --- 1,368 ---- ! /* 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.Text; ! using System.Data; ! using System.Configuration; ! using NUnit.Framework; ! ! using PostgreSql.Data.PgSqlClient; ! using PostgreSql.Data.PgTypes; ! ! namespace PostgreSql.Data.PgSqlClient.UnitTests ! { ! public class PgBaseTest ! { ! private PgConnection connection; ! ! public PgConnection Connection ! { ! get { return connection; } ! } ! ! public PgBaseTest() ! { ! } ! ! [SetUp] ! public void SetUp() ! { ! try ! { ! dropDatabase(); ! } ! catch{} ! ! createDatabase(); ! ! // Build the connection string ! StringBuilder connString = new StringBuilder(); ! connString.AppendFormat( ! "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}", ! ConfigurationSettings.AppSettings["User"], ! ConfigurationSettings.AppSettings["Password"], ! ConfigurationSettings.AppSettings["Database"], ! ConfigurationSettings.AppSettings["DataSource"], ! ConfigurationSettings.AppSettings["Port"], ! ConfigurationSettings.AppSettings["SSL"]); ! ! connection = new PgConnection(connString.ToString()); ! connection.StateChange += new StateChangeEventHandler(stateChange); ! connection.Open(); ! ! createTables(); ! createFunctions(); ! } ! ! [TearDown] ! public void TearDown() ! { ! connection.Close(); ! } ! ! private void stateChange(object sender, StateChangeEventArgs e) ! { ! Console.WriteLine("Connection state changed from {0} to {1}", ! e.OriginalState, e.CurrentState); ! } ! ! private void createDatabase() ! { ! StringBuilder connString = new StringBuilder(); ! connString.AppendFormat( ! "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}", ! ConfigurationSettings.AppSettings["User"], ! ConfigurationSettings.AppSettings["Password"], ! String.Empty, ! ConfigurationSettings.AppSettings["DataSource"], ! ConfigurationSettings.AppSettings["Port"], ! ConfigurationSettings.AppSettings["SSL"]); ! ! PgConnection connection = new PgConnection(connString.ToString()); ! connection.Open(); ! ! connection.CreateDatabase( ! ConfigurationSettings.AppSettings["Database"], ! null, ! null, ! null, ! "UNICODE"); ! ! connection.Close(); ! } ! ! private void dropDatabase() ! { ! StringBuilder connString = new StringBuilder(); ! connString.AppendFormat( ! "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}", ! ConfigurationSettings.AppSettings["User"], ! ConfigurationSettings.AppSettings["Password"], ! String.Empty, ! ConfigurationSettings.AppSettings["DataSource"], ! ConfigurationSettings.AppSettings["Port"], ! ConfigurationSettings.AppSettings["SSL"]); ! ! PgConnection connection = new PgConnection(connString.ToString()); ! connection.Open(); ! ! StringBuilder commandText = new StringBuilder(); ! ! commandText.AppendFormat( ! "drop database {0}", ! ConfigurationSettings.AppSettings["Database"]); ! ! PgCommand command = new PgCommand(commandText.ToString(), connection); ! ! command.ExecuteNonQuery(); ! command.Dispose(); ! ! connection.Close(); ! } ! ! private void createTables() ! { ! StringBuilder commandText = new StringBuilder(); ! ! // Table for general purpouse tests ! commandText.Append("CREATE TABLE public.test_table("); ! commandText.Append("int4_field int4 NOT NULL,"); ! commandText.Append("char_field char(10),"); ! commandText.Append("varchar_field varchar(30),"); ! commandText.Append("single_field float4,"); ! commandText.Append("double_field float8,"); ! commandText.Append("date_field date,"); ! commandText.Append("time_field time,"); ! commandText.Append("timestamp_field timestamp,"); ! commandText.Append("blob_field bytea,"); ! commandText.Append("bool_field bool,"); ! commandText.Append("int2_field int2,"); ! commandText.Append("int8_field int8,"); ! commandText.Append("money_field money,"); ! commandText.Append("numeric_field numeric(8,2),"); ! commandText.Append("bool_array bool[],"); ! commandText.Append("int2_array int2[],"); ! commandText.Append("int4_array int4[],"); ! commandText.Append("int8_array int8[],"); ! commandText.Append("mint2_array int2[][],"); ! commandText.Append("serial_field serial NOT NULL,"); ! commandText.Append("macaddr_field macaddr,"); ! commandText.Append("inet_field inet,"); ! commandText.Append("name_field name,"); ! commandText.Append("CONSTRAINT test_table_pkey PRIMARY KEY (int4_field)"); ! commandText.Append(") WITH OIDS;"); ! ! PgCommand command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! commandText = new StringBuilder(); ! ! // Table for Geometric types tests ! commandText.Append("CREATE TABLE public.geometric_table("); ! commandText.Append("pk int4 NOT NULL,"); ! commandText.Append("point_field point,"); ! commandText.Append("box_field box,"); ! commandText.Append("circle_field circle,"); ! commandText.Append("lseg_field lseg,"); ! commandText.Append("path_field path,"); ! commandText.Append("polygon_field polygon,"); ! commandText.Append("point_array point[],"); ! commandText.Append("box_array box[],"); ! commandText.Append("circle_array circle[],"); ! commandText.Append("lseg_array lseg[],"); ! commandText.Append("path_array path[],"); ! commandText.Append("polygon_array polygon[],"); ! commandText.Append("line_field line,"); ! commandText.Append("line_array line[],"); ! commandText.Append("CONSTRAINT geometric_test_pkey PRIMARY KEY (pk)"); ! commandText.Append(") WITH OIDS;"); ! ! command.CommandText = commandText.ToString(); ! command.ExecuteNonQuery(); ! command.Dispose(); ! ! insertTestData(); ! insertGeometricTestData(); ! } ! ! private void createFunctions() ! { ! // Create language functions ! StringBuilder commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.plpgsql_call_handler()"); ! commandText.Append("RETURNS language_handler AS"); ! commandText.Append("'$libdir/plpgsql', 'plpgsql_call_handler'"); ! commandText.Append("LANGUAGE 'c' VOLATILE;"); ! ! PgCommand command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! // Create languages ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler;"); ! ! command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! // Create test function public.TestCount() ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.TestCount()"); ! commandText.Append("RETURNS int8 AS"); ! commandText.Append("'"); ! commandText.Append("select count(*) from test_table;"); ! commandText.Append("'"); ! commandText.Append("LANGUAGE 'sql' VOLATILE;"); ! ! command = new PgCommand(commandText.ToString(), connection); ! command.ExecuteNonQuery(); ! ! // Create test function public.DeriveCount() ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.DeriveCount(int4)"); ! commandText.Append("RETURNS int8 AS"); ! commandText.Append("'"); ! commandText.Append("select count(*) from test_table where int4_field < $1;"); ! commandText.Append("'"); ! commandText.Append("LANGUAGE 'sql' VOLATILE;"); ! ! command.CommandText = commandText.ToString(); ! command.ExecuteNonQuery(); ! ! // Create test function public.DeleteRows() ! commandText = new StringBuilder(); ! ! commandText.Append("CREATE OR REPLACE FUNCTION public.DeleteRows(int4)\r\n"); ! commandText.Append("RETURNS BOOLEAN AS '\r\n"); ! commandText.Append("DECLARE\r\n"); ! commandText.Append("\t\trows INTEGER;\r\n"); ! commandText.Append("BEGIN\r\n"); ! commandText.Append("DELETE FROM public.test_table WHERE int4_field > $1;\r\n"); ! commandText.Append("GET DIAGNOSTICS rows = ROW_COUNT;\r\n"); ! commandText.Append("IF rows > 0 THEN\r\n"); ! commandText.Append("\t\tRETURN TRUE;\r\n"); ! commandText.Append("ELSE\r\n"); ! commandText.Append("\t\tRETURN FALSE;\r\n"); ! commandText.Append("END IF;\r\n"); ! commandText.Append("END;\r\n"); ! commandText.Append("'\r\n"); ! commandText.Append("LANGUAGE 'plpgsql' VOLATILE;"); ! ! command.CommandText = commandText.ToString(); ! command.ExecuteNonQuery(); ! ! command.Dispose(); ! } ! ! private void insertTestData() ! { ! string commandText = "insert into public.test_table values(@int4_field, @char_field, @varchar_field, @single_field, @double_field, @date_Field, @time_field, @timestamp_field)"; ! ! PgTransaction transaction = connection.BeginTransaction(); ! PgCommand command = new PgCommand(commandText, connection, transaction); ! ! try ! { ! // Add command parameters ! command.Parameters.Add("@int4_field", PgDbType.Int4); ! command.Parameters.Add("@char_field", PgDbType.Char); ! command.Parameters.Add("@varchar_field", PgDbType.VarChar); ! command.Parameters.Add("@single_field", PgDbType.Float); ! command.Parameters.Add("@double_field", PgDbType.Double); ! command.Parameters.Add("@date_field", PgDbType.Date); ! command.Parameters.Add("@time_field", PgDbType.Time); ! command.Parameters.Add("@timestamp_field", PgDbType.Timestamp); ! ! for (int i = 0; i < 100; i++) ! { ! command.Parameters["@int4_field"].Value = i; ! command.Parameters["@char_field"].Value = "IRow " + i.ToString(); ! command.Parameters["@varchar_field"].Value = "IRow Number" + i.ToString(); ! command.Parameters["@single_field"].Value = (float)(i + 10)/5; ! command.Parameters["@double_field"].Value = Math.Log(i, 10); ! command.Parameters["@date_field"].Value = DateTime.Now; ! command.Parameters["@time_field"].Value = DateTime.Now; ! command.Parameters["@timestamp_field"].Value = DateTime.Now; ! ! command.ExecuteNonQuery(); ! } ! ! // Commit transaction ! transaction.Commit(); ! } ! catch (PgException ex) ! { ! transaction.Rollback(); ! throw ex; ! } ! finally ! { ! command.Dispose(); ! } ! } ! ! private void insertGeometricTestData() ! { ! string commandText = "insert into public.geometric_table values(@pk, @point, @box, @circle, @lseg, @path, @polygon)"; ! ! PgTransaction transaction = connection.BeginTransaction(); ! PgCommand command = new PgCommand(commandText, connection, transaction); ! ! try ! { ! // Add command parameters ! command.Parameters.Add("@pk", PgDbType.Int4); ! command.Parameters.Add("@point", PgDbType.Point); ! command.Parameters.Add("@box", PgDbType.Box); ! command.Parameters.Add("@circle", PgDbType.Circle); ! command.Parameters.Add("@lseg", PgDbType.LSeg); ! command.Parameters.Add("@path", PgDbType.Path); ! command.Parameters.Add("@polygon", PgDbType.Polygon); ! ! for (int i = 0; i < 100; i++) ! { ! command.Parameters["@pk"].Value = i; ! command.Parameters["@point"].Value = new PgPoint(i, i + 10); ! command.Parameters["@box"].Value = new PgBox(new PgPoint(0,i), new PgPoint(i, i)); ! command.Parameters["@circle"].Value = new PgCircle(new PgPoint(i, 0), i); ! command.Parameters["@lseg"].Value = new PgLSeg(new PgPoint(-1,0), new PgPoint(1,0)); ! command.Parameters["@path"].Value = new PgPath(false, new PgPoint[]{new PgPoint(0,0), new PgPoint(1,0)}); ! command.Parameters["@polygon"].Value= new PgPolygon(new PgPoint[]{new PgPoint(1,1), new PgPoint(0,0)}); ! ! command.ExecuteNonQuery(); ! } ! ! // Commit transaction ! transaction.Commit(); ! } ! catch (PgException ex) ! { ! transaction.Rollback(); ! throw ex; ! } ! finally ! { ! command.Dispose(); ! } ! } ! } } \ No newline at end of file Index: PgCommandBuilderTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgCommandBuilderTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgCommandBuilderTest.cs 25 Oct 2003 20:57:49 -0000 1.4 --- PgCommandBuilderTest.cs 9 Feb 2004 14:21:31 -0000 1.5 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgCommandTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgCommandTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgCommandTest.cs 15 Aug 2003 17:51:20 -0000 1.3 --- PgCommandTest.cs 9 Feb 2004 14:21:31 -0000 1.4 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgConnectionTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgConnectionTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgConnectionTest.cs 15 Sep 2003 16:40:38 -0000 1.2 --- PgConnectionTest.cs 9 Feb 2004 14:21:31 -0000 1.3 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgDataAdapterTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgDataAdapterTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgDataAdapterTest.cs 9 Oct 2003 11:46:47 -0000 1.2 --- PgDataAdapterTest.cs 9 Feb 2004 14:21:31 -0000 1.3 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgDatabaseSchemaTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgDatabaseSchemaTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgDatabaseSchemaTest.cs 16 Sep 2003 12:30:45 -0000 1.2 --- PgDatabaseSchemaTest.cs 9 Feb 2004 14:21:31 -0000 1.3 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgDataReaderTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgDataReaderTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgDataReaderTest.cs 9 Oct 2003 11:46:47 -0000 1.2 --- PgDataReaderTest.cs 9 Feb 2004 14:21:31 -0000 1.3 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgGeometicTypesTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgGeometicTypesTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgGeometicTypesTest.cs 20 Nov 2003 17:35:31 -0000 1.4 --- PgGeometicTypesTest.cs 9 Feb 2004 14:21:31 -0000 1.5 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgTransactionTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgTransactionTest.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgTransactionTest.cs 2 Aug 2003 19:43:03 -0000 1.1.1.1 --- PgTransactionTest.cs 9 Feb 2004 14:21:31 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12298 Modified Files: TlsClientCertificateType.cs TlsHandshakeMessage.cs TlsHandshakeType.cs Log Message: Updated license headers Index: TlsClientCertificateType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/TlsClientCertificateType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsClientCertificateType.cs 11 Oct 2003 10:08:57 -0000 1.1 --- TlsClientCertificateType.cs 9 Feb 2004 14:17:23 -0000 1.2 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: TlsHandshakeMessage.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TlsHandshakeMessage.cs 14 Dec 2003 15:01:39 -0000 1.14 --- TlsHandshakeMessage.cs 9 Feb 2004 14:17:23 -0000 1.15 *************** *** 1,148 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! // using Mono.Security.Protocol.Tls; ! ! namespace Mono.Security.Protocol.Tls.Handshake ! { ! internal abstract class TlsHandshakeMessage : TlsStream ! { ! #region Fields ! ! private TlsContext context; ! private TlsHandshakeType handshakeType; ! private TlsContentType contentType; ! ! #endregion ! ! #region Properties ! ! public TlsContext Context ! { ! get { return this.context; } ! } ! ! public TlsHandshakeType HandshakeType ! { ! get { return this.handshakeType; } ! } ! ! public TlsContentType ContentType ! { ! get { return this.contentType; } ! } ! ! #endregion ! ! #region Constructors ! ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType) ! : this(context, handshakeType, TlsContentType.Handshake) ! { ! } ! ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType, ! TlsContentType contentType) : base() ! { ! this.context = context; ! this.handshakeType = handshakeType; ! this.contentType = contentType; ! ! // Process message ! this.process(); ! } ! ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType, ! byte[] data) : base(data) ! { ! this.context = context; ! this.handshakeType = handshakeType; ! ! // Process message ! this.process(); ! } ! ! #endregion ! ! #region Abstract Methods ! ! protected abstract void ProcessAsTls1(); ! ! protected abstract void ProcessAsSsl3(); ! ! #endregion ! ! #region Methods ! ! private void process() ! { ! switch (this.Context.Protocol) ! { ! case SecurityProtocolType.Ssl3: ! this.ProcessAsSsl3(); ! break; ! ! case SecurityProtocolType.Tls: ! this.ProcessAsTls1(); ! break; ! } ! } ! ! public virtual void Update() ! { ! if (CanWrite) ! { ! this.context.HandshakeMessages.Write(this.EncodeMessage()); ! this.Reset(); ! } ! } ! ! public virtual byte[] EncodeMessage() ! { ! byte[] result = null; ! ! if (CanWrite) ! { ! TlsStream c = new TlsStream(); ! ! c.Write((byte)HandshakeType); ! c.WriteInt24((int)this.Length); ! c.Write(this.ToArray()); ! ! result = c.ToArray(); ! } ! ! return result; ! } ! ! #endregion ! } ! } --- 1,148 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! // using Mono.Security.Protocol.Tls; ! ! namespace Mono.Security.Protocol.Tls.Handshake ! { ! internal abstract class TlsHandshakeMessage : TlsStream ! { ! #region Fields ! ! private TlsContext context; ! private TlsHandshakeType handshakeType; ! private TlsContentType contentType; ! ! #endregion ! ! #region Properties ! ! public TlsContext Context ! { ! get { return this.context; } ! } ! ! public TlsHandshakeType HandshakeType ! { ! get { return this.handshakeType; } ! } ! ! public TlsContentType ContentType ! { ! get { return this.contentType; } ! } ! ! #endregion ! ! #region Constructors ! ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType) ! : this(context, handshakeType, TlsContentType.Handshake) ! { ! } ! ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType, ! TlsContentType contentType) : base() ! { ! this.context = context; ! this.handshakeType = handshakeType; ! this.contentType = contentType; ! ! // Process message ! this.process(); ! } ! ! public TlsHandshakeMessage( ! TlsContext context, ! TlsHandshakeType handshakeType, ! byte[] data) : base(data) ! { ! this.context = context; ! this.handshakeType = handshakeType; ! ! // Process message ! this.process(); ! } ! ! #endregion ! ! #region Abstract Methods ! ! protected abstract void ProcessAsTls1(); ! ! protected abstract void ProcessAsSsl3(); ! ! #endregion ! ! #region Methods ! ! private void process() ! { ! switch (this.Context.Protocol) ! { ! case SecurityProtocolType.Ssl3: ! this.ProcessAsSsl3(); ! break; ! ! case SecurityProtocolType.Tls: ! this.ProcessAsTls1(); ! break; ! } ! } ! ! public virtual void Update() ! { ! if (CanWrite) ! { ! this.context.HandshakeMessages.Write(this.EncodeMessage()); ! this.Reset(); ! } ! } ! ! public virtual byte[] EncodeMessage() ! { ! byte[] result = null; ! ! if (CanWrite) ! { ! TlsStream c = new TlsStream(); ! ! c.Write((byte)HandshakeType); ! c.WriteInt24((int)this.Length); ! c.Write(this.ToArray()); ! ! result = c.ToArray(); ! } ! ! return result; ! } ! ! #endregion ! } ! } Index: TlsHandshakeType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/TlsHandshakeType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsHandshakeType.cs 21 Oct 2003 16:05:54 -0000 1.2 --- TlsHandshakeType.cs 9 Feb 2004 14:17:23 -0000 1.3 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person |
From: <car...@us...> - 2004-02-10 01:24:28
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10813 Modified Files: makefile Log Message: Added changes for build directly against the Mono.Security.dll assembly Index: makefile =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** makefile 8 Feb 2004 22:24:37 -0000 1.11 --- makefile 9 Feb 2004 16:24:14 -0000 1.12 *************** *** 1,7 **** - TLS = Mono.Security.Tls.dll LIBRARY = PostgreSql.Data.PgSqlClient.dll NUNIT_SUITE = PostgreSql.Data.PgSqlClient.UnitTests.dll ! all: ${TLS} $(LIBRARY) $(NUNIT_SUITE) install clean CSC = mcs --- 1,6 ---- LIBRARY = PostgreSql.Data.PgSqlClient.dll NUNIT_SUITE = PostgreSql.Data.PgSqlClient.UnitTests.dll ! all: $(LIBRARY) $(NUNIT_SUITE) install clean CSC = mcs *************** *** 20,24 **** RECURSE_TESTS = -recurse:./PostgreSql.Data.PgSqlClient.UnitTests/source/*.cs ! # COnfiguration files NUNIT_CONFIG=./PostgreSql.Data.PgSqlClient.UnitTests/PostgreSql.Data.PgSqlClient.UnitTests.dll.config --- 19,23 ---- RECURSE_TESTS = -recurse:./PostgreSql.Data.PgSqlClient.UnitTests/source/*.cs ! # Configuration files NUNIT_CONFIG=./PostgreSql.Data.PgSqlClient.UnitTests/PostgreSql.Data.PgSqlClient.UnitTests.dll.config *************** *** 26,34 **** DEFINE = -define:_DEBUG - Mono.Security.Tls.dll: - $(CSC) -target:library -unsafe -out:$(TLS) $(LD_BASIC_FLAGS) $(DEFINE) $(RECURSE_TLS) - PostgreSql.Data.PgSqlClient.dll: ! $(CSC) -target:library -out:$(LIBRARY) $(LD_FLAGS) -reference:Mono.Security.Tls.dll $(DEFINE) $(TOOL_RESOURCES) $(RECURSE_SOURCE) PostgreSql.Data.PgSqlClient.UnitTests.dll: --- 25,30 ---- DEFINE = -define:_DEBUG PostgreSql.Data.PgSqlClient.dll: ! $(CSC) -target:library -out:$(LIBRARY) $(LD_FLAGS) -reference:Mono.Security.dll $(DEFINE) $(TOOL_RESOURCES) $(RECURSE_SOURCE) PostgreSql.Data.PgSqlClient.UnitTests.dll: *************** *** 38,42 **** rm -rf build mkdir -p build - $(COPY) $(TLS) ./build $(COPY) $(LIBRARY) ./build $(COPY) $(NUNIT_SUITE) ./build --- 34,37 ---- *************** *** 44,48 **** clean: - rm $(TLS) rm $(LIBRARY) ! rm ${NUNIT_SUITE} \ No newline at end of file --- 39,42 ---- clean: rm $(LIBRARY) ! rm ${NUNIT_SUITE} |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13695 Modified Files: PgAuthMethods.cs PgCharSet.cs PgCharSetCollection.cs PgClientError.cs PgClientErrorCollection.cs PgClientException.cs PgClientMessageEventArgs.cs PgClientNotificationEventArgs.cs PgCodes.cs PgConnectionParams.cs PgDataType.cs PgDbClient.cs PgFieldDescriptor.cs PgLayouts.cs PgOutputPacket.cs PgParameter.cs PgResponsePacket.cs PgRowDescriptor.cs PgStatement.cs PgType.cs PgTypeCollection.cs Log Message: Updated license headers Index: PgAuthMethods.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgAuthMethods.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgAuthMethods.cs 12 Nov 2003 22:43:37 -0000 1.3 --- PgAuthMethods.cs 9 Feb 2004 14:20:34 -0000 1.4 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgCharSet.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCharSet.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgCharSet.cs 14 Dec 2003 15:07:13 -0000 1.2 --- PgCharSet.cs 9 Feb 2004 14:20:45 -0000 1.3 *************** *** 1,67 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Text; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgCharSet ! { ! #region Fields ! ! private string charSet; ! private Encoding encoding; ! ! #endregion ! ! #region Properties ! ! public string CharSet ! { ! get { return charSet; } ! } ! ! public Encoding Encoding ! { ! get { return encoding; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgCharSet() ! { ! } ! ! public PgCharSet(string charSet, string systemCharSet) ! { ! this.charSet = charSet; ! this.encoding = Encoding.GetEncoding(systemCharSet); ! } ! ! public PgCharSet(string charSet, int cp) ! { ! this.charSet = charSet; ! this.encoding = Encoding.GetEncoding(cp); ! } ! ! #endregion ! } ! } --- 1,67 ---- ! /* 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.Text; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgCharSet ! { ! #region Fields ! ! private string charSet; ! private Encoding encoding; ! ! #endregion ! ! #region Properties ! ! public string CharSet ! { ! get { return charSet; } ! } ! ! public Encoding Encoding ! { ! get { return encoding; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgCharSet() ! { ! } ! ! public PgCharSet(string charSet, string systemCharSet) ! { ! this.charSet = charSet; ! this.encoding = Encoding.GetEncoding(systemCharSet); ! } ! ! public PgCharSet(string charSet, int cp) ! { ! this.charSet = charSet; ! this.encoding = Encoding.GetEncoding(cp); ! } ! ! #endregion ! } ! } Index: PgCharSetCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCharSetCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgCharSetCollection.cs 14 Dec 2003 15:07:13 -0000 1.3 --- PgCharSetCollection.cs 9 Feb 2004 14:20:45 -0000 1.4 *************** *** 1,109 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Collections; ! using System.Globalization; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgCharSetCollection : ArrayList ! { ! #region Properties ! ! public new PgCharSet this[int index] ! { ! get { return (PgCharSet)base[index]; } ! set { base[index] = (PgCharSet)value; } ! } ! ! public PgCharSet this[string name] ! { ! get { return (PgCharSet)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (PgCharSet)value; } ! } ! ! #endregion ! ! #region Methods ! ! public bool Contains(string charset) ! { ! return(-1 != IndexOf(charset)); ! } ! ! public int IndexOf(string charset) ! { ! int index = 0; ! foreach(PgCharSet item in this) ! { ! if (cultureAwareCompare(item.CharSet, charset)) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public void RemoveAt(string charset) ! { ! RemoveAt(IndexOf(charset)); ! } ! ! public PgCharSet Add(PgCharSet charset) ! { ! base.Add(charset); ! ! return charset; ! } ! ! public PgCharSet Add(string charset, string systemCharset) ! { ! PgCharSet charSet = new PgCharSet(charset, systemCharset); ! ! base.Add(charSet); ! ! return charSet; ! } ! ! public PgCharSet Add(string charset, int cp) ! { ! PgCharSet charSet = new PgCharSet(charset, cp); ! ! base.Add(charSet); ! ! return charSet; ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } --- 1,109 ---- ! /* 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.Collections; ! using System.Globalization; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgCharSetCollection : ArrayList ! { ! #region Properties ! ! public new PgCharSet this[int index] ! { ! get { return (PgCharSet)base[index]; } ! set { base[index] = (PgCharSet)value; } ! } ! ! public PgCharSet this[string name] ! { ! get { return (PgCharSet)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (PgCharSet)value; } ! } ! ! #endregion ! ! #region Methods ! ! public bool Contains(string charset) ! { ! return(-1 != IndexOf(charset)); ! } ! ! public int IndexOf(string charset) ! { ! int index = 0; ! foreach(PgCharSet item in this) ! { ! if (cultureAwareCompare(item.CharSet, charset)) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public void RemoveAt(string charset) ! { ! RemoveAt(IndexOf(charset)); ! } ! ! public PgCharSet Add(PgCharSet charset) ! { ! base.Add(charset); ! ! return charset; ! } ! ! public PgCharSet Add(string charset, string systemCharset) ! { ! PgCharSet charSet = new PgCharSet(charset, systemCharset); ! ! base.Add(charSet); ! ! return charSet; ! } ! ! public PgCharSet Add(string charset, int cp) ! { ! PgCharSet charSet = new PgCharSet(charset, cp); ! ! base.Add(charSet); ! ! return charSet; ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } Index: PgClientError.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientError.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgClientError.cs 14 Dec 2003 15:07:13 -0000 1.2 --- PgClientError.cs 9 Feb 2004 14:20:45 -0000 1.3 *************** *** 1,128 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal sealed class PgClientError ! { ! #region Fields ! ! private string severity; ! private string code; ! private string message; ! private string detail; ! private string hint; ! private string where; ! private string position; ! private string file; ! private int line; ! private string routine; ! ! #endregion ! ! #region Properties ! ! public string Severity ! { ! get { return severity; } ! set { severity = value; } ! } ! ! public string Message ! { ! get { return message; } ! set { message = value; } ! } ! ! public string Code ! { ! get { return code; } ! set { code = value; } ! } ! ! public string Detail ! { ! get { return detail; } ! set { detail = value; } ! } ! ! public string Hint ! { ! get { return hint; } ! set { hint = value; } ! } ! ! public string Where ! { ! get { return where; } ! set { where = value; } ! } ! ! public string Position ! { ! get { return position; } ! set { position = value; } ! } ! ! public string File ! { ! get { return file; } ! set { file = value; } ! } ! ! public int Line ! { ! get { return line; } ! set { line = value; } ! } ! ! public string Routine ! { ! get { return routine; } ! set { routine = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgClientError() ! { ! } ! ! public PgClientError(string message) ! { ! this.message = message; ! } ! ! public PgClientError(string severity, string code, string message) ! { ! this.severity = severity; ! this.code = code; ! this.message = message; ! } ! ! #endregion ! ! #region Methods ! ! #endregion ! } ! } --- 1,128 ---- ! /* 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; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal sealed class PgClientError ! { ! #region Fields ! ! private string severity; ! private string code; ! private string message; ! private string detail; ! private string hint; ! private string where; ! private string position; ! private string file; ! private int line; ! private string routine; ! ! #endregion ! ! #region Properties ! ! public string Severity ! { ! get { return severity; } ! set { severity = value; } ! } ! ! public string Message ! { ! get { return message; } ! set { message = value; } ! } ! ! public string Code ! { ! get { return code; } ! set { code = value; } ! } ! ! public string Detail ! { ! get { return detail; } ! set { detail = value; } ! } ! ! public string Hint ! { ! get { return hint; } ! set { hint = value; } ! } ! ! public string Where ! { ! get { return where; } ! set { where = value; } ! } ! ! public string Position ! { ! get { return position; } ! set { position = value; } ! } ! ! public string File ! { ! get { return file; } ! set { file = value; } ! } ! ! public int Line ! { ! get { return line; } ! set { line = value; } ! } ! ! public string Routine ! { ! get { return routine; } ! set { routine = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgClientError() ! { ! } ! ! public PgClientError(string message) ! { ! this.message = message; ! } ! ! public PgClientError(string severity, string code, string message) ! { ! this.severity = severity; ! this.code = code; ! this.message = message; ! } ! ! #endregion ! ! #region Methods ! ! #endregion ! } ! } Index: PgClientErrorCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientErrorCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgClientErrorCollection.cs 14 Dec 2003 15:07:13 -0000 1.3 --- PgClientErrorCollection.cs 9 Feb 2004 14:20:45 -0000 1.4 *************** *** 1,97 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Collections; ! using System.Globalization; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal sealed class PgClientErrorCollection : ArrayList ! { ! #region Properties ! ! public PgClientError this[string errorMessage] ! { ! get { return (PgClientError)this[IndexOf(errorMessage)]; } ! set { this[IndexOf(errorMessage)] = (PgClientError)value; } ! } ! ! public new PgClientError this[int errorIndex] ! { ! get { return (PgClientError)base[errorIndex]; } ! set { base[errorIndex] = (PgClientError)value; } ! } ! ! #endregion ! ! #region Methods ! ! public bool Contains(string errorMessage) ! { ! return(-1 != IndexOf(errorMessage)); ! } ! ! public int IndexOf(string errorMessage) ! { ! int index = 0; ! foreach(PgClientError item in this) ! { ! if (cultureAwareCompare(item.Message, errorMessage)) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public void RemoveAt(string errorMessage) ! { ! RemoveAt(IndexOf(errorMessage)); ! } ! ! public PgClientError Add(PgClientError error) ! { ! base.Add(error); ! ! return error; ! } ! ! public PgClientError Add(string severity, string message, string code) ! { ! PgClientError error = new PgClientError(severity, code, message); ! ! return Add(error); ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } --- 1,97 ---- ! /* 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.Collections; ! using System.Globalization; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal sealed class PgClientErrorCollection : ArrayList ! { ! #region Properties ! ! public PgClientError this[string errorMessage] ! { ! get { return (PgClientError)this[IndexOf(errorMessage)]; } ! set { this[IndexOf(errorMessage)] = (PgClientError)value; } ! } ! ! public new PgClientError this[int errorIndex] ! { ! get { return (PgClientError)base[errorIndex]; } ! set { base[errorIndex] = (PgClientError)value; } ! } ! ! #endregion ! ! #region Methods ! ! public bool Contains(string errorMessage) ! { ! return(-1 != IndexOf(errorMessage)); ! } ! ! public int IndexOf(string errorMessage) ! { ! int index = 0; ! foreach(PgClientError item in this) ! { ! if (cultureAwareCompare(item.Message, errorMessage)) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public void RemoveAt(string errorMessage) ! { ! RemoveAt(IndexOf(errorMessage)); ! } ! ! public PgClientError Add(PgClientError error) ! { ! base.Add(error); ! ! return error; ! } ! ! public PgClientError Add(string severity, string message, string code) ! { ! PgClientError error = new PgClientError(severity, code, message); ! ! return Add(error); ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } Index: PgClientException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgClientException.cs 14 Dec 2003 15:07:13 -0000 1.2 --- PgClientException.cs 9 Feb 2004 14:20:45 -0000 1.3 *************** *** 1,61 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Text; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgClientException : Exception ! { ! #region Fields ! ! private string message; ! private PgClientErrorCollection errors; ! ! #endregion ! ! #region Properties ! ! public new string Message ! { ! get { return message; } ! } ! ! public PgClientErrorCollection Errors ! { ! get { return errors; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgClientException() : base() ! { ! errors = new PgClientErrorCollection(); ! } ! ! public PgClientException(string message) : this() ! { ! this.message = message; ! } ! ! #endregion ! } ! } --- 1,61 ---- ! /* 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.Text; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgClientException : Exception ! { ! #region Fields ! ! private string message; ! private PgClientErrorCollection errors; ! ! #endregion ! ! #region Properties ! ! public new string Message ! { ! get { return message; } ! } ! ! public PgClientErrorCollection Errors ! { ! get { return errors; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgClientException() : base() ! { ! errors = new PgClientErrorCollection(); ! } ! ! public PgClientException(string message) : this() ! { ! this.message = message; ! } ! ! #endregion ! } ! } Index: PgClientMessageEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientMessageEventArgs.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgClientMessageEventArgs.cs 2 Aug 2003 19:43:02 -0000 1.1.1.1 --- PgClientMessageEventArgs.cs 9 Feb 2004 14:20:45 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgClientNotificationEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientNotificationEventArgs.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgClientNotificationEventArgs.cs 2 Aug 2003 19:43:02 -0000 1.1.1.1 --- PgClientNotificationEventArgs.cs 9 Feb 2004 14:20:45 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgCodes.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCodes.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgCodes.cs 5 Aug 2003 17:59:33 -0000 1.2 --- PgCodes.cs 9 Feb 2004 14:20:45 -0000 1.3 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgConnectionParams.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgConnectionParams.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgConnectionParams.cs 14 Dec 2003 15:07:13 -0000 1.3 --- PgConnectionParams.cs 9 Feb 2004 14:20:45 -0000 1.4 *************** *** 1,121 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Text; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgConnectionParams ! { ! #region Fields ! ! private string serverName; ! private string database; ! private string userName; ! private string userPassword; ! private int serverPort; ! private int packetSize; ! private int timeout; ! private bool pooling; ! private Encoding encoding; ! private bool ssl; ! ! #endregion ! ! #region Properties ! ! public string ServerName ! { ! get { return serverName; } ! set { serverName = value; } ! } ! ! public string Database ! { ! get { return database; } ! set { database = value; } ! } ! ! public string UserName ! { ! get { return userName; } ! set { userName = value; } ! } ! ! public string UserPassword ! { ! get { return userPassword; } ! set { userPassword = value; } ! } ! ! public int PacketSize ! { ! get { return packetSize; } ! set { packetSize = value; } ! } ! ! public int ServerPort ! { ! get { return serverPort; } ! set { serverPort = value; } ! } ! ! public Encoding Encoding ! { ! get { return encoding; } ! set { encoding = value; } ! } ! ! public int Timeout ! { ! get { return timeout; } ! set { timeout = value; } ! } ! ! public bool Pooling ! { ! get { return pooling; } ! set { pooling = value; } ! } ! ! public bool SSL ! { ! get { return ssl; } ! set { ssl = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgConnectionParams() ! { ! serverName = "localhost"; ! userName = "postgres"; ! userPassword = "postgres"; ! serverPort = 5432; ! packetSize = 8192; ! pooling = true; ! timeout = 15; ! encoding = Encoding.Default; ! } ! ! #endregion ! } } \ No newline at end of file --- 1,121 ---- ! /* 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.Text; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgConnectionParams ! { ! #region Fields ! ! private string serverName; ! private string database; ! private string userName; ! private string userPassword; ! private int serverPort; ! private int packetSize; ! private int timeout; ! private bool pooling; ! private Encoding encoding; ! private bool ssl; ! ! #endregion ! ! #region Properties ! ! public string ServerName ! { ! get { return serverName; } ! set { serverName = value; } ! } ! ! public string Database ! { ! get { return database; } ! set { database = value; } ! } ! ! public string UserName ! { ! get { return userName; } ! set { userName = value; } ! } ! ! public string UserPassword ! { ! get { return userPassword; } ! set { userPassword = value; } ! } ! ! public int PacketSize ! { ! get { return packetSize; } ! set { packetSize = value; } ! } ! ! public int ServerPort ! { ! get { return serverPort; } ! set { serverPort = value; } ! } ! ! public Encoding Encoding ! { ! get { return encoding; } ! set { encoding = value; } ! } ! ! public int Timeout ! { ! get { return timeout; } ! set { timeout = value; } ! } ! ! public bool Pooling ! { ! get { return pooling; } ! set { pooling = value; } ! } ! ! public bool SSL ! { ! get { return ssl; } ! set { ssl = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgConnectionParams() ! { ! serverName = "localhost"; ! userName = "postgres"; ! userPassword = "postgres"; ! serverPort = 5432; ! packetSize = 8192; ! pooling = true; ! timeout = 15; ! encoding = Encoding.Default; ! } ! ! #endregion ! } } \ No newline at end of file Index: PgDataType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDataType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgDataType.cs 26 Oct 2003 11:32:33 -0000 1.4 --- PgDataType.cs 9 Feb 2004 14:20:45 -0000 1.5 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** PgDbClient.cs 18 Dec 2003 10:27:32 -0000 1.40 --- PgDbClient.cs 9 Feb 2004 14:20:45 -0000 1.41 *************** *** 1,852 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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 [...1675 lines suppressed...] ! private void detach() ! { ! // Close streams ! if (sslStream != null) ! { ! sslStream.Close(); ! } ! if (networkStream != null) ! { ! networkStream.Close(); ! } ! if (socket != null) ! { ! socket.Close(); ! } ! } ! ! #endregion ! } ! } Index: PgFieldDescriptor.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgFieldDescriptor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgFieldDescriptor.cs 14 Dec 2003 15:07:13 -0000 1.2 --- PgFieldDescriptor.cs 9 Feb 2004 14:20:45 -0000 1.3 *************** *** 1,91 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgFieldDescriptor ! { ! #region Fields ! ! private string fieldName; ! private int oidTable; ! private short oidNumber; ! private PgType dataType; ! private short dataTypeSize; ! private int typeModifier; ! private short formatCode; ! ! #endregion ! ! #region Properties ! ! public string FieldName ! { ! get { return fieldName; } ! set { fieldName = value; } ! } ! ! public int OidTable ! { ! get { return oidTable; } ! set { oidTable = value; } ! } ! ! public short OidNumber ! { ! get { return oidNumber; } ! set { oidNumber = value; } ! } ! ! public PgType DataType ! { ! get { return dataType; } ! set { dataType = value; } ! } ! ! public short DataTypeSize ! { ! get { return dataTypeSize; } ! set { dataTypeSize = value; } ! } ! ! public int TypeModifier ! { ! get { return typeModifier; } ! set { typeModifier = value; } ! } ! ! public short FormatCode ! { ! get { return formatCode; } ! set { formatCode = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgFieldDescriptor() ! { ! } ! ! #endregion ! } ! } --- 1,91 ---- ! /* 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; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgFieldDescriptor ! { ! #region Fields ! ! private string fieldName; ! private int oidTable; ! private short oidNumber; ! private PgType dataType; ! private short dataTypeSize; ! private int typeModifier; ! private short formatCode; ! ! #endregion ! ! #region Properties ! ! public string FieldName ! { ! get { return fieldName; } ! set { fieldName = value; } ! } ! ! public int OidTable ! { ! get { return oidTable; } ! set { oidTable = value; } ! } ! ! public short OidNumber ! { ! get { return oidNumber; } ! set { oidNumber = value; } ! } ! ! public PgType DataType ! { ! get { return dataType; } ! set { dataType = value; } ! } ! ! public short DataTypeSize ! { ! get { return dataTypeSize; } ! set { dataTypeSize = value; } ! } ! ! public int TypeModifier ! { ! get { return typeModifier; } ! set { typeModifier = value; } ! } ! ! public short FormatCode ! { ! get { return formatCode; } ! set { formatCode = value; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgFieldDescriptor() ! { ! } ! ! #endregion ! } ! } Index: PgLayouts.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgLayouts.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgLayouts.cs 2 Aug 2003 19:43:02 -0000 1.1.1.1 --- PgLayouts.cs 9 Feb 2004 14:20:45 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PgOutputPacket.cs 18 Dec 2003 10:27:32 -0000 1.22 --- PgOutputPacket.cs 9 Feb 2004 14:20:45 -0000 1.23 *************** *** 1,488 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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.Net; ! using System.IO; ! using System.Text; ! using System.Globalization; ! ! using PostgreSql.Data.PgTypes; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgOutputPacket : BinaryWriter ! { ! #region Fields ! ! private Encoding encoding; ! ! #endregion ! ! #region Properties ! ! public long Position ! { ! get { return ((MemoryStream)BaseStream).Position; } ! } ! ! public long Length ! { ! get { return ((MemoryStream)BaseStream).Length; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgOutputPacket() : base(new MemoryStream()) ! { ! this.encoding = Encoding.Default; ! Write(new byte[0]); ! } ! ! public PgOutputPacket(Encoding encoding) : base(new MemoryStream(), encoding) ! { ! this.encoding = encoding; ! this.Write(new byte[0]); ! } ! ! #endregion ! ! #region String Types ! ! public void WriteString(string data) ! { ! if (!data.EndsWith(PgCodes.NULL_TERMINATOR.ToString())) ! { ! data += PgCodes.NULL_TERMINATOR; ! } ! this.Write(encoding.GetBytes(data)); ! } ! ! #endregion ! ! #region Numeric Types ! ! public void WriteShort(short val) ! { ! this.Write((short)IPAddress.HostToNetworkOrder(val)); ! } ! ! public void WriteInt(int val) ! { ! this.Write((int)IPAddress.HostToNetworkOrder(val)); ! } ! ! public void WriteLong(long val) ! { ! this.Write((long)IPAddress.HostToNetworkOrder(val)); ! } ! ! public void WriteFloat(float val) ! { ! FloatLayout floatValue = new FloatLayout(); ! ! floatValue.f = val; ! floatValue.i0 = IPAddress.HostToNetworkOrder(floatValue.i0); ! ! this.Write(floatValue.f); ! } ! ! public void WriteDouble(double val) ! { ! DoubleLayout doubleValue = new DoubleLayout(); ! int temp; ! ! doubleValue.d = val; ! doubleValue.i0 = IPAddress.HostToNetworkOrder(doubleValue.i0); ! doubleValue.i4 = IPAddress.HostToNetworkOrder(doubleValue.i4); ! ! temp = doubleValue.i0; ! doubleValue.i0 = doubleValue.i4; ! doubleValue.i4 = temp; ! ! this.Write(doubleValue.d); ! } ! ! #endregion ! ! #region Date & Time Types ! ! public void WriteDate(DateTime date) ! { ! TimeSpan days = date.Subtract(PgCodes.BASE_DATE); ! ! this.WriteInt(days.Days); ! } ! ! public void WriteInterval(TimeSpan interval) ! { ! int months = (interval.Days / 30); ! int days = (interval.Days % 30); ! ! this.WriteDouble(interval.Subtract(TimeSpan.FromDays(months * 30)).TotalSeconds); ! this.WriteInt(months); ! } ! ! public void WriteTime(DateTime time) ! { ! DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year, ! PgCodes.BASE_DATE.Month, ! PgCodes.BASE_DATE.Day, ! time.Hour, ! time.Minute, ! time.Second, ! time.Millisecond); ! ! TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE); ! ! this.WriteDouble(seconds.TotalSeconds); ! } ! ! public void WriteTimeWithTZ(DateTime time) ! { ! DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year, ! PgCodes.BASE_DATE.Month, ! PgCodes.BASE_DATE.Day, ! time.Hour, ! time.Minute, ! time.Second, ! time.Millisecond); ! ! TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE); ! ! this.WriteDouble(seconds.TotalSeconds); ! this.WriteInt((-1)*Int32.Parse(time.ToString("zz"))*3600); ! } ! ! public void WriteTimestamp(DateTime timestamp) ! { ! TimeSpan days = timestamp.Subtract(PgCodes.BASE_DATE); ! ! this.WriteDouble(days.TotalSeconds); ! } ! ! public void WriteTimestampWithTZ(DateTime timestamp) ! { ! this.WriteTimestamp(timestamp); ! } ! ! #endregion ! ! #region Geometric Types ! ! public void WritePoint(PgPoint point) ! { ! this.WriteDouble(point.X); ! this.WriteDouble(point.Y); ! } ! ! public void WriteCircle(PgCircle circle) ! { ! this.WritePoint(circle.Center); ! this.WriteDouble(circle.Radius); ! } ! ! public void WriteLine(PgLine line) ! { ! this.WritePoint(line.StartPoint); ! this.WritePoint(line.EndPoint); ! } ! ! public void WriteLSeg(PgLSeg lseg) ! { ! this.WritePoint(lseg.StartPoint); ! this.WritePoint(lseg.EndPoint); ! } ! ! public void WriteBox(PgBox box) ! { ! this.WritePoint(box.UpperRight); ! this.WritePoint(box.LowerLeft); ! } ! ! public void WritePolygon(PgPolygon polygon) ! { ! this.WriteInt(polygon.Points.Length); ! for (int i = 0; i < polygon.Points.Length; i++) ! { ! this.WritePoint(polygon.Points[i]); ! } ! } ! ! public void WritePath(PgPath path) ! { ! this.Write(path.IsClosedPath); ! this.WriteInt(path.Points.Length); ! for (int i = 0; i < path.Points.Length; i++) ! { ! this.WritePoint(path.Points[i]); ! } ! } ! ! #endregion ! ! #region Parameters ! ! public void WriteParameter(PgParameter parameter) ! { ! int size = parameter.DataType.Size; ! ! if (parameter.Value == System.DBNull.Value || ! parameter.Value == null) ! { ! // -1 indicates a NULL argument value ! this.WriteInt(-1); ! } ! else ! { ! if (parameter.DataType.DataType == PgDataType.Binary || ! parameter.DataType.DataType == PgDataType.Array || ! parameter.DataType.DataType == PgDataType.Vector) ! { ! // Handle this type as Array values ! System.Array array = (System.Array)parameter.Value; ! ! // Get array elements type info ! PgType elementType = PgDbClient.Types[parameter.DataType.ElementType]; ! size = elementType.Size; ! ! // Create a new packet for write array parameter information ! PgOutputPacket packet = new PgOutputPacket(); ! ! // Write the number of dimensions ! packet.WriteInt(array.Rank); ! ! // Write flags (always 0) ! packet.WriteInt(0); ! ! // Write base type of the array elements ! packet.WriteInt(parameter.DataType.ElementType); ! ! // Write lengths and lower bounds ! for (int i = 0; i < array.Rank; i ++) ! { ! packet.WriteInt(array.GetLength(i)); ! packet.WriteInt(array.GetLowerBound(i) + 1); ! } ! ! // Write array values ! foreach (object element in array) ! { ! this.writeParameter(packet, elementType.DataType, size, element); ! } ! ! // Write parameter size ! this.WriteInt(packet.GetByteCount()); ! // Write parameter data ! this.Write(packet.ToArray()); ! } ! else ! { ! this.writeParameter(this, parameter.DataType.DataType, size, parameter.Value); ! } ! } ! } ! ! #endregion ! ! #region Private Methods ! ! private void writeParameter(PgOutputPacket packet, PgDataType dataType, int size, object value) ! { ! switch (dataType) ! { ! case PgDataType.Binary: ! packet.WriteInt(((byte[])value).Length); ! packet.Write((byte[])value); ! break; ! ! case PgDataType.Byte: ! packet.WriteInt(size); ! packet.Write((byte)value); ! break; ! ! case PgDataType.Int2: ! packet.WriteInt(size); ! packet.WriteShort(Convert.ToInt16(value)); ! break; ! ! case PgDataType.Int4: ! packet.WriteInt(size); ! packet.WriteInt(Convert.ToInt32(value)); ! break; ! ! case PgDataType.Int8: ! packet.WriteInt(size); ! packet.WriteLong(Convert.ToInt64(value)); ! break; ! ! case PgDataType.Interval: ! packet.WriteInt(size); ! packet.WriteInterval(TimeSpan.Parse(value.ToString())); ! break; ! ! case PgDataType.Decimal: ! { ! string paramValue = value.ToString(); ! packet.WriteInt(encoding.GetByteCount(paramValue)); ! packet.Write(paramValue.ToCharArray()); ! } ! break; ! ! case PgDataType.Double: ! packet.WriteInt(size); ! packet.WriteDouble(Convert.ToDouble(value)); ! break; ! ! case PgDataType.Float: ! packet.WriteInt(size); ! packet.WriteFloat(Convert.ToSingle(value)); ! break; ! ! case PgDataType.Currency: ! packet.WriteInt(size); ! packet.WriteInt(Convert.ToInt32(Convert.ToSingle(value)*100)); ! break; ! ! case PgDataType.Date: ! packet.WriteInt(size); ! packet.WriteDate(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Time: ! packet.WriteInt(size); ! packet.WriteTime(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.TimeWithTZ: ! packet.WriteInt(size); ! packet.WriteTimeWithTZ(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Timestamp: ! packet.WriteInt(size); ! packet.WriteTimestamp(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.TimestampWithTZ: ! packet.WriteInt(size); ! packet.WriteTimestampWithTZ(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Char: ! case PgDataType.VarChar: ! { ! string paramValue = value.ToString() + PgCodes.NULL_TERMINATOR; ! packet.WriteInt(encoding.GetByteCount(paramValue)); ! packet.WriteString(paramValue); ! } ! break; ! ! case PgDataType.Point: ! packet.WriteInt(size); ! packet.WritePoint((PgPoint)value); ! break; ! ! case PgDataType.Circle: ! packet.WriteInt(size); ! packet.WriteCircle((PgCircle)value); ! break; ! ! case PgDataType.Line: ! packet.WriteInt(size); ! packet.WriteLine((PgLine)value); ! break; ! ! case PgDataType.LSeg: ! packet.WriteInt(size); ! packet.WriteLSeg((PgLSeg)value); ! break; ! ! case PgDataType.Box: ! packet.WriteInt(size); ! packet.WriteBox((PgBox)value); ! break; ! ! case PgDataType.Polygon: ! PgPolygon polygon = (PgPolygon)value; ! ! packet.WriteInt((size*polygon.Points.Length) + 4); ! packet.WritePolygon(polygon); ! break; ! ! case PgDataType.Path: ! PgPath path = (PgPath)value; ! ! packet.WriteInt((size*path.Points.Length) + 5); ! packet.WritePath(path); ! break; ! } ! } ! ! #endregion ! ! #region Stream Methods ! ! public int GetByteCount() ! { ! return (int)((MemoryStream)BaseStream).Length; ! } ! ! public byte[] ToArray() ! { ! return ((MemoryStream)BaseStream).ToArray(); ! } ! ! public void Reset() ! { ! ((MemoryStream)BaseStream).SetLength(0); ! ((MemoryStream)BaseStream).Position = 0; ! } ! ! #endregion ! ! #region Packet Methods ! ! public byte[] GetSimplePacketBytes() ! { ! PgOutputPacket packet = new PgOutputPacket(); ! ! // Write packet contents ! packet.WriteInt(GetByteCount() + 4); ! packet.Write(ToArray()); ! ! return packet.ToArray(); ! } ! ! public byte[] GetPacketBytes(char format) ! { ! PgOutputPacket packet = new PgOutputPacket(); ! ! packet.Write((byte)format); ! packet.WriteInt(GetByteCount() + 4); ! packet.Write(ToArray()); ! ! return packet.ToArray(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,488 ---- ! /* 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.Net; ! using System.IO; ! using System.Text; ! using System.Globalization; ! ! using PostgreSql.Data.PgTypes; ! ! namespace PostgreSql.Data.NPgClient ! { ! internal class PgOutputPacket : BinaryWriter ! { ! #region Fields ! ! private Encoding encoding; ! ! #endregion ! ! #region Properties ! ! public long Position ! { ! get { return ((MemoryStream)BaseStream).Position; } ! } ! ! public long Length ! { ! get { return ((MemoryStream)BaseStream).Length; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgOutputPacket() : base(new MemoryStream()) ! { ! this.encoding = Encoding.Default; ! Write(new byte[0]); ! } ! ! public PgOutputPacket(Encoding encoding) : base(new MemoryStream(), encoding) ! { ! this.encoding = encoding; ! this.Write(new byte[0]); ! } ! ! #endregion ! ! #region String Types ! ! public void WriteString(string data) ! { ! if (!data.EndsWith(PgCodes.NULL_TERMINATOR.ToString())) ! { ! data += PgCodes.NULL_TERMINATOR; ! } ! this.Write(encoding.GetBytes(data)); ! } ! ! #endregion ! ! #region Numeric Types ! ! public void WriteShort(short val) ! { ! this.Write((short)IPAddress.HostToNetworkOrder(val)); ! } ! ! public void WriteInt(int val) ! { ! this.Write((int)IPAddress.HostToNetworkOrder(val)); ! } ! ! public void WriteLong(long val) ! { ! this.Write((long)IPAddress.HostToNetworkOrder(val)); ! } ! ! public void WriteFloat(float val) ! { ! FloatLayout floatValue = new FloatLayout(); ! ! floatValue.f = val; ! floatValue.i0 = IPAddress.HostToNetworkOrder(floatValue.i0); ! ! this.Write(floatValue.f); ! } ! ! public void WriteDouble(double val) ! { ! DoubleLayout doubleValue = new DoubleLayout(); ! int temp; ! ! doubleValue.d = val; ! doubleValue.i0 = IPAddress.HostToNetworkOrder(doubleValue.i0); ! doubleValue.i4 = IPAddress.HostToNetworkOrder(doubleValue.i4); ! ! temp = doubleValue.i0; ! doubleValue.i0 = doubleValue.i4; ! doubleValue.i4 = temp; ! ! this.Write(doubleValue.d); ! } ! ! #endregion ! ! #region Date & Time Types ! ! public void WriteDate(DateTime date) ! { ! TimeSpan days = date.Subtract(PgCodes.BASE_DATE); ! ! this.WriteInt(days.Days); ! } ! ! public void WriteInterval(TimeSpan interval) ! { ! int months = (interval.Days / 30); ! int days = (interval.Days % 30); ! ! this.WriteDouble(interval.Subtract(TimeSpan.FromDays(months * 30)).TotalSeconds); ! this.WriteInt(months); ! } ! ! public void WriteTime(DateTime time) ! { ! DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year, ! PgCodes.BASE_DATE.Month, ! PgCodes.BASE_DATE.Day, ! time.Hour, ! time.Minute, ! time.Second, ! time.Millisecond); ! ! TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE); ! ! this.WriteDouble(seconds.TotalSeconds); ! } ! ! public void WriteTimeWithTZ(DateTime time) ! { ! DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year, ! PgCodes.BASE_DATE.Month, ! PgCodes.BASE_DATE.Day, ! time.Hour, ! time.Minute, ! time.Second, ! time.Millisecond); ! ! TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE); ! ! this.WriteDouble(seconds.TotalSeconds); ! this.WriteInt((-1)*Int32.Parse(time.ToString("zz"))*3600); ! } ! ! public void WriteTimestamp(DateTime timestamp) ! { ! TimeSpan days = timestamp.Subtract(PgCodes.BASE_DATE); ! ! this.WriteDouble(days.TotalSeconds); ! } ! ! public void WriteTimestampWithTZ(DateTime timestamp) ! { ! this.WriteTimestamp(timestamp); ! } ! ! #endregion ! ! #region Geometric Types ! ! public void WritePoint(PgPoint point) ! { ! this.WriteDouble(point.X); ! this.WriteDouble(point.Y); ! } ! ! public void WriteCircle(PgCircle circle) ! { ! this.WritePoint(circle.Center); ! this.WriteDouble(circle.Radius); ! } ! ! public void WriteLine(PgLine line) ! { ! this.WritePoint(line.StartPoint); ! this.WritePoint(line.EndPoint); ! } ! ! public void WriteLSeg(PgLSeg lseg) ! { ! this.WritePoint(lseg.StartPoint); ! this.WritePoint(lseg.EndPoint); ! } ! ! public void WriteBox(PgBox box) ! { ! this.WritePoint(box.UpperRight); ! this.WritePoint(box.LowerLeft); ! } ! ! public void WritePolygon(PgPolygon polygon) ! { ! this.WriteInt(polygon.Points.Length); ! for (int i = 0; i < polygon.Points.Length; i++) ! { ! this.WritePoint(polygon.Points[i]); ! } ! } ! ! public void WritePath(PgPath path) ! { ! this.Write(path.IsClosedPath); ! this.WriteInt(path.Points.Length); ! for (int i = 0; i < path.Points.Length; i++) ! { ! this.WritePoint(path.Points[i]); ! } ! } ! ! #endregion ! ! #region Parameters ! ! public void WriteParameter(PgParameter parameter) ! ... [truncated message content] |
From: <car...@us...> - 2004-02-10 01:12:56
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14114 Modified Files: dos2unix.sh Log Message: Minor fixes Index: dos2unix.sh =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/dos2unix.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dos2unix.sh 9 Feb 2004 10:46:13 -0000 1.1 --- dos2unix.sh 9 Feb 2004 14:21:53 -0000 1.2 *************** *** 3,9 **** base_dir=./Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls ! TLS_PATH=$base_dir/Mono.Math:$base_dir/Mono.Math.Prime:$base_dir/Mono.Math.Prime.Generator TLS_PATH=$TLS_PATH:$base_dir/Mono.Math:$base_dir/Mono.Math.Prime:$base_dir/Mono.Math.Prime.Generator ! TLS_PATH=$base_dir/Mono.Security:$base_dir/Mono.Security/Mono.Security.Cryptography:$base_dir/Mono.Security/Mono.Security.X509: TLS_PATH=$TLS_PATH:$base_dir/Mono.Security.Protocol.Tls.Alerts:$base_dir/Mono.Security.Protocol.Tls.Handshake:$base_dir/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client:$base_dir/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server --- 3,10 ---- base_dir=./Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls ! TLS_PATH=./base_dir TLS_PATH=$TLS_PATH:$base_dir/Mono.Math:$base_dir/Mono.Math.Prime:$base_dir/Mono.Math.Prime.Generator ! TLS_PATH=$TLS_PATH:$base_dir/Mono.Math:$base_dir/Mono.Math.Prime:$base_dir/Mono.Math.Prime.Generator ! TLS_PATH=$TLS_PATH:$base_dir/Mono.Security:$base_dir/Mono.Security/Mono.Security.Cryptography:$base_dir/Mono.Security/Mono.Security.X509: TLS_PATH=$TLS_PATH:$base_dir/Mono.Security.Protocol.Tls.Alerts:$base_dir/Mono.Security.Protocol.Tls.Handshake:$base_dir/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client:$base_dir/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server |
From: <car...@us...> - 2004-02-10 01:01:47
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/Design/ParameterCollection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13638 Modified Files: PgParameterCollectionEditor.cs PgParameterConverter.cs Log Message: Updated license headers Index: PgParameterCollectionEditor.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/Design/ParameterCollection/PgParameterCollectionEditor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgParameterCollectionEditor.cs 2 Oct 2003 18:16:59 -0000 1.1 --- PgParameterCollectionEditor.cs 9 Feb 2004 14:20:06 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgParameterConverter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/Design/ParameterCollection/PgParameterConverter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgParameterConverter.cs 2 Oct 2003 18:16:59 -0000 1.1 --- PgParameterConverter.cs 9 Feb 2004 14:20:06 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13433 Modified Files: IDbSchema.cs PgAbstractDbSchema.cs 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 Log Message: Updated license headers Index: IDbSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/IDbSchema.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IDbSchema.cs 2 Aug 2003 19:43:01 -0000 1.1.1.1 --- IDbSchema.cs 9 Feb 2004 14:19:48 -0000 1.2 *************** *** 1,4 **** /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez * * This library is free software; you can redistribute it and/or --- 1,4 ---- /* 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 Index: PgAbstractDbSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgAbstractDbSchema.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgAbstractDbSchema.cs 18 Dec 2003 11:46:52 -0000 1.4 --- PgAbstractDbSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 *************** *** 1,465 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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 PgAbstractDbSchema : IDbSchema ! { ! #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 PgAbstractDbSchema() ! { ! restrictionColumns = new ArrayList(); ! dataColumns = new ArrayList(); ! tables = new ArrayList(); ! joins = new ArrayList(); ! orderByColumns = new ArrayList(); ! whereFilters = new ArrayList(); ! ! AddTables(); ! AddRestrictionColumns(); ! AddDataColumns(); ! AddJoins(); ! AddOrderByColumns(); ! AddWhereFilters(); ! } ! ! public PgAbstractDbSchema(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 ! } ! } --- 1,465 ---- ! /* 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 PgAbstractDbSchema : IDbSchema ! { ! #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 PgAbstractDbSchema() ! { ! restrictionColumns = new ArrayList(); ! dataColumns = new ArrayList(); ! tables = new ArrayList(); ! joins = new ArrayList(); ! orderByColumns = new ArrayList(); ! whereFilters = new ArrayList(); ! ! AddTables(); ! AddRestrictionColumns(); ! AddDataColumns(); ! AddJoins(); ! AddOrderByColumns(); ! AddWhereFilters(); ! } ! ! public PgAbstractDbSchema(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: PgAggregatesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgAggregatesSchema.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgAggregatesSchema.cs 18 Dec 2003 11:46:52 -0000 1.4 --- PgAggregatesSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 *************** *** 1,82 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgAggregatesSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgAggregatesSchema() : base("Aggregates") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_aggregate"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_aggregate.aggfnoid", "AGGREGATE_FUNCTION", null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_aggregate.aggtransfn" , "TRANSITION_FUNCTION"); ! AddDataColumn("pg_aggregate.aggfinalfn" , "FINAL_FUNCTION"); ! AddDataColumn("pg_aggregate.agginitval" , "INITIAL_VALUE"); ! AddDataColumn("pg_type.typname" , "BASE_TYPE"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_type", "pg_aggregate.aggtranstype = pg_type.oid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_aggregate.aggfnoid"); ! } ! ! public override void AddWhereFilters() ! { ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! return parsed; ! } ! ! #endregion ! } } \ No newline at end of file --- 1,82 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgAggregatesSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgAggregatesSchema() : base("Aggregates") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_aggregate"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_aggregate.aggfnoid", "AGGREGATE_FUNCTION", null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_aggregate.aggtransfn" , "TRANSITION_FUNCTION"); ! AddDataColumn("pg_aggregate.aggfinalfn" , "FINAL_FUNCTION"); ! AddDataColumn("pg_aggregate.agginitval" , "INITIAL_VALUE"); ! AddDataColumn("pg_type.typname" , "BASE_TYPE"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_type", "pg_aggregate.aggtranstype = pg_type.oid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_aggregate.aggfnoid"); ! } ! ! public override void AddWhereFilters() ! { ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! return parsed; ! } ! ! #endregion ! } } \ No newline at end of file Index: PgCastsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCastsSchema.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgCastsSchema.cs 18 Dec 2003 11:46:52 -0000 1.4 --- PgCastsSchema.cs 9 Feb 2004 14:19:48 -0000 1.5 *************** *** 1,102 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgCastsSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgCastsSchema() : base("Casts") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_cast"); ! } ! ! public override void AddRestrictionColumns() ! { ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_typesrc.typname" , "SOURCE_TYPE"); ! AddDataColumn("pg_typetgt.typname" , "TARGET_TYPE"); ! AddDataColumn("pg_namespace.nspname", "FUNCTION_SCHEMA"); ! AddDataColumn("pg_proc.proname" , "FUNCTION_NAME"); ! AddDataColumn(getContextExpression("pg_cast.castcontext"), "CAST_CONTEXT"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_type as pg_typesrc", "pg_cast.castsource = pg_typesrc.oid"); ! AddJoin("left join", "pg_type as pg_typetgt", "pg_cast.casttarget = pg_typetgt.oid"); ! AddJoin("left join", "pg_proc" , "pg_cast.castfunc = pg_proc.oid"); ! AddJoin("left join", "pg_namespace" , "pg_proc.pronamespace = pg_namespace.oid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_proc.proname"); ! } ! ! public override void AddWhereFilters() ! { ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getContextExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'e' THEN 'EXPLICIT'"); ! expression.Append(" when 'a' THEN 'ASSIGNMENT'"); ! expression.Append(" when 'i' THEN 'EXPRESSIONS'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,102 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgCastsSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgCastsSchema() : base("Casts") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_cast"); ! } ! ! public override void AddRestrictionColumns() ! { ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_typesrc.typname" , "SOURCE_TYPE"); ! AddDataColumn("pg_typetgt.typname" , "TARGET_TYPE"); ! AddDataColumn("pg_namespace.nspname", "FUNCTION_SCHEMA"); ! AddDataColumn("pg_proc.proname" , "FUNCTION_NAME"); ! AddDataColumn(getContextExpression("pg_cast.castcontext"), "CAST_CONTEXT"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_type as pg_typesrc", "pg_cast.castsource = pg_typesrc.oid"); ! AddJoin("left join", "pg_type as pg_typetgt", "pg_cast.casttarget = pg_typetgt.oid"); ! AddJoin("left join", "pg_proc" , "pg_cast.castfunc = pg_proc.oid"); ! AddJoin("left join", "pg_namespace" , "pg_proc.pronamespace = pg_namespace.oid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_proc.proname"); ! } ! ! public override void AddWhereFilters() ! { ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getContextExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'e' THEN 'EXPLICIT'"); ! expression.Append(" when 'a' THEN 'ASSIGNMENT'"); ! expression.Append(" when 'i' THEN 'EXPRESSIONS'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } } \ No newline at end of file Index: PgCheckConstraints.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCheckConstraints.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgCheckConstraints.cs 18 Dec 2003 11:46:52 -0000 1.4 --- PgCheckConstraints.cs 9 Feb 2004 14:19:48 -0000 1.5 *************** *** 1,127 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgCheckConstraintsSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgCheckConstraintsSchema() : base("CheckConstraints") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_constraint"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_namespace.nspname", "CONSTRAINT_SCHEMA", null); ! AddRestrictionColumn("pg_constraint.conname", "CONSTRAINT_NAME", null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_get_constraintdef(pg_constraint.oid)", "CHECK_CLAUSULE"); ! AddDataColumn("pg_description.description", "DESCRIPTION"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_namespace" , "pg_constraint.connamespace = pg_namespace.oid"); ! AddJoin("left join", "pg_description" , "pg_constraint.oid = pg_description.objoid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_namespace.nspname"); ! AddOrderBy("pg_constraint.conname"); ! } ! ! public override void AddWhereFilters() ! { ! AddWhereFilter("pg_constraint.contype = 'c'"); ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! if (parsed != null) ! { ! if (parsed.Length == 7 && parsed[6] != null) ! { ! switch (parsed[6].ToString().ToUpper()) ! { ! case "UNIQUE": ! parsed[3] = "u"; ! break; ! ! case "PRIMARY KEY": ! parsed[3] = "p"; ! break; ! ! case "FOREIGN KEY": ! parsed[3] = "f"; ! break; ! ! case "CHECK": ! parsed[3] = "c"; ! break; ! } ! } ! } ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getConstraintTypeExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'u' THEN 'UNIQUE'"); ! expression.Append(" when 'p' THEN 'PRIMARY KEY'"); ! expression.Append(" when 'f' THEN 'FOREIGN KEY'"); ! expression.Append(" when 'c' THEN 'CHECK'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,127 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgCheckConstraintsSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgCheckConstraintsSchema() : base("CheckConstraints") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_constraint"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_namespace.nspname", "CONSTRAINT_SCHEMA", null); ! AddRestrictionColumn("pg_constraint.conname", "CONSTRAINT_NAME", null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_get_constraintdef(pg_constraint.oid)", "CHECK_CLAUSULE"); ! AddDataColumn("pg_description.description", "DESCRIPTION"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_namespace" , "pg_constraint.connamespace = pg_namespace.oid"); ! AddJoin("left join", "pg_description" , "pg_constraint.oid = pg_description.objoid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_namespace.nspname"); ! AddOrderBy("pg_constraint.conname"); ! } ! ! public override void AddWhereFilters() ! { ! AddWhereFilter("pg_constraint.contype = 'c'"); ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! if (parsed != null) ! { ! if (parsed.Length == 7 && parsed[6] != null) ! { ! switch (parsed[6].ToString().ToUpper()) ! { ! case "UNIQUE": ! parsed[3] = "u"; ! break; ! ! case "PRIMARY KEY": ! parsed[3] = "p"; ! break; ! ! case "FOREIGN KEY": ! parsed[3] = "f"; ! break; ! ! case "CHECK": ! parsed[3] = "c"; ! break; ! } ! } ! } ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getConstraintTypeExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'u' THEN 'UNIQUE'"); ! expression.Append(" when 'p' THEN 'PRIMARY KEY'"); ! expression.Append(" when 'f' THEN 'FOREIGN KEY'"); ! expression.Append(" when 'c' THEN 'CHECK'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } } \ No newline at end of file Index: PgCheckConstraintsByTable.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCheckConstraintsByTable.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgCheckConstraintsByTable.cs 18 Dec 2003 11:46:52 -0000 1.4 --- PgCheckConstraintsByTable.cs 9 Feb 2004 14:19:48 -0000 1.5 *************** *** 1,133 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgCheckConstraintsByTableSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgCheckConstraintsByTableSchema() : base("CheckConstraintsByTable") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_constraint"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_namespace.nspname" , "CONSTRAINT_SCHEMA" , null); ! AddRestrictionColumn("pg_constraint.conname", "CONSTRAINT_NAME" , null); ! AddRestrictionColumn("tbn.nspname" , "TABLE_SCHEMA" , null); ! AddRestrictionColumn("pg_class.relname" , "TABLE_NAME" , null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_get_constraintdef(pg_constraint.oid)", "CHECK_CLAUSULE"); ! AddDataColumn("pg_description.description", "DESCRIPTION"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_class" , "pg_class.oid = pg_constraint.conrelid"); ! AddJoin("left join", "pg_namespace tbn" , "pg_class.relnamespace = tbn.oid"); ! AddJoin("left join", "pg_namespace" , "pg_constraint.connamespace = pg_namespace.oid"); ! AddJoin("left join", "pg_description" , "pg_constraint.oid = pg_description.objoid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_namespace.nspname"); ! AddOrderBy("pg_class.relname"); ! AddOrderBy("pg_constraint.conname"); ! } ! ! public override void AddWhereFilters() ! { ! AddWhereFilter("pg_constraint.contype = 'c'"); ! AddWhereFilter("pg_class.relkind = 'r'"); ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! if (parsed != null) ! { ! if (parsed.Length == 7 && parsed[6] != null) ! { ! switch (parsed[6].ToString().ToUpper()) ! { ! case "UNIQUE": ! parsed[3] = "u"; ! break; ! ! case "PRIMARY KEY": ! parsed[3] = "p"; ! break; ! ! case "FOREIGN KEY": ! parsed[3] = "f"; ! break; ! ! case "CHECK": ! parsed[3] = "c"; ! break; ! } ! } ! } ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getConstraintTypeExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'u' THEN 'UNIQUE'"); ! expression.Append(" when 'p' THEN 'PRIMARY KEY'"); ! expression.Append(" when 'f' THEN 'FOREIGN KEY'"); ! expression.Append(" when 'c' THEN 'CHECK'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,133 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgCheckConstraintsByTableSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgCheckConstraintsByTableSchema() : base("CheckConstraintsByTable") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_constraint"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_namespace.nspname" , "CONSTRAINT_SCHEMA" , null); ! AddRestrictionColumn("pg_constraint.conname", "CONSTRAINT_NAME" , null); ! AddRestrictionColumn("tbn.nspname" , "TABLE_SCHEMA" , null); ! AddRestrictionColumn("pg_class.relname" , "TABLE_NAME" , null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_get_constraintdef(pg_constraint.oid)", "CHECK_CLAUSULE"); ! AddDataColumn("pg_description.description", "DESCRIPTION"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_class" , "pg_class.oid = pg_constraint.conrelid"); ! AddJoin("left join", "pg_namespace tbn" , "pg_class.relnamespace = tbn.oid"); ! AddJoin("left join", "pg_namespace" , "pg_constraint.connamespace = pg_namespace.oid"); ! AddJoin("left join", "pg_description" , "pg_constraint.oid = pg_description.objoid"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_namespace.nspname"); ! AddOrderBy("pg_class.relname"); ! AddOrderBy("pg_constraint.conname"); ! } ! ! public override void AddWhereFilters() ! { ! AddWhereFilter("pg_constraint.contype = 'c'"); ! AddWhereFilter("pg_class.relkind = 'r'"); ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! if (parsed != null) ! { ! if (parsed.Length == 7 && parsed[6] != null) ! { ! switch (parsed[6].ToString().ToUpper()) ! { ! case "UNIQUE": ! parsed[3] = "u"; ! break; ! ! case "PRIMARY KEY": ! parsed[3] = "p"; ! break; ! ! case "FOREIGN KEY": ! parsed[3] = "f"; ! break; ! ! case "CHECK": ! parsed[3] = "c"; ! break; ! } ! } ! } ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getConstraintTypeExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'u' THEN 'UNIQUE'"); ! expression.Append(" when 'p' THEN 'PRIMARY KEY'"); ! expression.Append(" when 'f' THEN 'FOREIGN KEY'"); ! expression.Append(" when 'c' THEN 'CHECK'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } } \ No newline at end of file Index: PgColumnsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgColumnsSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgColumnsSchema.cs 18 Dec 2003 11:46:52 -0000 1.6 --- PgColumnsSchema.cs 9 Feb 2004 14:19:48 -0000 1.7 *************** *** 1,132 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgColumnsSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgColumnsSchema() : base("Columns") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_attribute"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_namespace.nspname" , "TABLE_SCHEMA", null); ! AddRestrictionColumn("pg_class.relname" , "TABLE_NAME", null); ! AddRestrictionColumn("pg_attribute.attname" , "COLUMN_NAME", null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_attribute.atttypid" , "DATA_TYPE"); ! AddDataColumn("pg_attribute.attlen" , "COLUMN_SIZE"); ! AddDataColumn("pg_attribute.attndims" , "COLUMN_DIMENSIONS"); ! AddDataColumn("pg_attribute.attnum" , "ORDINAL_POSITION"); ! AddDataColumn("pg_attribute.atthasdef" , "HAS_DEFAULT"); ! AddDataColumn("pg_attrdef.adsrc" , "COLUMN_DEFAULT"); ! AddDataColumn("pg_attribute.attnotnull" , "IS_NOT_NULL"); ! AddDataColumn("(pg_depend.objid is not null)", "IS_AUTOINCREMENT"); ! AddDataColumn(getStorageExpression("pg_attribute.attstorage"), "STORAGE"); ! AddDataColumn("pg_description.description", "DESCRIPTION"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_class" , "pg_attribute.attrelid = pg_class.oid"); ! AddJoin("left join", "pg_namespace" , "pg_class.relnamespace = pg_namespace.oid"); ! AddJoin("left join", "pg_attrdef" , "(pg_class.oid = pg_attrdef.adrelid AND pg_attribute.attnum = pg_attrdef.adnum)"); ! AddJoin("left join", "pg_description", "(pg_attribute.attrelid = pg_description.objoid AND pg_attribute.attnum = pg_description.objsubid)"); ! AddJoin("left join", ! "pg_depend", ! "(pg_attribute.attrelid = pg_depend.refobjid AND pg_attribute.attnum = pg_depend.refobjsubid AND pg_depend.deptype = 'i')"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_namespace.nspname"); ! AddOrderBy("pg_class.relname"); ! AddOrderBy("pg_attribute.attnum"); ! } ! ! public override void AddWhereFilters() ! { ! // Do not get dropped columns ! AddWhereFilter("pg_attribute.attisdropped = false"); ! // Get only columns with a number > 0 ! AddWhereFilter("pg_attribute.attnum > 0"); ! } ! ! #endregion ! ! #region Parse Methods ! ! public override object[] ParseRestrictions(object[] restrictions) ! { ! object[] parsed = restrictions; ! ! return parsed; ! } ! ! #endregion ! ! #region Private Methods ! ! private string getSerialExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 0 THEN true"); ! expression.Append(" default THEN false"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! private string getStorageExpression(string fieldName) ! { ! StringBuilder expression = new StringBuilder(); ! ! expression.AppendFormat(" case {0} ", fieldName); ! expression.Append(" when 'p' THEN 'PLAIN'"); ! expression.Append(" when 'e' THEN 'EXTERNAL'"); ! expression.Append(" when 'm' THEN 'MAIN'"); ! expression.Append(" when 'x' THEN 'EXTENDED'"); ! expression.Append(" END "); ! ! return expression.ToString(); ! } ! ! #endregion ! } ! } --- 1,132 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgSqlClient.DbSchema ! { ! internal class PgColumnsSchema : PgAbstractDbSchema ! { ! #region Constructors ! ! public PgColumnsSchema() : base("Columns") ! { ! } ! ! #endregion ! ! #region Add Methods ! ! public override void AddTables() ! { ! AddTable("pg_attribute"); ! } ! ! public override void AddRestrictionColumns() ! { ! AddRestrictionColumn("pg_namespace.nspname" , "TABLE_SCHEMA", null); ! AddRestrictionColumn("pg_class.relname" , "TABLE_NAME", null); ! AddRestrictionColumn("pg_attribute.attname" , "COLUMN_NAME", null); ! } ! ! public override void AddDataColumns() ! { ! AddDataColumn("pg_attribute.atttypid" , "DATA_TYPE"); ! AddDataColumn("pg_attribute.attlen" , "COLUMN_SIZE"); ! AddDataColumn("pg_attribute.attndims" , "COLUMN_DIMENSIONS"); ! AddDataColumn("pg_attribute.attnum" , "ORDINAL_POSITION"); ! AddDataColumn("pg_attribute.atthasdef" , "HAS_DEFAULT"); ! AddDataColumn("pg_attrdef.adsrc" , "COLUMN_DEFAULT"); ! AddDataColumn("pg_attribute.attnotnull" , "IS_NOT_NULL"); ! AddDataColumn("(pg_depend.objid is not null)", "IS_AUTOINCREMENT"); ! AddDataColumn(getStorageExpression("pg_attribute.attstorage"), "STORAGE"); ! AddDataColumn("pg_description.description", "DESCRIPTION"); ! } ! ! public override void AddJoins() ! { ! AddJoin("left join", "pg_class" , "pg_attribute.attrelid = pg_class.oid"); ! AddJoin("left join", "pg_namespace" , "pg_class.relnamespace = pg_namespace.oid"); ! AddJoin("left join", "pg_attrdef" , "(pg_class.oid = pg_attrdef.adrelid AND pg_attribute.attnum = pg_attrdef.adnum)"); ! AddJoin("left join", "pg_description", "(pg_attribute.attrelid = pg_description.objoid AND pg_attribute.attnum = pg_description.objsubid)"); ! AddJoin("left join", ! "pg_depend", ! "(pg_attribute.attrelid = pg_depend.refobjid AND pg_attribute.attnum = pg_depend.refobjsubid AND pg_depend.deptype = 'i')"); ! } ! ! public override void AddOrderByColumns() ! { ! AddOrderBy("pg_namespace.nspname"); ! AddOrderBy("pg_class.relname"); ! AddOrderBy("pg_attribute.attnum"); ! } ! ! public override void AddWhereFilters() ! { ! // Do not get dropped columns ! AddWhereFilter("pg_attribute.attisdropped = false"); ! // Get only columns with a number > 0 ! ... [truncated message content] |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13845 Modified Files: PgBox.cs PgCircle.cs PgLine.cs PgLSeg.cs PgPath.cs PgPoint.cs PgPolygon.cs PgTimeSpan.cs Log Message: Updated license headers Index: PgBox.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgBox.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgBox.cs 3 Jan 2004 15:44:10 -0000 1.9 --- PgBox.cs 9 Feb 2004 14:21:04 -0000 1.10 *************** *** 1,133 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgBox ! { ! #region Fields ! ! private PgPoint upperRight; ! private PgPoint lowerLeft; ! ! #endregion ! ! #region Properties ! ! public PgPoint UpperRight ! { ! get { return upperRight; } ! } ! ! public PgPoint LowerLeft ! { ! get { return lowerLeft; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgBox(PgPoint lowerLeft, PgPoint upperRight) ! { ! this.lowerLeft = lowerLeft; ! this.upperRight = upperRight; ! } ! ! public PgBox(double x1, double y1, double x2, double y2) ! { ! this.lowerLeft = new PgPoint(x1, y1); ! this.upperRight = new PgPoint(x2, y2); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgBox left, PgBox right) ! { ! if (left.UpperRight == right.UpperRight && ! left.LowerLeft == right.LowerLeft) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! public static bool operator !=(PgBox left, PgBox right) ! { ! if (left.UpperRight != right.UpperRight || ! left.LowerLeft != right.LowerLeft) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("(({0},{1}),({2},{3}))", ! this.lowerLeft.X , this.lowerLeft.Y, ! this.upperRight.X , this.upperRight.Y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgBox) ! { ! return ((PgBox)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgBox Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,133 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgBox ! { ! #region Fields ! ! private PgPoint upperRight; ! private PgPoint lowerLeft; ! ! #endregion ! ! #region Properties ! ! public PgPoint UpperRight ! { ! get { return upperRight; } ! } ! ! public PgPoint LowerLeft ! { ! get { return lowerLeft; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgBox(PgPoint lowerLeft, PgPoint upperRight) ! { ! this.lowerLeft = lowerLeft; ! this.upperRight = upperRight; ! } ! ! public PgBox(double x1, double y1, double x2, double y2) ! { ! this.lowerLeft = new PgPoint(x1, y1); ! this.upperRight = new PgPoint(x2, y2); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgBox left, PgBox right) ! { ! if (left.UpperRight == right.UpperRight && ! left.LowerLeft == right.LowerLeft) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! public static bool operator !=(PgBox left, PgBox right) ! { ! if (left.UpperRight != right.UpperRight || ! left.LowerLeft != right.LowerLeft) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("(({0},{1}),({2},{3}))", ! this.lowerLeft.X , this.lowerLeft.Y, ! this.upperRight.X , this.upperRight.Y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgBox) ! { ! return ((PgBox)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgBox Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgCircle.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgCircle.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgCircle.cs 3 Jan 2004 15:44:10 -0000 1.7 --- PgCircle.cs 9 Feb 2004 14:21:04 -0000 1.8 *************** *** 1,130 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgCircle ! { ! #region Fields ! ! private PgPoint center; ! private double radius; ! ! #endregion ! ! #region Properties ! ! public PgPoint Center ! { ! get { return center; } ! } ! ! public double Radius ! { ! get { return radius; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgCircle(PgPoint center, double radius) ! { ! this.center = center; ! this.radius = radius; ! } ! ! public PgCircle(double x, double y, double radius) ! { ! this.center = new PgPoint(x, y); ! this.radius = radius; ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgCircle left, PgCircle right) ! { ! if (left.Center == right.Center && left.Radius == right.Radius) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! public static bool operator !=(PgCircle left, PgCircle right) ! { ! if (left.Center != right.Center || left.Radius != right.Radius) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("<({0},{1}),{2}>", ! this.center.X, this.center.Y, this.radius); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgCircle) ! { ! return ((PgCircle)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgCircle Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,130 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgCircle ! { ! #region Fields ! ! private PgPoint center; ! private double radius; ! ! #endregion ! ! #region Properties ! ! public PgPoint Center ! { ! get { return center; } ! } ! ! public double Radius ! { ! get { return radius; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgCircle(PgPoint center, double radius) ! { ! this.center = center; ! this.radius = radius; ! } ! ! public PgCircle(double x, double y, double radius) ! { ! this.center = new PgPoint(x, y); ! this.radius = radius; ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgCircle left, PgCircle right) ! { ! if (left.Center == right.Center && left.Radius == right.Radius) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! public static bool operator !=(PgCircle left, PgCircle right) ! { ! if (left.Center != right.Center || left.Radius != right.Radius) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("<({0},{1}),{2}>", ! this.center.X, this.center.Y, this.radius); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgCircle) ! { ! return ((PgCircle)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgCircle Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgLine.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgLine.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgLine.cs 3 Jan 2004 15:44:10 -0000 1.7 --- PgLine.cs 9 Feb 2004 14:21:04 -0000 1.8 *************** *** 1,133 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgLine ! { ! #region Fields ! ! private PgPoint startPoint; ! private PgPoint endPoint; ! ! #endregion ! ! #region Properties ! ! public PgPoint StartPoint ! { ! get { return startPoint; } ! } ! ! public PgPoint EndPoint ! { ! get { return endPoint; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgLine(PgPoint startPoint, PgPoint endPoint) ! { ! this.startPoint = startPoint; ! this.endPoint = endPoint; ! } ! ! public PgLine(double x1, double y1, double x2, double y2) ! { ! this.startPoint = new PgPoint(x1, y1); ! this.endPoint = new PgPoint(x2, y2); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgLine left, PgLine right) ! { ! if (left.StartPoint == right.StartPoint && ! left.EndPoint == right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! public static bool operator !=(PgLine left, PgLine right) ! { ! if (left.StartPoint != right.StartPoint || ! left.EndPoint != right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("(({0},{1}),({2},{3}))", ! this.startPoint.X , this.startPoint.Y, ! this.endPoint.X , this.endPoint.Y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgLine) ! { ! return ((PgLine)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgLine Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,133 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgLine ! { ! #region Fields ! ! private PgPoint startPoint; ! private PgPoint endPoint; ! ! #endregion ! ! #region Properties ! ! public PgPoint StartPoint ! { ! get { return startPoint; } ! } ! ! public PgPoint EndPoint ! { ! get { return endPoint; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgLine(PgPoint startPoint, PgPoint endPoint) ! { ! this.startPoint = startPoint; ! this.endPoint = endPoint; ! } ! ! public PgLine(double x1, double y1, double x2, double y2) ! { ! this.startPoint = new PgPoint(x1, y1); ! this.endPoint = new PgPoint(x2, y2); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgLine left, PgLine right) ! { ! if (left.StartPoint == right.StartPoint && ! left.EndPoint == right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! public static bool operator !=(PgLine left, PgLine right) ! { ! if (left.StartPoint != right.StartPoint || ! left.EndPoint != right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("(({0},{1}),({2},{3}))", ! this.startPoint.X , this.startPoint.Y, ! this.endPoint.X , this.endPoint.Y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgLine) ! { ! return ((PgLine)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgLine Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgLSeg.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgLSeg.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgLSeg.cs 3 Jan 2004 15:44:10 -0000 1.8 --- PgLSeg.cs 9 Feb 2004 14:21:04 -0000 1.9 *************** *** 1,133 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgLSeg ! { ! #region Fields ! ! private PgPoint startPoint; ! private PgPoint endPoint; ! ! #endregion ! ! #region Properties ! ! public PgPoint StartPoint ! { ! get { return startPoint; } ! } ! ! public PgPoint EndPoint ! { ! get { return endPoint; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgLSeg(PgPoint startPoint, PgPoint endPoint) ! { ! this.startPoint = startPoint; ! this.endPoint = endPoint; ! } ! ! public PgLSeg(double x1, double y1, double x2, double y2) ! { ! this.startPoint = new PgPoint(x1, y1); ! this.endPoint = new PgPoint(x2, y2); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgLSeg left, PgLSeg right) ! { ! if (left.StartPoint == right.StartPoint && ! left.EndPoint == right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! public static bool operator !=(PgLSeg left, PgLSeg right) ! { ! if (left.StartPoint != right.StartPoint || ! left.EndPoint != right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("[({0},{1}),({2},{3})]", ! this.startPoint.X , this.startPoint.Y, ! this.endPoint.X , this.endPoint.Y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgLSeg) ! { ! return ((PgLSeg)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgLSeg Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,133 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgLSeg ! { ! #region Fields ! ! private PgPoint startPoint; ! private PgPoint endPoint; ! ! #endregion ! ! #region Properties ! ! public PgPoint StartPoint ! { ! get { return startPoint; } ! } ! ! public PgPoint EndPoint ! { ! get { return endPoint; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgLSeg(PgPoint startPoint, PgPoint endPoint) ! { ! this.startPoint = startPoint; ! this.endPoint = endPoint; ! } ! ! public PgLSeg(double x1, double y1, double x2, double y2) ! { ! this.startPoint = new PgPoint(x1, y1); ! this.endPoint = new PgPoint(x2, y2); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgLSeg left, PgLSeg right) ! { ! if (left.StartPoint == right.StartPoint && ! left.EndPoint == right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! public static bool operator !=(PgLSeg left, PgLSeg right) ! { ! if (left.StartPoint != right.StartPoint || ! left.EndPoint != right.EndPoint) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("[({0},{1}),({2},{3})]", ! this.startPoint.X , this.startPoint.Y, ! this.endPoint.X , this.endPoint.Y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgLSeg) ! { ! return ((PgLSeg)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgLSeg Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgPath.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPath.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgPath.cs 3 Jan 2004 15:44:10 -0000 1.7 --- PgPath.cs 9 Feb 2004 14:21:04 -0000 1.8 *************** *** 1,151 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgPath ! { ! #region Fields ! ! private PgPoint[] points; ! private bool isClosedPath; ! ! #endregion ! ! #region Properties ! ! public PgPoint[] Points ! { ! get { return points; } ! } ! ! public bool IsClosedPath ! { ! get { return isClosedPath; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgPath(bool isClosedPath, PgPoint[] points) ! { ! this.isClosedPath = isClosedPath; ! this.points = (PgPoint[])points.Clone(); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgPath left, PgPath right) ! { ! bool equals = false; ! ! if (left.Points.Length == right.Points.Length) ! { ! equals = true; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! equals = false; ! break; ! } ! } ! } ! ! return equals; ! } ! ! public static bool operator !=(PgPath left, PgPath right) ! { ! bool notequals = true; ! ! if (left.Points.Length == right.Points.Length) ! { ! notequals = false; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! notequals = true; ! break; ! } ! } ! } ! ! return notequals; ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! ! b.Append(this.isClosedPath ? "(" : "["); ! ! for (int i = 0; i < this.points.Length; i++) ! { ! if (b.Length > 1) ! { ! b.Append(","); ! } ! b.Append(this.points[i].ToString()); ! } ! ! b.Append(this.isClosedPath ? ")" : "]"); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgPath) ! { ! return ((PgPath)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgPath Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,151 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgPath ! { ! #region Fields ! ! private PgPoint[] points; ! private bool isClosedPath; ! ! #endregion ! ! #region Properties ! ! public PgPoint[] Points ! { ! get { return points; } ! } ! ! public bool IsClosedPath ! { ! get { return isClosedPath; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgPath(bool isClosedPath, PgPoint[] points) ! { ! this.isClosedPath = isClosedPath; ! this.points = (PgPoint[])points.Clone(); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgPath left, PgPath right) ! { ! bool equals = false; ! ! if (left.Points.Length == right.Points.Length) ! { ! equals = true; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! equals = false; ! break; ! } ! } ! } ! ! return equals; ! } ! ! public static bool operator !=(PgPath left, PgPath right) ! { ! bool notequals = true; ! ! if (left.Points.Length == right.Points.Length) ! { ! notequals = false; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! notequals = true; ! break; ! } ! } ! } ! ! return notequals; ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! ! b.Append(this.isClosedPath ? "(" : "["); ! ! for (int i = 0; i < this.points.Length; i++) ! { ! if (b.Length > 1) ! { ! b.Append(","); ! } ! b.Append(this.points[i].ToString()); ! } ! ! b.Append(this.isClosedPath ? ")" : "]"); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgPath) ! { ! return ((PgPath)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgPath Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgPoint.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPoint.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgPoint.cs 3 Jan 2004 15:44:10 -0000 1.7 --- PgPoint.cs 9 Feb 2004 14:21:04 -0000 1.8 *************** *** 1,123 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgPoint ! { ! #region Fields ! ! private double x; ! private double y; ! ! #endregion ! ! #region Properties ! ! public double X ! { ! get { return x; } ! } ! ! public double Y ! { ! get { return y; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgPoint(double x, double y) ! { ! this.x = x; ! this.y = y; ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgPoint left, PgPoint right) ! { ! if (left.X == right.X && left.Y == right.Y) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! public static bool operator !=(PgPoint left, PgPoint right) ! { ! if (left.X != right.X || left.Y != right.Y) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("({0},{1})", this.x, this.y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgPoint) ! { ! return ((PgPoint)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgPoint Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,123 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgPoint ! { ! #region Fields ! ! private double x; ! private double y; ! ! #endregion ! ! #region Properties ! ! public double X ! { ! get { return x; } ! } ! ! public double Y ! { ! get { return y; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgPoint(double x, double y) ! { ! this.x = x; ! this.y = y; ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgPoint left, PgPoint right) ! { ! if (left.X == right.X && left.Y == right.Y) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! public static bool operator !=(PgPoint left, PgPoint right) ! { ! if (left.X != right.X || left.Y != right.Y) ! { ! return true; ! } ! else ! { ! return true; ! } ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! b.AppendFormat("({0},{1})", this.x, this.y); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgPoint) ! { ! return ((PgPoint)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgPoint Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgPolygon.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPolygon.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgPolygon.cs 3 Jan 2004 15:44:10 -0000 1.8 --- PgPolygon.cs 9 Feb 2004 14:21:04 -0000 1.9 *************** *** 1,144 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgPolygon ! { ! #region Fields ! ! private PgPoint[] points; ! ! #endregion ! ! #region Properties ! ! public PgPoint[] Points ! { ! get { return points; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgPolygon(PgPoint[] points) ! { ! this.points = (PgPoint[])points.Clone(); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgPolygon left, PgPolygon right) ! { ! bool equals = false; ! ! if (left.Points.Length == right.Points.Length) ! { ! equals = true; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! equals = false; ! break; ! } ! } ! } ! ! return equals; ! } ! ! public static bool operator !=(PgPolygon left, PgPolygon right) ! { ! bool notequals = true; ! ! if (left.Points.Length == right.Points.Length) ! { ! notequals = false; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! notequals = true; ! break; ! } ! } ! } ! ! return notequals; ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! ! b.Append("("); ! ! for (int i = 0; i < this.points.Length; i++) ! { ! if (b.Length > 1) ! { ! b.Append(","); ! } ! b.Append(this.points[i].ToString()); ! } ! ! b.Append(")"); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgPolygon) ! { ! return ((PgPolygon)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgPolygon Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,144 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgPolygon ! { ! #region Fields ! ! private PgPoint[] points; ! ! #endregion ! ! #region Properties ! ! public PgPoint[] Points ! { ! get { return points; } ! } ! ! #endregion ! ! #region Constructors ! ! public PgPolygon(PgPoint[] points) ! { ! this.points = (PgPoint[])points.Clone(); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgPolygon left, PgPolygon right) ! { ! bool equals = false; ! ! if (left.Points.Length == right.Points.Length) ! { ! equals = true; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! equals = false; ! break; ! } ! } ! } ! ! return equals; ! } ! ! public static bool operator !=(PgPolygon left, PgPolygon right) ! { ! bool notequals = true; ! ! if (left.Points.Length == right.Points.Length) ! { ! notequals = false; ! for (int i = 0; i < left.Points.Length; i++) ! { ! if (left.Points[i] != right.Points[i]) ! { ! notequals = true; ! break; ! } ! } ! } ! ! return notequals; ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! System.Text.StringBuilder b = new System.Text.StringBuilder(); ! ! b.Append("("); ! ! for (int i = 0; i < this.points.Length; i++) ! { ! if (b.Length > 1) ! { ! b.Append(","); ! } ! b.Append(this.points[i].ToString()); ! } ! ! b.Append(")"); ! ! return b.ToString(); ! } ! ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgPolygon) ! { ! return ((PgPolygon)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! ! #region Static Methods ! ! public static PgPolygon Parse(string s) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: PgTimeSpan.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgTimeSpan.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgTimeSpan.cs 18 Dec 2003 11:47:05 -0000 1.5 --- PgTimeSpan.cs 9 Feb 2004 14:21:04 -0000 1.6 *************** *** 1,238 **** ! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ! * Copyright (C) 2003 Carlos Guzmán Álvarez ! * ! * 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgTimeSpan : IComparable ! { ! #region Fields ! ! private TimeSpan interval; ! ! #endregion ! ! #region Properties ! ! public int Days ! { ! get { return this.interval.Days; } ! } ! ! public int Hours ! { ! get { return this.interval.Hours; } ! } ! ! public int Milliseconds ! { ! get { return this.interval.Milliseconds; } ! } ! ! public int Minutes ! { ! get { return this.interval.Minutes; } ! } ! ! public int Seconds ! { ! get { return this.interval.Seconds; } ! } ! ! public TimeSpan Value ! { ! get { return interval; } ! } ! ! #endregion ! ! #region Static Fields ! ! public static readonly PgTimeSpan MaxValue = new PgTimeSpan(TimeSpan.MaxValue); ! public static readonly PgTimeSpan MinValue = new PgTimeSpan(TimeSpan.MinValue); ! public static readonly PgTimeSpan Null = new PgTimeSpan(TimeSpan.Zero); ! ! #endregion ! ! #region Constructors ! ! public PgTimeSpan(TimeSpan interval) ! { ! this.interval = interval; ! } ! ! #endregion ! ! #region ICOMPARABLE ! ! public int CompareTo(object obj) ! { ! return interval.CompareTo(obj); ! } ! ! #endregion ! ! #region Static Methods ! ! public static bool GreatherThan(PgTimeSpan x, PgTimeSpan y) ! { ! return (x > y); ! } ! ! public static bool GreatherThanOrEqual(PgTimeSpan x, PgTimeSpan y) ! { ! return (x >= y); ! } ! ! public static bool LessThan(PgTimeSpan x, PgTimeSpan y) ! { ! return (x < y); ! } ! ! public static bool LessThanOrEqual(PgTimeSpan x, PgTimeSpan y) ! { ! return (x <= y); ! } ! ! public static bool NotEquals(PgTimeSpan x, PgTimeSpan y) ! { ! return (x != y); ! } ! ! public static PgTimeSpan Parse(string s) ! { ! return new PgTimeSpan(TimeSpan.Parse(s)); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgTimeSpan left, PgTimeSpan right) ! { ! bool equals = false; ! ! if (left.Value == right.Value) ! { ! equals = true; ! } ! ! return equals; ! } ! ! public static bool operator !=(PgTimeSpan left, PgTimeSpan right) ! { ! bool notequals = false; ! ! if (left.Value != right.Value) ! { ! notequals = true; ! } ! ! return notequals; ! } ! ! public static bool operator >(PgTimeSpan left, PgTimeSpan right) ! { ! bool greater = false; ! ! if (left.Value > right.Value) ! { ! greater = true; ! } ! ! return greater; ! } ! ! public static bool operator >=(PgTimeSpan left, PgTimeSpan right) ! { ! bool greater = false; ! ! if (left.Value >= right.Value) ! { ! greater = true; ! } ! ! return greater; ! } ! ! public static bool operator <(PgTimeSpan left, PgTimeSpan right) ! { ! bool less = false; ! ! if (left.Value < right.Value) ! { ! less = true; ! } ! ! return less; ! } ! ! public static bool operator <=(PgTimeSpan left, PgTimeSpan right) ! { ! bool less = false; ! ! if (left.Value <= right.Value) ! { ! less = true; ! } ! ! return less; ! } ! ! public static explicit operator TimeSpan(PgTimeSpan x) ! { ! return x.Value; ! } ! ! public static explicit operator PgTimeSpan(string x) ! { ! return new PgTimeSpan(TimeSpan.Parse(x)); ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! return interval.ToString(); ! } ! ! public override int GetHashCode() ! { ! return interval.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgTimeSpan) ! { ! return ((PgTimeSpan)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! } ! } --- 1,238 ---- ! /* 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; ! ! namespace PostgreSql.Data.PgTypes ! { ! [Serializable] ! public struct PgTimeSpan : IComparable ! { ! #region Fields ! ! private TimeSpan interval; ! ! #endregion ! ! #region Properties ! ! public int Days ! { ! get { return this.interval.Days; } ! } ! ! public int Hours ! { ! get { return this.interval.Hours; } ! } ! ! public int Milliseconds ! { ! get { return this.interval.Milliseconds; } ! } ! ! public int Minutes ! { ! get { return this.interval.Minutes; } ! } ! ! public int Seconds ! { ! get { return this.interval.Seconds; } ! } ! ! public TimeSpan Value ! { ! get { return interval; } ! } ! ! #endregion ! ! #region Static Fields ! ! public static readonly PgTimeSpan MaxValue = new PgTimeSpan(TimeSpan.MaxValue); ! public static readonly PgTimeSpan MinValue = new PgTimeSpan(TimeSpan.MinValue); ! public static readonly PgTimeSpan Null = new PgTimeSpan(TimeSpan.Zero); ! ! #endregion ! ! #region Constructors ! ! public PgTimeSpan(TimeSpan interval) ! { ! this.interval = interval; ! } ! ! #endregion ! ! #region ICOMPARABLE ! ! public int CompareTo(object obj) ! { ! return interval.CompareTo(obj); ! } ! ! #endregion ! ! #region Static Methods ! ! public static bool GreatherThan(PgTimeSpan x, PgTimeSpan y) ! { ! return (x > y); ! } ! ! public static bool GreatherThanOrEqual(PgTimeSpan x, PgTimeSpan y) ! { ! return (x >= y); ! } ! ! public static bool LessThan(PgTimeSpan x, PgTimeSpan y) ! { ! return (x < y); ! } ! ! public static bool LessThanOrEqual(PgTimeSpan x, PgTimeSpan y) ! { ! return (x <= y); ! } ! ! public static bool NotEquals(PgTimeSpan x, PgTimeSpan y) ! { ! return (x != y); ! } ! ! public static PgTimeSpan Parse(string s) ! { ! return new PgTimeSpan(TimeSpan.Parse(s)); ! } ! ! #endregion ! ! #region Operators ! ! public static bool operator ==(PgTimeSpan left, PgTimeSpan right) ! { ! bool equals = false; ! ! if (left.Value == right.Value) ! { ! equals = true; ! } ! ! return equals; ! } ! ! public static bool operator !=(PgTimeSpan left, PgTimeSpan right) ! { ! bool notequals = false; ! ! if (left.Value != right.Value) ! { ! notequals = true; ! } ! ! return notequals; ! } ! ! public static bool operator >(PgTimeSpan left, PgTimeSpan right) ! { ! bool greater = false; ! ! if (left.Value > right.Value) ! { ! greater = true; ! } ! ! return greater; ! } ! ! public static bool operator >=(PgTimeSpan left, PgTimeSpan right) ! { ! bool greater = false; ! ! if (left.Value >= right.Value) ! { ! greater = true; ! } ! ! return greater; ! } ! ! public static bool operator <(PgTimeSpan left, PgTimeSpan right) ! { ! bool less = false; ! ! if (left.Value < right.Value) ! { ! less = true; ! } ! ! return less; ! } ! ! public static bool operator <=(PgTimeSpan left, PgTimeSpan right) ! { ! bool less = false; ! ! if (left.Value <= right.Value) ! { ! less = true; ! } ! ! return less; ! } ! ! public static explicit operator TimeSpan(PgTimeSpan x) ! { ! return x.Value; ! } ! ! public static explicit operator PgTimeSpan(string x) ! { ! return new PgTimeSpan(TimeSpan.Parse(x)); ! } ! ! #endregion ! ! #region Overriden Methods ! ! public override string ToString() ! { ! return interval.ToString(); ! } ! ! public override int GetHashCode() ! { ! return interval.GetHashCode(); ! } ! ! public override bool Equals(object obj) ! { ! if (obj is PgTimeSpan) ! { ! return ((PgTimeSpan)obj) == this; ! } ! else ! { ! return false; ! } ! } ! ! #endregion ! } ! } |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12394 Modified Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHello.cs TlsClientKeyExchange.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHello.cs TlsServerHelloDone.cs TlsServerKeyExchange.cs Log Message: Updated license headers Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientCertificate.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsClientCertificate.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,65 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using Mono.Security.Protocol.Tls; ! using System.Security.Cryptography.X509Certificates; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientCertificate : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientCertificate(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Certificate, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,65 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using Mono.Security.Protocol.Tls; ! using System.Security.Cryptography.X509Certificates; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientCertificate : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientCertificate(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Certificate, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientCertificateVerify.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsClientCertificateVerify.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,67 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography.X509Certificates; ! ! using System.Security.Cryptography; ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientCertificateVerify : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientCertificateVerify(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Finished, buffer) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } --- 1,67 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography.X509Certificates; ! ! using System.Security.Cryptography; ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientCertificateVerify : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientCertificateVerify(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Finished, buffer) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } Index: TlsClientFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientFinished.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsClientFinished.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,66 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientFinished(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Finished, buffer) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } --- 1,66 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientFinished(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.Finished, buffer) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } Index: TlsClientHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientHello.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsClientHello.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,64 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientHello : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientHello(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ClientHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,64 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientHello : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientHello(TlsContext context, byte[] buffer) ! : base(context, TlsHandshakeType.ClientHello, buffer) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } } \ No newline at end of file Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientKeyExchange.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsClientKeyExchange.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,58 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientKeyExchange : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientKeyExchange (TlsContext context, byte[] buffer) : ! base(context, ! TlsHandshakeType.ClientKeyExchange, ! buffer) ! { ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! throw new NotSupportedException(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,58 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsClientKeyExchange : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsClientKeyExchange (TlsContext context, byte[] buffer) : ! base(context, ! TlsHandshakeType.ClientKeyExchange, ! buffer) ! { ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! throw new NotSupportedException(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerCertificate.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsServerCertificate.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,70 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Collections; ! using System.Text.RegularExpressions; ! using System.Security.Cryptography; ! using X509Cert = System.Security.Cryptography.X509Certificates; ! ! using Mono.Security.Protocol.Tls.Alerts; ! using Mono.Security.X509; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerCertificate : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerCertificate(TlsContext context) ! : base(context, TlsHandshakeType.Certificate) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } --- 1,70 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Collections; ! using System.Text.RegularExpressions; ! using System.Security.Cryptography; ! using X509Cert = System.Security.Cryptography.X509Certificates; ! ! using Mono.Security.Protocol.Tls.Alerts; ! using Mono.Security.X509; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerCertificate : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerCertificate(TlsContext context) ! : base(context, TlsHandshakeType.Certificate) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerCertificateRequest.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsServerCertificateRequest.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,65 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Text; ! using Mono.Security; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerCertificateRequest : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerCertificateRequest(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } --- 1,65 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Text; ! using Mono.Security; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerCertificateRequest : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerCertificateRequest(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } Index: TlsServerFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerFinished.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsServerFinished.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,66 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerFinished(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } --- 1,66 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerFinished : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerFinished(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerHello.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsServerHello.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,63 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerHello : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerHello(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,63 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerHello : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerHello(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } } \ No newline at end of file Index: TlsServerHelloDone.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerHelloDone.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsServerHelloDone.cs 9 Feb 2004 14:17:58 -0000 1.3 *************** *** 1,63 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerHelloDone : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerHelloDone(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } --- 1,63 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerHelloDone : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerHelloDone(TlsContext context) ! : base(context, TlsHandshakeType.ServerHello) ! { ! } ! ! #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(); ! } ! ! #endregion ! } ! } Index: TlsServerKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerKeyExchange.cs 14 Dec 2003 15:02:18 -0000 1.2 --- TlsServerKeyExchange.cs 9 Feb 2004 14:17:59 -0000 1.3 *************** *** 1,67 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! using Mono.Security.X509; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerKeyExchange : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerKeyExchange(TlsContext context) ! : base(context, TlsHandshakeType.ServerKeyExchange) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,67 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! using Mono.Security.Cryptography; ! using Mono.Security.X509; ! ! namespace Mono.Security.Protocol.Tls.Handshake.Server ! { ! internal class TlsServerKeyExchange : TlsHandshakeMessage ! { ! #region Constructors ! ! public TlsServerKeyExchange(TlsContext context) ! : base(context, TlsHandshakeType.ServerKeyExchange) ! { ! } ! ! #endregion ! ! #region Methods ! ! public override void Update() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! ! #region Protected Methods ! ! protected override void ProcessAsSsl3() ! { ! this.ProcessAsTls1(); ! } ! ! protected override void ProcessAsTls1() ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } |
From: <car...@us...> - 2004-02-10 00:23:00
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11100 Added Files: monocp.sh Log Message: Added a little bash script for allow an automaticupdate of the mono sources --- NEW FILE: monocp.sh --- #!/bin/sh base_dir=./Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls mono_sources=./mcs/class/Mono.Security # Base sources cp --force --verbose ${base_dir}/*.cs ${mono_sources}/Mono.Security.Protocol.Tls # Handshake cp --force --verbose ${base_dir}/Mono.Security.Protocol.Tls.Handshake/*.cs ${mono_sources}/Mono.Security.Protocol.Tls.Handshake # Client Handshake cp --force --verbose ${base_dir}/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/*.cs ${mono_sources}/Mono.Security.Protocol.Tls.Handshake.Client # Alerts cp --force --verbose ${base_dir}/Mono.Security.Protocol.Tls.Alerts/*.cs ${mono_sources}/Mono.Security.Protocol.Tls.Alerts # MD5SHA1 implementation cp --force --verbose ${base_dir}/Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs ${mono_sources}/Mono.Security.Cryptography/MD5SHA1.cs # HMAC implementation cp --force --verbose ${base_dir}/Mono.Security/Mono.Security.Cryptography/HMAC.cs ${mono_sources}/Mono.Security.Cryptography/TlsHMAC.cs |
From: <car...@us...> - 2004-02-10 00:20:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24485 Modified Files: PgCommand.cs Log Message: Fix for matchEvaluator(Match match) method Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PgCommand.cs 9 Feb 2004 14:19:22 -0000 1.26 --- PgCommand.cs 9 Feb 2004 21:52:04 -0000 1.27 *************** *** 766,781 **** if (!this.matchReplaces.ContainsKey(match.Value)) { ! if (this.isPrepared) ! { ! this.matchReplaces.Add( ! match.Value, ! "$" + ((matchIndex++) + 1).ToString()); ! } ! else ! { this.matchReplaces.Add( match.Value, this.parameters[matchIndex++].ConvertToPgString()); ! } } return this.matchReplaces[match.Value].ToString(); --- 766,778 ---- if (!this.matchReplaces.ContainsKey(match.Value)) { ! #if (SIMPLE_PROTOCOL) this.matchReplaces.Add( match.Value, this.parameters[matchIndex++].ConvertToPgString()); ! #else ! this.matchReplaces.Add( ! match.Value, ! "$" + ((matchIndex++) + 1).ToString()); ! #endif } return this.matchReplaces[match.Value].ToString(); |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12059 Modified Files: AssemblyInfo.cs CipherAlgorithmType.cs CipherSuite.cs ExchangeAlgorithmType.cs HashAlgorithmType.cs RSASslSignatureDeformatter.cs RSASslSignatureFormatter.cs SecurityCompressionType.cs SecurityProtocolType.cs SslClientStream.cs SslServerStream.cs TlsCipherSuite.cs TlsCipherSuiteCollection.cs TlsCipherSuiteFactory.cs TlsClientSettings.cs TlsContentType.cs TlsContext.cs TlsException.cs TlsServerSettings.cs TlsSslCipherSuite.cs TlsSslHandshakeHash.cs TlsStream.cs Log Message: Updated license headers Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/AssemblyInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AssemblyInfo.cs 11 Oct 2003 10:04:20 -0000 1.1 --- AssemblyInfo.cs 9 Feb 2004 14:16:56 -0000 1.2 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: CipherAlgorithmType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CipherAlgorithmType.cs 13 Nov 2003 09:21:51 -0000 1.1 --- CipherAlgorithmType.cs 9 Feb 2004 14:16:57 -0000 1.2 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CipherSuite.cs 21 Dec 2003 14:39:54 -0000 1.12 --- CipherSuite.cs 9 Feb 2004 14:16:57 -0000 1.13 *************** *** 1,541 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: [...1055 lines suppressed...] ! this.decryptionAlgorithm.BlockSize = this.blockSize * 8; ! } ! ! // Set the key and IV for the algorithm ! this.decryptionAlgorithm.Key = this.context.ServerWriteKey; ! this.decryptionAlgorithm.IV = this.context.ServerWriteIV; ! ! // Create decryption cipher ! this.decryptionCipher = this.decryptionAlgorithm.CreateDecryptor(); ! ! // Create the HMAC algorithm for the server ! this.serverHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ServerWriteMAC); ! } ! ! #endregion ! } } \ No newline at end of file Index: ExchangeAlgorithmType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExchangeAlgorithmType.cs 13 Nov 2003 09:21:51 -0000 1.1 --- ExchangeAlgorithmType.cs 9 Feb 2004 14:17:02 -0000 1.2 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: HashAlgorithmType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/HashAlgorithmType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HashAlgorithmType.cs 13 Nov 2003 09:21:51 -0000 1.1 --- HashAlgorithmType.cs 9 Feb 2004 14:17:02 -0000 1.2 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: RSASslSignatureDeformatter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RSASslSignatureDeformatter.cs 23 Dec 2003 18:24:23 -0000 1.3 --- RSASslSignatureDeformatter.cs 9 Feb 2004 14:17:02 -0000 1.4 *************** *** 1,104 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class RSASslSignatureDeformatter : AsymmetricSignatureDeformatter ! { ! #region Fields ! ! private RSA key; ! private HashAlgorithm hash; ! ! #endregion ! ! #region Constructors ! ! public RSASslSignatureDeformatter() ! { ! } ! ! public RSASslSignatureDeformatter(AsymmetricAlgorithm key) ! { ! this.SetKey(key); ! } ! ! #endregion ! ! #region Methods ! ! public override bool VerifySignature( ! byte[] rgbHash, ! byte[] rgbSignature) ! { ! if (key == null) ! { ! throw new CryptographicUnexpectedOperationException("The key is a null reference"); ! } ! if (hash == null) ! { ! throw new CryptographicUnexpectedOperationException("The hash algorithm is a null reference."); ! } ! if (rgbHash == null) ! { ! throw new ArgumentNullException("The rgbHash parameter is a null reference."); ! } ! ! return Mono.Security.Cryptography.PKCS1.Verify_v15( ! this.key, ! this.hash, ! rgbHash, ! rgbSignature); ! } ! ! public override void SetHashAlgorithm(string strName) ! { ! switch (strName) ! { ! case "MD5SHA1": ! this.hash = new Mono.Security.Cryptography.MD5SHA1(); ! break; ! ! default: ! this.hash = HashAlgorithm.Create(strName); ! break; ! } ! } ! ! public override void SetKey(AsymmetricAlgorithm key) ! { ! if (!(key is RSA)) ! { ! throw new ArgumentException("Specfied key is not an RSA key"); ! } ! ! this.key = key as RSA; ! } ! ! #endregion ! } ! } --- 1,104 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class RSASslSignatureDeformatter : AsymmetricSignatureDeformatter ! { ! #region Fields ! ! private RSA key; ! private HashAlgorithm hash; ! ! #endregion ! ! #region Constructors ! ! public RSASslSignatureDeformatter() ! { ! } ! ! public RSASslSignatureDeformatter(AsymmetricAlgorithm key) ! { ! this.SetKey(key); ! } ! ! #endregion ! ! #region Methods ! ! public override bool VerifySignature( ! byte[] rgbHash, ! byte[] rgbSignature) ! { ! if (key == null) ! { ! throw new CryptographicUnexpectedOperationException("The key is a null reference"); ! } ! if (hash == null) ! { ! throw new CryptographicUnexpectedOperationException("The hash algorithm is a null reference."); ! } ! if (rgbHash == null) ! { ! throw new ArgumentNullException("The rgbHash parameter is a null reference."); ! } ! ! return Mono.Security.Cryptography.PKCS1.Verify_v15( ! this.key, ! this.hash, ! rgbHash, ! rgbSignature); ! } ! ! public override void SetHashAlgorithm(string strName) ! { ! switch (strName) ! { ! case "MD5SHA1": ! this.hash = new Mono.Security.Cryptography.MD5SHA1(); ! break; ! ! default: ! this.hash = HashAlgorithm.Create(strName); ! break; ! } ! } ! ! public override void SetKey(AsymmetricAlgorithm key) ! { ! if (!(key is RSA)) ! { ! throw new ArgumentException("Specfied key is not an RSA key"); ! } ! ! this.key = key as RSA; ! } ! ! #endregion ! } ! } Index: RSASslSignatureFormatter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RSASslSignatureFormatter.cs 23 Dec 2003 18:24:23 -0000 1.3 --- RSASslSignatureFormatter.cs 9 Feb 2004 14:17:02 -0000 1.4 *************** *** 1,101 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class RSASslSignatureFormatter : AsymmetricSignatureFormatter ! { ! #region Fields ! ! private RSA key; ! private HashAlgorithm hash; ! ! #endregion ! ! #region Constructors ! ! public RSASslSignatureFormatter() ! { ! } ! ! public RSASslSignatureFormatter(AsymmetricAlgorithm key) ! { ! this.SetKey(key); ! } ! ! #endregion ! ! #region Methods ! ! public override byte[] CreateSignature(byte[] rgbHash) ! { ! if (key == null) ! { ! throw new CryptographicUnexpectedOperationException("The key is a null reference"); ! } ! if (hash == null) ! { ! throw new CryptographicUnexpectedOperationException("The hash algorithm is a null reference."); ! } ! if (rgbHash == null) ! { ! throw new ArgumentNullException("The rgbHash parameter is a null reference."); ! } ! ! return Mono.Security.Cryptography.PKCS1.Sign_v15( ! this.key, ! this.hash, ! rgbHash); ! } ! ! public override void SetHashAlgorithm(string strName) ! { ! switch (strName) ! { ! case "MD5SHA1": ! this.hash = new Mono.Security.Cryptography.MD5SHA1(); ! break; ! ! default: ! this.hash = HashAlgorithm.Create(strName); ! break; ! } ! } ! ! public override void SetKey(AsymmetricAlgorithm key) ! { ! if (!(key is RSA)) ! { ! throw new ArgumentException("Specfied key is not an RSA key"); ! } ! ! this.key = key as RSA; ! } ! ! #endregion ! } ! } --- 1,101 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class RSASslSignatureFormatter : AsymmetricSignatureFormatter ! { ! #region Fields ! ! private RSA key; ! private HashAlgorithm hash; ! ! #endregion ! ! #region Constructors ! ! public RSASslSignatureFormatter() ! { ! } ! ! public RSASslSignatureFormatter(AsymmetricAlgorithm key) ! { ! this.SetKey(key); ! } ! ! #endregion ! ! #region Methods ! ! public override byte[] CreateSignature(byte[] rgbHash) ! { ! if (key == null) ! { ! throw new CryptographicUnexpectedOperationException("The key is a null reference"); ! } ! if (hash == null) ! { ! throw new CryptographicUnexpectedOperationException("The hash algorithm is a null reference."); ! } ! if (rgbHash == null) ! { ! throw new ArgumentNullException("The rgbHash parameter is a null reference."); ! } ! ! return Mono.Security.Cryptography.PKCS1.Sign_v15( ! this.key, ! this.hash, ! rgbHash); ! } ! ! public override void SetHashAlgorithm(string strName) ! { ! switch (strName) ! { ! case "MD5SHA1": ! this.hash = new Mono.Security.Cryptography.MD5SHA1(); ! break; ! ! default: ! this.hash = HashAlgorithm.Create(strName); ! break; ! } ! } ! ! public override void SetKey(AsymmetricAlgorithm key) ! { ! if (!(key is RSA)) ! { ! throw new ArgumentException("Specfied key is not an RSA key"); ! } ! ! this.key = key as RSA; ! } ! ! #endregion ! } ! } Index: SecurityCompressionType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SecurityCompressionType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecurityCompressionType.cs 13 Nov 2003 09:21:51 -0000 1.1 --- SecurityCompressionType.cs 9 Feb 2004 14:17:02 -0000 1.2 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: SecurityProtocolType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SecurityProtocolType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SecurityProtocolType.cs 14 Nov 2003 13:40:40 -0000 1.2 --- SecurityProtocolType.cs 9 Feb 2004 14:17:02 -0000 1.3 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: SslClientStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SslClientStream.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SslClientStream.cs 8 Feb 2004 22:25:24 -0000 1.13 --- SslClientStream.cs 9 Feb 2004 14:17:02 -0000 1.14 *************** *** 1,4 **** /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez * * Permission is hereby granted, free of charge, to any person --- 1,4 ---- /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person Index: SslServerStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SslServerStream.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SslServerStream.cs 14 Dec 2003 14:59:39 -0000 1.2 --- SslServerStream.cs 9 Feb 2004 14:17:02 -0000 1.3 *************** *** 1,281 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Security.Cryptography.X509Certificates; ! ! namespace Mono.Security.Protocol.Tls ! { ! public class SslServerStream : Stream, IDisposable ! { ! #region Fields ! ! private Stream innerStream; ! private bool disposed; ! private bool ownsStream; ! ! #endregion ! ! #region Properties ! ! public override bool CanRead ! { ! get { return this.innerStream.CanRead; } ! } ! ! public override bool CanWrite ! { ! get { return this.innerStream.CanWrite; } ! } ! ! public override bool CanSeek ! { ! get { return this.innerStream.CanSeek; } ! } ! ! public override long Length ! { ! get { throw new NotSupportedException(); } ! } ! ! public override long Position ! { ! get { throw new NotSupportedException(); } ! set { throw new NotSupportedException(); } ! } ! ! #endregion ! ! #region Security Properties ! ! public bool CheckCertRevocationStatus ! { ! get { throw new NotSupportedException(); } ! set { throw new NotSupportedException(); } ! } ! ! public CipherAlgorithmType CipherAlgorithm ! { ! get { throw new NotSupportedException(); } ! } ! ! public int CipherStrength ! { ! get { throw new NotSupportedException(); } ! } ! ! public X509Certificate ClientCertificate ! { ! get { throw new NotSupportedException(); } ! } ! ! public CertificateValidationCallback ClientCertValidationDelegate ! { ! get { throw new NotSupportedException(); } ! set { throw new NotSupportedException(); } ! } ! ! public HashAlgorithmType HashAlgorithm ! { ! get { throw new NotSupportedException(); } ! } ! ! public int HashStrength ! { ! get { throw new NotSupportedException(); } ! } ! ! public int KeyExchangeStrength ! { ! get { throw new NotSupportedException(); } ! } ! ! public ExchangeAlgorithmType KeyExchangeAlgorithm ! { ! get { throw new NotSupportedException(); } ! } ! ! public SecurityProtocolType SecurityProtocol ! { ! get { throw new NotSupportedException(); } ! } ! ! public X509Certificate ServerCertificate ! { ! get { throw new NotSupportedException(); } ! } ! ! #endregion ! ! #region Constructors ! ! public SslServerStream(Stream stream, X509Certificate serverCertificate) ! { ! } ! ! public SslServerStream( ! Stream stream, ! X509Certificate serverCertificate, ! bool clientCertificateRequired, ! bool ownsStream) ! { ! } ! ! public SslServerStream( ! Stream stream, ! X509Certificate serverCertificate, ! bool clientCertificateRequired, ! bool ownsStream, ! SecurityProtocolType securityProtocolType) ! { ! } ! ! #endregion ! ! #region Finalizer ! ! ~SslServerStream() ! { ! this.Dispose(false); ! } ! ! #endregion ! ! #region IDisposable Methods ! ! void IDisposable.Dispose() ! { ! this.Dispose(true); ! GC.SuppressFinalize(this); ! } ! ! protected virtual void Dispose(bool disposing) ! { ! if (!this.disposed) ! { ! if (disposing) ! { ! if (this.innerStream != null) ! { ! if (this.ownsStream) ! { ! // Close inner stream ! this.innerStream.Close(); ! } ! } ! this.ownsStream = false; ! this.innerStream = null; ! } ! ! this.disposed = true; ! } ! } ! ! #endregion ! ! #region Methods ! ! public override IAsyncResult BeginRead( ! byte[] buffer, ! int offset, ! int count, ! AsyncCallback asyncCallback, ! object asyncState) ! { ! throw new NotSupportedException(); ! } ! ! public override IAsyncResult BeginWrite( ! byte[] buffer, ! int offset, ! int count, ! AsyncCallback asyncCallback, ! object asyncState) ! { ! throw new NotSupportedException(); ! } ! ! public override void Close() ! { ! throw new NotSupportedException(); ! } ! ! public override int EndRead(IAsyncResult asyncResult) ! { ! throw new NotSupportedException(); ! } ! ! public override void EndWrite(IAsyncResult asyncResult) ! { ! throw new NotSupportedException(); ! } ! ! public override void Flush() ! { ! if (this.disposed) ! { ! throw new ObjectDisposedException("The NetworkStream is closed."); ! } ! } ! ! public int Read(byte[] buffer) ! { ! throw new NotSupportedException(); ! } ! ! public override int Read( ! byte[] buffer, ! int offset, ! int count) ! { ! throw new NotSupportedException(); ! } ! ! public override long Seek(long offset, SeekOrigin origin) ! { ! throw new NotSupportedException(); ! } ! ! public override void SetLength(long value) ! { ! throw new NotSupportedException(); ! } ! ! public void Write(byte[] buffer) ! { ! throw new NotSupportedException(); ! } ! ! public override void Write( ! byte[] buffer, ! int offset, ! int count) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } --- 1,281 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Security.Cryptography.X509Certificates; ! ! namespace Mono.Security.Protocol.Tls ! { ! public class SslServerStream : Stream, IDisposable ! { ! #region Fields ! ! private Stream innerStream; ! private bool disposed; ! private bool ownsStream; ! ! #endregion ! ! #region Properties ! ! public override bool CanRead ! { ! get { return this.innerStream.CanRead; } ! } ! ! public override bool CanWrite ! { ! get { return this.innerStream.CanWrite; } ! } ! ! public override bool CanSeek ! { ! get { return this.innerStream.CanSeek; } ! } ! ! public override long Length ! { ! get { throw new NotSupportedException(); } ! } ! ! public override long Position ! { ! get { throw new NotSupportedException(); } ! set { throw new NotSupportedException(); } ! } ! ! #endregion ! ! #region Security Properties ! ! public bool CheckCertRevocationStatus ! { ! get { throw new NotSupportedException(); } ! set { throw new NotSupportedException(); } ! } ! ! public CipherAlgorithmType CipherAlgorithm ! { ! get { throw new NotSupportedException(); } ! } ! ! public int CipherStrength ! { ! get { throw new NotSupportedException(); } ! } ! ! public X509Certificate ClientCertificate ! { ! get { throw new NotSupportedException(); } ! } ! ! public CertificateValidationCallback ClientCertValidationDelegate ! { ! get { throw new NotSupportedException(); } ! set { throw new NotSupportedException(); } ! } ! ! public HashAlgorithmType HashAlgorithm ! { ! get { throw new NotSupportedException(); } ! } ! ! public int HashStrength ! { ! get { throw new NotSupportedException(); } ! } ! ! public int KeyExchangeStrength ! { ! get { throw new NotSupportedException(); } ! } ! ! public ExchangeAlgorithmType KeyExchangeAlgorithm ! { ! get { throw new NotSupportedException(); } ! } ! ! public SecurityProtocolType SecurityProtocol ! { ! get { throw new NotSupportedException(); } ! } ! ! public X509Certificate ServerCertificate ! { ! get { throw new NotSupportedException(); } ! } ! ! #endregion ! ! #region Constructors ! ! public SslServerStream(Stream stream, X509Certificate serverCertificate) ! { ! } ! ! public SslServerStream( ! Stream stream, ! X509Certificate serverCertificate, ! bool clientCertificateRequired, ! bool ownsStream) ! { ! } ! ! public SslServerStream( ! Stream stream, ! X509Certificate serverCertificate, ! bool clientCertificateRequired, ! bool ownsStream, ! SecurityProtocolType securityProtocolType) ! { ! } ! ! #endregion ! ! #region Finalizer ! ! ~SslServerStream() ! { ! this.Dispose(false); ! } ! ! #endregion ! ! #region IDisposable Methods ! ! void IDisposable.Dispose() ! { ! this.Dispose(true); ! GC.SuppressFinalize(this); ! } ! ! protected virtual void Dispose(bool disposing) ! { ! if (!this.disposed) ! { ! if (disposing) ! { ! if (this.innerStream != null) ! { ! if (this.ownsStream) ! { ! // Close inner stream ! this.innerStream.Close(); ! } ! } ! this.ownsStream = false; ! this.innerStream = null; ! } ! ! this.disposed = true; ! } ! } ! ! #endregion ! ! #region Methods ! ! public override IAsyncResult BeginRead( ! byte[] buffer, ! int offset, ! int count, ! AsyncCallback asyncCallback, ! object asyncState) ! { ! throw new NotSupportedException(); ! } ! ! public override IAsyncResult BeginWrite( ! byte[] buffer, ! int offset, ! int count, ! AsyncCallback asyncCallback, ! object asyncState) ! { ! throw new NotSupportedException(); ! } ! ! public override void Close() ! { ! throw new NotSupportedException(); ! } ! ! public override int EndRead(IAsyncResult asyncResult) ! { ! throw new NotSupportedException(); ! } ! ! public override void EndWrite(IAsyncResult asyncResult) ! { ! throw new NotSupportedException(); ! } ! ! public override void Flush() ! { ! if (this.disposed) ! { ! throw new ObjectDisposedException("The NetworkStream is closed."); ! } ! } ! ! public int Read(byte[] buffer) ! { ! throw new NotSupportedException(); ! } ! ! public override int Read( ! byte[] buffer, ! int offset, ! int count) ! { ! throw new NotSupportedException(); ! } ! ! public override long Seek(long offset, SeekOrigin origin) ! { ! throw new NotSupportedException(); ! } ! ! public override void SetLength(long value) ! { ! throw new NotSupportedException(); ! } ! ! public void Write(byte[] buffer) ! { ! throw new NotSupportedException(); ! } ! ! public override void Write( ! byte[] buffer, ! int offset, ! int count) ! { ! throw new NotSupportedException(); ! } ! ! #endregion ! } ! } Index: TlsCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuite.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsCipherSuite.cs 14 Dec 2003 14:59:39 -0000 1.10 --- TlsCipherSuite.cs 9 Feb 2004 14:17:02 -0000 1.11 *************** *** 1,158 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Text; ! using System.Security.Cryptography; ! using System.Security.Cryptography.X509Certificates; ! ! using Mono.Security; ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class TlsCipherSuite : CipherSuite ! { ! #region Constructors ! ! public TlsCipherSuite( ! short code, string name, CipherAlgorithmType cipherAlgorithmType, ! HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) : ! base(code, name, cipherAlgorithmType, hashAlgorithmType, ! exchangeAlgorithmType, exportable, blockMode, keyMaterialSize, ! expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize) ! { ! } ! ! #endregion ! ! #region MAC Generation Methods ! ! public override byte[] ComputeServerRecordMAC(TlsContentType contentType, byte[] fragment) ! { ! TlsStream data = new TlsStream(); ! byte[] result = null; ! ! data.Write(this.Context.ReadSequenceNumber); ! data.Write((byte)contentType); ! data.Write((short)this.Context.Protocol); ! data.Write((short)fragment.Length); ! data.Write(fragment); ! ! result = this.ServerHMAC.ComputeHash(data.ToArray()); ! ! data.Reset(); ! ! return result; ! } ! ! public override byte[] ComputeClientRecordMAC(TlsContentType contentType, byte[] fragment) ! { ! TlsStream data = new TlsStream(); ! byte[] result = null; ! ! data.Write(this.Context.WriteSequenceNumber); ! data.Write((byte)contentType); ! data.Write((short)this.Context.Protocol); ! data.Write((short)fragment.Length); ! data.Write(fragment); ! ! result = this.ClientHMAC.ComputeHash(data.ToArray()); ! ! data.Reset(); ! ! return result; ! } ! ! #endregion ! ! #region Key Generation Methods ! ! public override void ComputeMasterSecret(byte[] preMasterSecret) ! { ! // Create master secret ! this.Context.MasterSecret = new byte[preMasterSecret.Length]; ! this.Context.MasterSecret = this.PRF( ! preMasterSecret, "master secret", this.Context.RandomCS, 48); ! } ! ! public override void ComputeKeys() ! { ! // Create keyblock ! TlsStream keyBlock = new TlsStream( ! this.PRF( ! this.Context.MasterSecret, ! "key expansion", ! this.Context.RandomSC, ! this.KeyBlockSize)); ! ! this.Context.ClientWriteMAC = keyBlock.ReadBytes(this.HashSize); ! this.Context.ServerWriteMAC = keyBlock.ReadBytes(this.HashSize); ! this.Context.ClientWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); ! this.Context.ServerWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); ! ! if (!this.IsExportable) ! { ! if (this.IvSize != 0) ! { ! this.Context.ClientWriteIV = keyBlock.ReadBytes(this.IvSize); ! this.Context.ServerWriteIV = keyBlock.ReadBytes(this.IvSize); ! } ! else ! { ! this.Context.ClientWriteIV = new byte[0]; ! this.Context.ServerWriteIV = new byte[0]; ! } ! } ! else ! { ! // 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]; ! System.Array.Copy(ivBlock, 0, this.Context.ClientWriteIV, 0, this.Context.ClientWriteIV.Length); ! ! this.Context.ServerWriteIV = new byte[this.IvSize]; ! System.Array.Copy(ivBlock, this.IvSize, this.Context.ServerWriteIV, 0, this.Context.ServerWriteIV.Length); ! } ! ! // Clear no more needed data ! keyBlock.Reset(); ! } ! ! #endregion ! } } \ No newline at end of file --- 1,158 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.IO; ! using System.Text; ! using System.Security.Cryptography; ! using System.Security.Cryptography.X509Certificates; ! ! using Mono.Security; ! using Mono.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class TlsCipherSuite : CipherSuite ! { ! #region Constructors ! ! public TlsCipherSuite( ! short code, string name, CipherAlgorithmType cipherAlgorithmType, ! HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) : ! base(code, name, cipherAlgorithmType, hashAlgorithmType, ! exchangeAlgorithmType, exportable, blockMode, keyMaterialSize, ! expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize) ! { ! } ! ! #endregion ! ! #region MAC Generation Methods ! ! public override byte[] ComputeServerRecordMAC(TlsContentType contentType, byte[] fragment) ! { ! TlsStream data = new TlsStream(); ! byte[] result = null; ! ! data.Write(this.Context.ReadSequenceNumber); ! data.Write((byte)contentType); ! data.Write((short)this.Context.Protocol); ! data.Write((short)fragment.Length); ! data.Write(fragment); ! ! result = this.ServerHMAC.ComputeHash(data.ToArray()); ! ! data.Reset(); ! ! return result; ! } ! ! public override byte[] ComputeClientRecordMAC(TlsContentType contentType, byte[] fragment) ! { ! TlsStream data = new TlsStream(); ! byte[] result = null; ! ! data.Write(this.Context.WriteSequenceNumber); ! data.Write((byte)contentType); ! data.Write((short)this.Context.Protocol); ! data.Write((short)fragment.Length); ! data.Write(fragment); ! ! result = this.ClientHMAC.ComputeHash(data.ToArray()); ! ! data.Reset(); ! ! return result; ! } ! ! #endregion ! ! #region Key Generation Methods ! ! public override void ComputeMasterSecret(byte[] preMasterSecret) ! { ! // Create master secret ! this.Context.MasterSecret = new byte[preMasterSecret.Length]; ! this.Context.MasterSecret = this.PRF( ! preMasterSecret, "master secret", this.Context.RandomCS, 48); ! } ! ! public override void ComputeKeys() ! { ! // Create keyblock ! TlsStream keyBlock = new TlsStream( ! this.PRF( ! this.Context.MasterSecret, ! "key expansion", ! this.Context.RandomSC, ! this.KeyBlockSize)); ! ! this.Context.ClientWriteMAC = keyBlock.ReadBytes(this.HashSize); ! this.Context.ServerWriteMAC = keyBlock.ReadBytes(this.HashSize); ! this.Context.ClientWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); ! this.Context.ServerWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); ! ! if (!this.IsExportable) ! { ! if (this.IvSize != 0) ! { ! this.Context.ClientWriteIV = keyBlock.ReadBytes(this.IvSize); ! this.Context.ServerWriteIV = keyBlock.ReadBytes(this.IvSize); ! } ! else ! { ! this.Context.ClientWriteIV = new byte[0]; ! this.Context.ServerWriteIV = new byte[0]; ! } ! } ! else ! { ! // 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]; ! System.Array.Copy(ivBlock, 0, this.Context.ClientWriteIV, 0, this.Context.ClientWriteIV.Length); ! ! this.Context.ServerWriteIV = new byte[this.IvSize]; ! System.Array.Copy(ivBlock, this.IvSize, this.Context.ServerWriteIV, 0, this.Context.ServerWriteIV.Length); ! } ! ! // Clear no more needed data ! keyBlock.Reset(); ! } ! ! #endregion ! } } \ No newline at end of file Index: TlsCipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteCollection.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsCipherSuiteCollection.cs 14 Dec 2003 14:59:39 -0000 1.7 --- TlsCipherSuiteCollection.cs 9 Feb 2004 14:17:02 -0000 1.8 *************** *** 1,167 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Collections; ! using System.Globalization; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal sealed class TlsCipherSuiteCollection : ArrayList ! { ! #region Fields ! ! private SecurityProtocolType protocol; ! ! #endregion ! ! #region Properties ! ! public CipherSuite this[string name] ! { ! get { return (CipherSuite)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (CipherSuite)value; } ! } ! ! public CipherSuite this[short code] ! { ! get { return (CipherSuite)base[IndexOf(code)]; } ! set { base[IndexOf(code)] = (CipherSuite)value; } ! } ! ! public new CipherSuite this[int code] ! { ! get { return (CipherSuite)base[code]; } ! set { base[code] = (CipherSuite)value; } ! } ! ! #endregion ! ! #region Constructors ! ! public TlsCipherSuiteCollection(SecurityProtocolType protocol) : base() ! { ! this.protocol = protocol; ! } ! ! #endregion ! ! #region Methods ! ! public bool Contains(string name) ! { ! return(-1 != IndexOf(name)); ! } ! ! public int IndexOf(string name) ! { ! int index = 0; ! foreach (CipherSuite suite in this) ! { ! if (cultureAwareCompare(suite.Name, name)) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public int IndexOf(short code) ! { ! int index = 0; ! foreach (CipherSuite suite in this) ! { ! if (suite.Code == code) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public void RemoveAt(string errorMessage) ! { ! RemoveAt(IndexOf(errorMessage)); ! } ! ! public CipherSuite Add( ! short code, string name, CipherAlgorithmType cipherType, ! HashAlgorithmType hashType, ExchangeAlgorithmType exchangeType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) ! { ! switch (this.protocol) ! { ! case SecurityProtocolType.Ssl3: ! return this.add( ! new TlsSslCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); ! ! case SecurityProtocolType.Tls: ! return this.add( ! new TlsCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); ! ! default: ! throw new NotSupportedException(); ! } ! } ! ! private TlsCipherSuite add(TlsCipherSuite cipherSuite) ! { ! base.Add(cipherSuite); ! ! return cipherSuite; ! } ! ! private TlsSslCipherSuite add(TlsSslCipherSuite cipherSuite) ! { ! base.Add(cipherSuite); ! ! return cipherSuite; ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (NotSupportedException) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } --- 1,167 ---- ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003-2004 Carlos Guzman Alvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! using System.Collections; ! using System.Globalization; ! using System.Security.Cryptography; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal sealed class TlsCipherSuiteCollection : ArrayList ! { ! #region Fields ! ! private SecurityProtocolType protocol; ! ! #endregion ! ! #region Properties ! ! public CipherSuite this[string name] ! { ! get { return (CipherSuite)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (CipherSuite)value; } ! } ! ! public CipherSuite this[short code] ! { ! get { return (CipherSuite)base[IndexOf(code)]; } ! set { base[IndexOf(code)] = (CipherSuite)value; } ! } ! ! public new CipherSuite this[int code] ! { ! get { return (CipherSuite)base[code]; } ! set { base[code] = (CipherSuite)value; } ! } ! ! #endregion ! ! #region Constructors ! ! public TlsCipherSuiteCollection(SecurityProtocolType protocol) : base() ! { ! this.protocol = protocol; ! } ! ! #endregion ! ! #region Methods ! ! public bool Contains(string name) ! { ! return(-1 != IndexOf(name)); ! } ! ! public int IndexOf(string name) ! { ! int index = 0; ! foreach (CipherSuite suite in this) ! { ! if (cultureAwareCompare(suite.Name, name)) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public int IndexOf(short code) ! { ! int index = 0; ! foreach (CipherSuite suite in this) ! { ! if (suite.Code == code) ! { ! return index; ! } ! index++; ! } ! return -1; ! } ! ! public void RemoveAt(string errorMessage) ! { ! RemoveAt(IndexOf(errorMessage)); ! } ! ! public CipherSuite Add( ! short code, string name, CipherAlgorithmType cipherType, ! HashAlgorithmType hashType, ExchangeAlgorithmType exchangeType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) ! { ! switch (this.protocol) ! { ! case SecurityProtocolType.Ssl3: ! return this.add( ! new TlsSslCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); ! ! case SecurityProtocolType.Tls: ! return this.add( ! new TlsCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); ! ! default: ! throw new NotSupportedException(); ! } ! } ! ! private TlsCipherSuite add(TlsCipherSuite cipherSuite) ! { ! base.Add(cipherSuite); ! ! return cipherSuite; ! } ! ! private TlsSslCipherSuite add(TlsSslCipherSuite cipherSuite) ! { ! base.Add(cipherSuite); ! ! return cipherSuite; ! } ! ! private bool cultureAwareCompare(string strA, string strB) ! { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (NotSupportedException) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } ! } ! ! #endregion ! } ! } Index: TlsCipherSuiteFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TlsCipherSuiteFactory.cs 26 Dec 2003 11:14:26 -0000 1.16 --- TlsCipherSuiteFactory.cs 9 Feb 2004 14:17:02 -0000 1.17 *************** *** 1,168 **** ! /* Transport Security Layer (TLS) ! * Copyright (c) 2003 Carlos Guzmán Álvarez ! * ! * Permission is hereby granted, free of charge, to any person ! * obtaining a copy of this software and associated documentation ! * files (the "Software"), to deal in the Software without restriction, ! * including without limitation the rights to use, copy, modify, merge, ! * publish, distribute, sublicense, and/or sell copies of the Software, ! * and to permit persons to whom the Software is furnished to do so, ! * subject to the following conditions: ! * ! * The above copyright notice and this permission notice shall be included ! * in all copies or substantial portions of the Software. ! * ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ! * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! * DEALINGS IN THE SOFTWARE. ! */ ! ! using System; ! ! namespace Mono.Security.Protocol.Tls ! { ! internal class TlsCipherSuiteFactory ! { ! public static TlsCipherSuiteCollection GetSupportedCiphers(SecurityProtocolType protocol) ! { ! switch (protocol) ! { ! case SecurityProtocolType.Ssl3: ! return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); ! ! case SecurityProtocolType.Tls: ! return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); ! ! default: ! throw new NotSupportedException(); ! } ! } ! ! #region Private Static Methods ! ! private static TlsCipherSuiteCollection GetTls1SupportedCiphers() ! { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Tls); ! ! // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); ! scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! ! // Default CipherSuite ! // scs.Add(0, "TLS_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! ! // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "TLS_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSignKeyX, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "TLS_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "TLS_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "TLS_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, tru... [truncated message content] |
From: <car...@us...> - 2004-02-09 11:58:04
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14327 Modified Files: PgSqlClient.build Log Message: Updated mono build of the nant script Index: PgSqlClient.build =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.build,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PgSqlClient.build 8 Feb 2004 22:24:38 -0000 1.11 --- PgSqlClient.build 9 Feb 2004 11:54:38 -0000 1.12 *************** *** 220,223 **** --- 220,224 ---- <arg value="/resource:${resources.dir}\Toolbox\PgDataAdapter.bmp,PostgreSql.Data.PgSqlClient.Resources.ToolBox.PgDataAdapter.bmp" /> <arg value="/optimize+" /> + <arg value="/unsafe" /> </csc> </target> |
From: <car...@us...> - 2004-02-09 11:46:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12449 Removed Files: TlsHandshakeHashes.cs Log Message: removed old files --- TlsHandshakeHashes.cs DELETED --- |
From: <car...@us...> - 2004-02-09 10:49:32
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3744 Added Files: dos2unix.sh Log Message: Added new simple tool to simplify builds between windows and linux --- NEW FILE: dos2unix.sh --- #!/bin/sh base_dir=./Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls TLS_PATH=$base_dir/Mono.Math:$base_dir/Mono.Math.Prime:$base_dir/Mono.Math.Prime.Generator TLS_PATH=$TLS_PATH:$base_dir/Mono.Math:$base_dir/Mono.Math.Prime:$base_dir/Mono.Math.Prime.Generator TLS_PATH=$base_dir/Mono.Security:$base_dir/Mono.Security/Mono.Security.Cryptography:$base_dir/Mono.Security/Mono.Security.X509: TLS_PATH=$TLS_PATH:$base_dir/Mono.Security.Protocol.Tls.Alerts:$base_dir/Mono.Security.Protocol.Tls.Handshake:$base_dir/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client:$base_dir/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server base_dir=./PostgreSql.Data.PgSqlClient/source CLIENT_PATH=$base_dir/DbSchema:$base_dir/PgTypes:$base_dir/NPgClient CLIENT_PATH=$CLIENT_PATH:$base_dir/Design/ParameterCollection for dir in `echo ${TLS_PATH}:${CLIENT_PATH} | tr ":" " "`; do echo $dir for fi in `ls $dir/*.cs`;do dos2unix -U $fi done done dos2unix -U *.txt dos2unix -U *.build dos2unix -U *.bat dos2unix -U *.html |