Exemple #1
0
        public CipherSuite(ProtocolVersion version)
        {
            ProtocolVersion = version;
            CipherSuiteID   = 0x0000;
            CipherSuiteName = "TLS_NULL_WITH_NULL_NULL";

            _keyExchangeAlgorithm = new KeyExchangeAlgorithmNull();
            _signatureAlgorithm   = new SignatureAlgorithmNull();
            _pseudoRandomFunction = null;
            _bulkCipherAlgorithm  = new BulkCipherAlgorithmNull();
            _macAlgorithm         = new MACAlgorithmNull();
        }
        public CipherSuite(ProtocolVersion version)
        {
            ProtocolVersion = version;
            CipherSuiteID = 0x0000;
            CipherSuiteName = "TLS_NULL_WITH_NULL_NULL";

            _keyExchangeAlgorithm = new KeyExchangeAlgorithmNull();
            _signatureAlgorithm = new SignatureAlgorithmNull();
            _pseudoRandomFunction = null;
            _bulkCipherAlgorithm = new BulkCipherAlgorithmNull();
            _macAlgorithm = new MACAlgorithmNull();
        }
		public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
		{
			if (_preMasterSecret == null)
				throw new CryptographicException("Premaster secret not defined");
			
			return prf.CreateDeriveBytes(_preMasterSecret, "master secret", seed).GetBytes(48);
		}
		// Returns the resulting master secret, either GetClientKeys or
		// ProcessClientKeys needs to be called before calling this method
		public abstract byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed);
		public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
		{
			throw new Exception("Master secret requested for null key exchange");
		}
Exemple #6
0
 public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
 {
     throw new Exception("Master secret requested for null key exchange");
 }
Exemple #7
0
 // Returns the resulting master secret, either GetClientKeys or
 // ProcessClientKeys needs to be called before calling this method
 public abstract byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed);
 public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
 {
     var masterSecret = prf.CreateDeriveBytes(preMasterSecret, "master secret", seed).GetBytes(48);
     this.logger?.Debug("Master Secret: " + BitConverter.ToString(masterSecret));
     return masterSecret;
 }
		public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
		{
			return prf.CreateDeriveBytes(_preMasterSecret, "master secret", seed).GetBytes(48);
		}