[pgsqlclient-checkins] pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls CipherAl
Status: Inactive
Brought to you by:
carlosga_fb
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv1035 Modified Files: CipherSuite.cs TlsCipherSuite.cs TlsCipherSuiteCollection.cs TlsCipherSuiteFactory.cs TlsNetworkStream.cs TlsSession.cs TlsSessionSettings.cs TlsSocket.cs TlsSslCipherSuite.cs Added Files: CipherAlgorithmType.cs ExchangeAlgorithmType.cs HashAlgorithmType.cs SecurityCompressionType.cs SecurityProtocolType.cs SslClientStream.cs TlsContext.cs Removed Files: TlsCompressionMethod.cs TlsProtocol.cs TlsSessionContext.cs Log Message: 2003-11-13 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Renamed to TlsContext. 2003-11-12 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Changes for give full error message only in debug mode ( Thanks to Sebastién Pouliot. ) * Mono.Security.Protocol.Tls/TlsProtocol.cs: - Renamed to SecurityProtocolType.cs ( for match .NET 1.2 ) * Mono.Security.Cryptography/MD5SHA1CryptoServiceProvider.cs: - Renamed to MD5SHA1.cs ( Thanks to Sebastién Pouliot. ) * Mono.Security.Cryptography/TlsCompressionMethod.cs: - Renamed to SecurityCompressionType. * Mono.Security.Protocol.Tls/CipherAlgorithmType.cs: * Mono.Security.Protocol.Tls/HashAlgorithmType.cs: * Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs: - New enumerations that matches .NET 1.2 definitions with some minor differences. * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsSessionContext.cs: - Added changes for make use of new enumerations. * Mono.Security.Protocol.Tls/TlsClientStream.cs: - Added new informative properties that matches .NET 1.2 SslClientStream ( Not all the properties are implemented yet ). --- NEW FILE: CipherAlgorithmType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ExchangeAlgorithmType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: HashAlgorithmType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SecurityCompressionType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SecurityProtocolType.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SslClientStream.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsContext.cs --- (This appears to be a binary file; contents omitted.) Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CipherSuite.cs 10 Nov 2003 12:16:03 -0000 1.8 --- CipherSuite.cs 13 Nov 2003 09:21:51 -0000 1.9 *************** *** 31,34 **** --- 31,35 ---- using Mono.Security.Cryptography; using Mono.Security.X509; + using M = Mono.Security.Cryptography; namespace Mono.Security.Protocol.Tls *************** *** 38,59 **** #region FIELDS ! private short code; ! private string name; ! private string algName; ! private string hashName; ! private bool isExportable; ! private CipherMode cipherMode; ! private byte keyMaterialSize; ! private byte expandedKeyMaterialSize; ! private short effectiveKeyBits; ! private byte ivSize; ! private byte blockSize; ! private TlsSessionContext context; ! private SymmetricAlgorithm encryptionAlgorithm; ! private ICryptoTransform encryptionCipher; ! private SymmetricAlgorithm decryptionAlgorithm; ! private ICryptoTransform decryptionCipher; ! private KeyedHashAlgorithm clientHMAC; ! private KeyedHashAlgorithm serverHMAC; #endregion --- 39,62 ---- #region FIELDS ! private short code; ! private string name; ! private CipherAlgorithmType cipherAlgorithmType; ! private HashAlgorithmType hashAlgorithmType; ! private ExchangeAlgorithmType exchangeAlgorithmType; ! private bool isExportable; ! private CipherMode cipherMode; ! private byte keyMaterialSize; ! private int keyBlockSize; ! private byte expandedKeyMaterialSize; ! private short effectiveKeyBits; ! private byte ivSize; ! private byte blockSize; ! private TlsContext context; ! private SymmetricAlgorithm encryptionAlgorithm; ! private ICryptoTransform encryptionCipher; ! private SymmetricAlgorithm decryptionAlgorithm; ! private ICryptoTransform decryptionCipher; ! private KeyedHashAlgorithm clientHMAC; ! private KeyedHashAlgorithm serverHMAC; #endregion *************** *** 63,82 **** protected ICryptoTransform EncryptionCipher { ! get { return encryptionCipher; } } protected ICryptoTransform DecryptionCipher { ! get { return decryptionCipher; } } protected KeyedHashAlgorithm ClientHMAC { ! get { return clientHMAC; } } protected KeyedHashAlgorithm ServerHMAC { ! get { return serverHMAC; } } --- 66,85 ---- protected ICryptoTransform EncryptionCipher { ! get { return this.encryptionCipher; } } protected ICryptoTransform DecryptionCipher { ! get { return this.decryptionCipher; } } protected KeyedHashAlgorithm ClientHMAC { ! get { return this.clientHMAC; } } protected KeyedHashAlgorithm ServerHMAC { ! get { return this.serverHMAC; } } *************** *** 85,155 **** #region PROPERTIES ! public short Code { ! get { return code; } } ! public string Name { ! get { return name; } } ! public bool IsExportable { ! get { return isExportable; } } public CipherMode CipherMode { ! get { return cipherMode; } } ! public int HashSize { ! get { return (int)(hashName == "MD5" ? 16 : 20); } } public byte KeyMaterialSize { ! get { return keyMaterialSize; } } public int KeyBlockSize { ! get ! { ! return keyMaterialSize*2 + HashSize*2 + ivSize*2; ! } } public byte ExpandedKeyMaterialSize { ! get { return expandedKeyMaterialSize; } } public byte EffectiveKeyBits { ! get { return EffectiveKeyBits; } } public byte IvSize { ! get { return ivSize; } } public byte BlockSize { ! get { return blockSize; } ! } ! ! public string HashName ! { ! get { return hashName; } } ! public TlsSessionContext Context { ! get { return context; } ! set { context = value; } } --- 88,196 ---- #region PROPERTIES ! public CipherAlgorithmType CipherAlgorithmType { ! get { return this.cipherAlgorithmType; } } ! public string HashAlgorithmName { ! get ! { ! switch (this.hashAlgorithmType) ! { ! case HashAlgorithmType.Md5: ! return "MD5"; ! ! case HashAlgorithmType.Sha1: ! return "SHA1"; ! ! default: ! return "None"; ! } ! } } ! public HashAlgorithmType HashAlgorithmType { ! get { return this.hashAlgorithmType; } ! } ! ! public int HashSize ! { ! get ! { ! switch (this.hashAlgorithmType) ! { ! case HashAlgorithmType.Md5: ! return 16; ! ! case HashAlgorithmType.Sha1: ! return 20; ! ! default: ! return 0; ! } ! } ! } ! ! public ExchangeAlgorithmType ExchangeAlgorithmType ! { ! get { return this.exchangeAlgorithmType; } } public CipherMode CipherMode { ! get { return this.cipherMode; } } ! public short Code { ! get { return this.code; } ! } ! ! public string Name ! { ! get { return this.name; } ! } ! ! public bool IsExportable ! { ! get { return this.isExportable; } } public byte KeyMaterialSize { ! get { return this.keyMaterialSize; } } public int KeyBlockSize { ! get { return this.keyBlockSize; } } public byte ExpandedKeyMaterialSize { ! get { return this.expandedKeyMaterialSize; } } public byte EffectiveKeyBits { ! get { return this.EffectiveKeyBits; } } public byte IvSize { ! get { return this.ivSize; } } public byte BlockSize { ! get { return this.blockSize; } } ! public TlsContext Context { ! get { return this.context; } ! set { this.context = value; } } *************** *** 158,177 **** #region CONSTRUCTORS ! public CipherSuite(short code, string name, string algName, string hashName, bool exportable, bool blockMode, byte keyMaterialSize, byte expandedKeyMaterialSize, short effectiveKeyBytes, byte ivSize, byte blockSize) { ! this.code = code; ! this.name = name; ! this.algName = algName; ! this.hashName = hashName; ! this.isExportable = exportable; if (blockMode) { ! this.cipherMode = CipherMode.CBC; } ! this.keyMaterialSize = keyMaterialSize; ! this.expandedKeyMaterialSize = expandedKeyMaterialSize; ! this.effectiveKeyBits = effectiveKeyBits; ! this.ivSize = ivSize; ! this.blockSize = blockSize; } --- 199,225 ---- #region CONSTRUCTORS ! public CipherSuite( ! short code, string name, CipherAlgorithmType cipherAlgorithmType, ! HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) { ! this.code = code; ! this.name = name; ! this.cipherAlgorithmType = cipherAlgorithmType; ! this.hashAlgorithmType = hashAlgorithmType; ! this.exchangeAlgorithmType = exchangeAlgorithmType; ! this.isExportable = exportable; if (blockMode) { ! this.cipherMode = CipherMode.CBC; } ! this.keyMaterialSize = keyMaterialSize; ! this.expandedKeyMaterialSize= expandedKeyMaterialSize; ! this.effectiveKeyBits = effectiveKeyBits; ! this.ivSize = ivSize; ! this.blockSize = blockSize; ! this.keyBlockSize = this.keyMaterialSize*2 + this.HashSize*2 + this.ivSize*2; } *************** *** 182,187 **** public void InitializeCipher() { ! createEncryptionCipher(); ! createDecryptionCipher(); } --- 230,235 ---- public void InitializeCipher() { ! this.createEncryptionCipher(); ! this.createDecryptionCipher(); } *************** *** 191,195 **** if (this.Context.ServerSettings.ServerKeyExchange) { ! rsa = new RSACryptoServiceProvider(); rsa.ImportParameters(this.Context.ServerSettings.RsaParameters); } --- 239,243 ---- if (this.Context.ServerSettings.ServerKeyExchange) { ! rsa = RSA.Create(); rsa.ImportParameters(this.Context.ServerSettings.RsaParameters); } *************** *** 202,226 **** } - public RSACryptoServiceProvider CreateRSA(RSAParameters rsaParams) - { - // BUG: MS BCL 1.0 can't import a key which - // isn't the same size as the one present in - // the container. - int keySize = (rsaParams.Modulus.Length << 3); - RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(keySize); - rsa.ImportParameters(rsaParams); - - return rsa; - } - public void UpdateClientCipherIV(byte[] iv) { ! if (cipherMode == CipherMode.CBC) { // Set the new IV ! encryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! encryptionCipher = encryptionAlgorithm.CreateEncryptor(); } } --- 250,262 ---- } public void UpdateClientCipherIV(byte[] iv) { ! if (this.cipherMode == CipherMode.CBC) { // Set the new IV ! this.encryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! this.encryptionCipher = this.encryptionAlgorithm.CreateEncryptor(); } } *************** *** 228,238 **** public void UpdateServerCipherIV(byte[] iv) { ! if (cipherMode == CipherMode.CBC) { // Set the new IV ! decryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! decryptionCipher = decryptionAlgorithm.CreateDecryptor(); } } --- 264,274 ---- public void UpdateServerCipherIV(byte[] iv) { ! if (this.cipherMode == CipherMode.CBC) { // Set the new IV ! this.decryptionAlgorithm.IV = iv; // Create encryption cipher with the new IV ! this.decryptionCipher = this.decryptionAlgorithm.CreateDecryptor(); } } *************** *** 294,302 **** */ ! fragmentSize = (buffer.Length - (paddingLength + 1)) - HashSize; } else { ! fragmentSize = buffer.Length - HashSize; } --- 330,338 ---- */ ! fragmentSize = (buffer.Length - (paddingLength + 1)) - this.HashSize; } else { ! fragmentSize = buffer.Length - this.HashSize; } *************** *** 388,392 **** } ! HMAC hmac = new HMAC(hashName, secret); TlsStream resMacs = new TlsStream(); --- 424,428 ---- } ! M.HMAC hmac = new M.HMAC(hashName, secret); TlsStream resMacs = new TlsStream(); *************** *** 418,473 **** #region PRIVATE_METHODS - // This code is from Mono.Security.X509Certificate class. - private byte[] getUnsignedBigInteger(byte[] integer) - { - if (integer[0] == 0x00) - { - // this first byte is added so we're sure it's an unsigned integer - // however we can't feed it into RSAParameters or DSAParameters - int length = integer.Length - 1; - byte[] uinteger = new byte[length]; - Array.Copy(integer, 1, uinteger, 0, length); - - return uinteger; - } - else - { - return integer; - } - } - private void createEncryptionCipher() { // Create and configure the symmetric algorithm ! switch (this.algName) { ! case "RC4": ! encryptionAlgorithm = new ARC4Managed(); break; ! default: ! encryptionAlgorithm = SymmetricAlgorithm.Create(algName); break; } // If it's a block cipher ! if (cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! encryptionAlgorithm.Mode = this.cipherMode; ! encryptionAlgorithm.Padding = PaddingMode.None; ! encryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! encryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! encryptionAlgorithm.Key = context.ClientWriteKey; ! encryptionAlgorithm.IV = context.ClientWriteIV; // Create encryption cipher ! encryptionCipher = encryptionAlgorithm.CreateEncryptor(); // Create the HMAC algorithm for the client ! clientHMAC = new HMAC(hashName, context.ClientWriteMAC); } --- 454,504 ---- #region PRIVATE_METHODS private void createEncryptionCipher() { // Create and configure the symmetric algorithm ! switch (this.cipherAlgorithmType) { ! case CipherAlgorithmType.Des: ! this.encryptionAlgorithm = DES.Create(); break; ! case CipherAlgorithmType.Rc2: ! this.encryptionAlgorithm = RC2.Create(); ! break; ! ! case CipherAlgorithmType.Rc4: ! this.encryptionAlgorithm = new ARC4Managed(); ! break; ! ! case CipherAlgorithmType.TripleDes: ! this.encryptionAlgorithm = TripleDES.Create(); ! break; ! ! case CipherAlgorithmType.Rijndael: ! this.encryptionAlgorithm = Rijndael.Create(); break; } // If it's a block cipher ! if (this.cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! this.encryptionAlgorithm.Mode = this.cipherMode; ! this.encryptionAlgorithm.Padding = PaddingMode.None; ! this.encryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! this.encryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! this.encryptionAlgorithm.Key = this.context.ClientWriteKey; ! this.encryptionAlgorithm.IV = this.context.ClientWriteIV; // Create encryption cipher ! this.encryptionCipher = this.encryptionAlgorithm.CreateEncryptor(); // Create the HMAC algorithm for the client ! this.clientHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ClientWriteMAC); } *************** *** 475,508 **** { // Create and configure the symmetric algorithm ! switch (this.algName) { ! case "RC4": ! decryptionAlgorithm = new ARC4Managed(); break; ! default: ! decryptionAlgorithm = SymmetricAlgorithm.Create(algName); break; } // If it's a block cipher ! if (cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! decryptionAlgorithm.Mode = this.cipherMode; ! decryptionAlgorithm.Padding = PaddingMode.None; ! decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! decryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! decryptionAlgorithm.Key = context.ServerWriteKey; ! decryptionAlgorithm.IV = context.ServerWriteIV; // Create decryption cipher ! decryptionCipher = decryptionAlgorithm.CreateDecryptor(); // Create the HMAC algorithm for the server ! serverHMAC = new HMAC(hashName, context.ServerWriteMAC); } --- 506,553 ---- { // Create and configure the symmetric algorithm ! switch (this.cipherAlgorithmType) { ! case CipherAlgorithmType.Des: ! this.decryptionAlgorithm = DES.Create(); break; ! case CipherAlgorithmType.Rc2: ! this.decryptionAlgorithm = RC2.Create(); ! break; ! ! case CipherAlgorithmType.Rc4: ! this.decryptionAlgorithm = new ARC4Managed(); ! break; ! ! case CipherAlgorithmType.TripleDes: ! this.decryptionAlgorithm = TripleDES.Create(); ! break; ! ! case CipherAlgorithmType.Rijndael: ! this.decryptionAlgorithm = Rijndael.Create(); break; } // If it's a block cipher ! if (this.cipherMode == CipherMode.CBC) { // Configure encrypt algorithm ! this.decryptionAlgorithm.Mode = this.cipherMode; ! this.decryptionAlgorithm.Padding = PaddingMode.None; ! this.decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; ! this.decryptionAlgorithm.BlockSize = this.blockSize * 8; } // Set the key and IV for the algorithm ! this.decryptionAlgorithm.Key = this.context.ServerWriteKey; ! this.decryptionAlgorithm.IV = this.context.ServerWriteIV; // Create decryption cipher ! this.decryptionCipher = this.decryptionAlgorithm.CreateDecryptor(); // Create the HMAC algorithm for the server ! this.serverHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ServerWriteMAC); } Index: TlsCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuite.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsCipherSuite.cs 24 Oct 2003 09:39:21 -0000 1.8 --- TlsCipherSuite.cs 13 Nov 2003 09:21:52 -0000 1.9 *************** *** 38,48 **** #region CONSTRUCTORS ! public TlsCipherSuite(short code, string name, string algName, ! string hashName, bool exportable, bool blockMode, ! byte keyMaterialSize, byte expandedKeyMaterialSize, ! short effectiveKeyBytes, byte ivSize, byte blockSize) ! : base (code, name, algName, hashName, exportable, blockMode, ! keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ! ivSize, blockSize) { } --- 38,50 ---- #region CONSTRUCTORS ! public TlsCipherSuite( ! short code, string name, CipherAlgorithmType cipherAlgorithmType, ! HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) : ! base(code, name, cipherAlgorithmType, hashAlgorithmType, ! exchangeAlgorithmType, exportable, blockMode, keyMaterialSize, ! expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize) { } Index: TlsCipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteCollection.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsCipherSuiteCollection.cs 21 Oct 2003 20:04:09 -0000 1.4 --- TlsCipherSuiteCollection.cs 13 Nov 2003 09:21:52 -0000 1.5 *************** *** 34,38 **** #region FIELDS ! private TlsProtocol protocol; #endregion --- 34,38 ---- #region FIELDS ! private SecurityProtocolType protocol; #endregion *************** *** 62,66 **** #region CONSTRUCTORS ! public TlsCipherSuiteCollection(TlsProtocol protocol) : base() { this.protocol = protocol; --- 62,66 ---- #region CONSTRUCTORS ! public TlsCipherSuiteCollection(SecurityProtocolType protocol) : base() { this.protocol = protocol; *************** *** 109,123 **** } ! public CipherSuite Add(short code, string name, string algName, string hashName, bool exportable, bool blockMode, byte keyMaterialSize, byte expandedKeyMaterialSize, short effectiveKeyBytes, byte ivSize, byte blockSize) { switch (this.protocol) { ! case TlsProtocol.Tls1: return this.add( ! new TlsCipherSuite(code, name, algName, hashName, exportable, blockMode, keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize)); ! case TlsProtocol.Ssl3: return this.add( ! new TlsSslCipherSuite(code, name, algName, hashName, exportable, blockMode, keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize)); default: --- 109,134 ---- } ! public CipherSuite Add( ! short code, string name, CipherAlgorithmType cipherType, ! HashAlgorithmType hashType, ExchangeAlgorithmType exchangeType, ! bool exportable, bool blockMode, byte keyMaterialSize, ! byte expandedKeyMaterialSize, short effectiveKeyBytes, ! byte ivSize, byte blockSize) { switch (this.protocol) { ! case SecurityProtocolType.Ssl3: return this.add( ! new TlsSslCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); ! case SecurityProtocolType.Tls1: return this.add( ! new TlsCipherSuite( ! code, name, cipherType, hashType, exchangeType, exportable, ! blockMode, keyMaterialSize, expandedKeyMaterialSize, ! effectiveKeyBytes, ivSize, blockSize)); default: Index: TlsCipherSuiteFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsCipherSuiteFactory.cs 7 Nov 2003 10:05:35 -0000 1.9 --- TlsCipherSuiteFactory.cs 13 Nov 2003 09:21:52 -0000 1.10 *************** *** 29,42 **** internal class TlsCipherSuiteFactory { ! public static TlsCipherSuiteCollection GetSupportedCiphers(TlsProtocol protocol) { switch (protocol) { ! case TlsProtocol.Tls1: ! return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); ! ! case TlsProtocol.Ssl3: return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); default: throw new NotSupportedException(); --- 29,42 ---- internal class TlsCipherSuiteFactory { ! public static TlsCipherSuiteCollection GetSupportedCiphers(SecurityProtocolType protocol) { switch (protocol) { ! case SecurityProtocolType.Ssl3: return TlsCipherSuiteFactory.GetSsl3SupportedCiphers(); + case SecurityProtocolType.Tls1: + return TlsCipherSuiteFactory.GetTls1SupportedCiphers(); + default: throw new NotSupportedException(); *************** *** 48,96 **** private static TlsCipherSuiteCollection GetTls1SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(TlsProtocol.Tls1); // Supported ciphers ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 16, 16); ! scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "TLS_NULL_WITH_NULL_NULL", "", "", true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "TLS_RSA_WITH_NULL_MD5", "", "MD5", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", "", "SHA1", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", "RC2", "MD5", true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "TLS_RSA_WITH_IDEA_CBC_SHA", "IDEA", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "TLS_DH_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "TLS_DH_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "TLS_DHE_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "TLS_DHE_RSA_WITH_DES_CBC_SHA", "SHA1", "DES", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "TLS_DH_anon_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "TLS_DH_anon_WITH_DES_CBC_SHA", "DES4", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); // AES CipherSuites --- 48,96 ---- private static TlsCipherSuiteCollection GetTls1SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Tls1); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); ! scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "TLS_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "TLS_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSignKeyX, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "TLS_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "TLS_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "TLS_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "TLS_DHE_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "TLS_DHE_RSA_WITH_DES_CBC_SHA", HashAlgorithmType.Sha1, CipherAlgorithmType.Des, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.DiffieHellman, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "TLS_DH_anon_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, false, ExchangeAlgorithmType.DiffieHellman, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "TLS_DH_anon_WITH_DES_CBC_SHA", "DES4", HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); // AES CipherSuites *************** *** 98,114 **** // Ref: RFC3268 - (http://www.ietf.org/rfc/rfc3268.txt) ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x30, "TLS_DH_DSS_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x31, "TLS_DH_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x32, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x33, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x34, "TLS_DH_anon_WITH_AES_128_CBC_SHA", "Rijndael", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x36, "TLS_DH_DSS_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x37, "TLS_DH_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x38, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x39, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x3A, "TLS_DH_anon_WITH_AES_256_CBC_SHA", "Rijndael", "SHA1", false, true, 32, 32, 256, 16, 16); return scs; --- 98,114 ---- // Ref: RFC3268 - (http://www.ietf.org/rfc/rfc3268.txt) ! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x30, "TLS_DH_DSS_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x31, "TLS_DH_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x32, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x33, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x34, "TLS_DH_anon_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x36, "TLS_DH_DSS_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x37, "TLS_DH_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x38, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x39, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); ! // scs.Add((0x00 << 0x08) | 0x3A, "TLS_DH_anon_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); return scs; *************** *** 117,163 **** private static TlsCipherSuiteCollection GetSsl3SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(TlsProtocol.Ssl3); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", "", "", true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "SSL_RSA_WITH_NULL_MD5", "", "MD5", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "SSL_RSA_WITH_NULL_SHA", "", "SHA1", true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", "RC4", "SHA1", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", "RC2", "MD5", true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "SSL_RSA_WITH_IDEA_CBC_SHA", "IDEA", "SHA1", false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "SSL_DH_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "SSL_DH_RSA_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "SSL_DHE_DSS_WITH_DES_CBC_SHA", "DES", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "SSL_DHE_RSA_WITH_DES_CBC_SHA", "SHA1", "DES", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "SSL_DH_anon_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA1", false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "SSL_DH_anon_WITH_DES_CBC_SHA", "DES4", "SHA1", false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA1", false, true, 24, 24, 168, 8, 8); return scs; --- 117,163 ---- private static TlsCipherSuiteCollection GetSsl3SupportedCiphers() { ! TlsCipherSuiteCollection scs = new TlsCipherSuiteCollection(SecurityProtocolType.Ssl3); // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); // Default CipherSuite ! // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, true, false, 0, 0, 0, 0, 0); // RSA Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x01, "SSL_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x02, "SSL_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, true, ExchangeAlgorithmType.None, false, 0, 0, 0, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x06, "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x07, "SSL_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyEx, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! // Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x0B, "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0C, "SSL_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0D, "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0E, "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x0F, "SSL_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x10, "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x11, "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x12, "SSL_DHE_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x13, "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x14, "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x15, "SSL_DHE_RSA_WITH_DES_CBC_SHA", HashAlgorithmType.Sha1, CipherAlgorithmType.Des, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x16, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); // Anonymous Diffie-Hellman Cipher Suites ! // scs.Add((0x00 << 0x08) | 0x17, "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.DiffieHellman, true, false, 5, 16, 40, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x18, "SSL_DH_anon_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, false, ExchangeAlgorithmType.DiffieHellman, false, 16, 16, 128, 0, 0); ! // scs.Add((0x00 << 0x08) | 0x19, "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 5, 8, 40, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1A, "SSL_DH_anon_WITH_DES_CBC_SHA", "DES4", HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); ! // scs.Add((0x00 << 0x08) | 0x1B, "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); return scs; *************** *** 166,168 **** #endregion } ! } --- 166,168 ---- #endregion } ! } \ No newline at end of file Index: TlsNetworkStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsNetworkStream.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsNetworkStream.cs 11 Oct 2003 10:04:20 -0000 1.1 --- TlsNetworkStream.cs 13 Nov 2003 09:21:52 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- using System.Net; using System.Net.Sockets; + using System.Security.Cryptography.X509Certificates; namespace Mono.Security.Protocol.Tls *************** *** 93,96 **** --- 94,154 ---- } } + + #endregion + + #region SECURITY_PROPERTIES + + public CipherAlgorithmType CipherAlgorithm + { + get { return this.socket.Session.Context.Cipher.CipherAlgorithmType;} + } + + public int CipherStrength + { + get { return this.socket.Session.Context.Cipher.EffectiveKeyBits;} + } + + public X509CertificateCollection ClientCertificates + { + get { return this.socket.Session.Settings.Certificates;} + } + + public HashAlgorithmType HashAlgorithm + { + get { return this.socket.Session.Context.Cipher.HashAlgorithmType; } + } + + public int HashStrength + { + get { return this.socket.Session.Context.Cipher.HashSize * 8; } + } + + public int KeyExchangeStrength + { + get + { + return this.socket.Session.Context.ServerSettings.Certificates[0].RSA.KeySize; + } + } + + public ExchangeAlgorithmType KeyExchangeAlgorithm + { + get { return this.socket.Session.Context.Cipher.ExchangeAlgorithmType; } + } + + public SecurityProtocolType SecurityProtocol + { + get { return this.socket.Session.Context.Protocol; } + } + + public X509Certificate SelectedClientCertificate + { + get { throw new NotImplementedException(); } + } + + public X509Certificate ServerCertificate + { + get { throw new NotImplementedException(); } + } #endregion Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsSession.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsSession.cs 21 Oct 2003 20:04:09 -0000 1.8 --- TlsSession.cs 13 Nov 2003 09:21:52 -0000 1.9 *************** *** 46,50 **** private byte[] sessionId; ! private TlsSessionContext context; private TlsSessionSettings settings; private TlsSocket socket; --- 46,50 ---- private byte[] sessionId; ! private TlsContext context; private TlsSessionSettings settings; private TlsSocket socket; *************** *** 76,80 **** #region INTERNAL_PROPERTIES ! internal TlsSessionContext Context { get { return context; } --- 76,80 ---- #region INTERNAL_PROPERTIES ! internal TlsContext Context { get { return context; } *************** *** 99,103 **** { this.settings = settings; ! this.context = new TlsSessionContext(); this.sessionId = new byte[0]; --- 99,103 ---- { this.settings = settings; ! this.context = new TlsContext(); this.sessionId = new byte[0]; *************** *** 257,261 **** // Reset session information this.isSecure = false; ! this.context = new TlsSessionContext(); this.sessionId = new byte[0]; } --- 257,261 ---- // Reset session information this.isSecure = false; ! this.context = new TlsContext(); this.sessionId = new byte[0]; } Index: TlsSessionSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsSessionSettings.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsSessionSettings.cs 21 Oct 2003 16:05:12 -0000 1.3 --- TlsSessionSettings.cs 13 Nov 2003 09:21:52 -0000 1.4 *************** *** 36,41 **** private int serverPort; private Encoding encoding; ! private TlsProtocol protocol; ! private TlsCompressionMethod compressionMethod; private X509CertificateCollection certificates; --- 36,41 ---- private int serverPort; private Encoding encoding; ! private SecurityProtocolType protocol; ! private SecurityCompressionType compressionMethod; private X509CertificateCollection certificates; *************** *** 62,72 **** } ! public TlsProtocol Protocol { get { return protocol; } set { ! if (value != TlsProtocol.Tls1 && ! value != TlsProtocol.Ssl3) { throw new NotSupportedException("Specified protocol is not supported"); --- 62,72 ---- } ! public SecurityProtocolType Protocol { get { return protocol; } set { ! if (value != SecurityProtocolType.Tls1 && ! value != SecurityProtocolType.Ssl3) { throw new NotSupportedException("Specified protocol is not supported"); *************** *** 76,85 **** } ! public TlsCompressionMethod CompressionMethod { get { return compressionMethod; } set { ! if (value != TlsCompressionMethod.None) { throw new NotSupportedException("Specified compression method is not supported"); --- 76,85 ---- } ! public SecurityCompressionType CompressionMethod { get { return compressionMethod; } set { ! if (value != SecurityCompressionType.None) { throw new NotSupportedException("Specified compression method is not supported"); *************** *** 101,106 **** public TlsSessionSettings() { ! this.protocol = TlsProtocol.Tls1; ! this.compressionMethod = TlsCompressionMethod.None; this.certificates = new X509CertificateCollection(); this.serverName = "localhost"; --- 101,106 ---- public TlsSessionSettings() { ! this.protocol = SecurityProtocolType.Tls1; ! this.compressionMethod = SecurityCompressionType.None; this.certificates = new X509CertificateCollection(); this.serverName = "localhost"; *************** *** 109,118 **** } ! public TlsSessionSettings(TlsProtocol protocol) : this() { this.Protocol = protocol; } ! public TlsSessionSettings(TlsProtocol protocol, Encoding encoding) : this(protocol) { this.encoding = encoding; --- 109,118 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol) : this() { this.Protocol = protocol; } ! public TlsSessionSettings(SecurityProtocolType protocol, Encoding encoding) : this(protocol) { this.encoding = encoding; *************** *** 143,152 **** } ! public TlsSessionSettings(TlsProtocol protocol, string serverName) : this(protocol) { this.serverName = serverName; } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, Encoding encoding) : this(protocol) { this.serverName = serverName; --- 143,152 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName) : this(protocol) { this.serverName = serverName; } ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName, Encoding encoding) : this(protocol) { this.serverName = serverName; *************** *** 155,159 **** ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort) : this(protocol) { this.serverName = serverName; --- 155,159 ---- ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName, int serverPort) : this(protocol) { this.serverName = serverName; *************** *** 161,165 **** } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.serverName = serverName; --- 161,165 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.serverName = serverName; *************** *** 168,177 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates) : this(protocol) { this.certificates = certificates; } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, Encoding encoding) : this(protocol) { this.certificates = certificates; --- 168,177 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates) : this(protocol) { this.certificates = certificates; } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates, Encoding encoding) : this(protocol) { this.certificates = certificates; *************** *** 179,183 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort) : this(protocol) { this.certificates = certificates; --- 179,183 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates, string serverName, int serverPort) : this(protocol) { this.certificates = certificates; *************** *** 186,190 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.certificates = certificates; --- 186,190 ---- } ! public TlsSessionSettings(SecurityProtocolType protocol, X509CertificateCollection certificates, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.certificates = certificates; *************** *** 194,213 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509Certificate[] certificate... [truncated message content] |