[pgsqlclient-checkins] pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handsha
Status: Inactive
Brought to you by:
carlosga_fb
From: Carlos G. Á. <car...@us...> - 2004-08-28 20:48:14
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10214 Modified Files: TlsClientKeyExchange.cs Log Message: Updated file Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsClientKeyExchange.cs 9 Mar 2004 22:04:55 -0000 1.7 --- TlsClientKeyExchange.cs 28 Aug 2004 20:48:05 -0000 1.8 *************** *** 47,64 **** protected override void ProcessAsSsl3() { ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! RSA rsa = (RSA)context.SslStream.PrivateKeyCertSelectionDelegate( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes((int)this.Length); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(rsa); ! byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); // Create master secret --- 47,70 ---- protected override void ProcessAsSsl3() { ! AsymmetricAlgorithm privKey = null; ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! privKey = context.SslStream.RaisePrivateKeySelection( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! if (privKey == null) ! { ! throw new TlsException(AlertDescription.UserCancelled, "Server certificate Private Key unavailable."); ! } ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes((int)this.Length); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(privKey); ! byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); // Create master secret *************** *** 72,92 **** // Clear resources ! rsa.Clear(); ! } protected override void ProcessAsTls1() { ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! RSA rsa = (RSA)context.SslStream.PrivateKeyCertSelectionDelegate( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes(this.ReadInt16()); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(rsa); byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); --- 78,105 ---- // Clear resources ! privKey.Clear(); ! } protected override void ProcessAsTls1() { ! AsymmetricAlgorithm privKey = null; ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! // Select the private key information ! privKey = context.SslStream.RaisePrivateKeySelection( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! if (privKey == null) ! { ! throw new TlsException(AlertDescription.UserCancelled, "Server certificate Private Key unavailable."); ! } ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes(this.ReadInt16()); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(privKey); byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); *************** *** 102,106 **** // Clear resources ! rsa.Clear(); } --- 115,119 ---- // Clear resources ! privKey.Clear(); } |