示例#1
0
        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)
        {
            if (_preMasterSecret == null)
            {
                throw new CryptographicException("Premaster secret not defined");
            }

            return(prf.CreateDeriveBytes(_preMasterSecret, "master secret", seed).GetBytes(48));
        }
示例#3
0
 public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
 {
     // TODO: Add more PRF IDs and their respective master secrets
     byte[] prfID = prf.CreateDeriveBytes(new byte[0], new byte[0]).GetBytes(48);
     if (CompareArrays(prfID, SSLv3ID))
     {
         return(GetSSLv3MasterSecret(seed));
     }
     else if (CompareArrays(prfID, TLSv1ID))
     {
         return(GetTLSv1MasterSecret(seed));
     }
     else
     {
         throw new Exception("Unidentified PRF while getting ECDHE master secret");
     }
 }
 public override byte[] GetMasterSecret(PseudoRandomFunction prf, byte[] seed)
 {
     return(prf.CreateDeriveBytes(_preMasterSecret, "master secret", seed).GetBytes(48));
 }