Esempio n. 1
0
 public void ComputeServerMasterSecret(SecurityParameters sparams, byte[] raw, int offset, int length)
 {
     byte[] pubKey = new byte[raw[offset]];
     Buffer.BlockCopy (raw, offset + 1, pubKey, 0, pubKey.Length);
     byte[] premaster = _ecdh.PerformKeyAgreement (pubKey, 48);
     sparams.SetupMasterSecret (premaster);
 }
Esempio n. 2
0
        public void ComputeServerMasterSecret(SecurityParameters sparams, byte[] raw, int offset, int length)
        {
            ushort len = BitConverterBE.ReadUInt16AndMoveOffset(raw, ref offset);

            byte[] premaster = _dh.PerformKeyAgreement(raw, offset, len);
            sparams.SetupMasterSecret(premaster);
        }
Esempio n. 3
0
 public void ComputeServerMasterSecret(SecurityParameters sparams, byte[] raw, int offset, int length)
 {
     byte[] pubKey = new byte[raw[offset]];
     Buffer.BlockCopy(raw, offset + 1, pubKey, 0, pubKey.Length);
     byte[] premaster = _ecdh.PerformKeyAgreement(pubKey, 48);
     sparams.SetupMasterSecret(premaster);
 }
Esempio n. 4
0
 public void ComputeServerMasterSecret(SecurityParameters sparams, byte[] raw, int offset, int length)
 {
     ushort encryptedLength = BitConverterBE.ReadUInt16 (raw, offset);
     if (encryptedLength > length - 2) {
         encryptedLength = (ushort)length;
     } else {
         offset += 2;
     }
     byte[] encrypted = new byte[encryptedLength];
     Buffer.BlockCopy (raw, offset, encrypted, 0, encryptedLength);
     byte[] decrypted = _rsa.Decrypt (encrypted, false);
     sparams.SetupMasterSecret (decrypted);
 }
Esempio n. 5
0
        public void ComputeServerMasterSecret(SecurityParameters sparams, byte[] raw, int offset, int length)
        {
            ushort encryptedLength = BitConverterBE.ReadUInt16(raw, offset);

            if (encryptedLength > length - 2)
            {
                encryptedLength = (ushort)length;
            }
            else
            {
                offset += 2;
            }
            byte[] encrypted = new byte[encryptedLength];
            Buffer.BlockCopy(raw, offset, encrypted, 0, encryptedLength);
            byte[] decrypted = _rsa.Decrypt(encrypted, false);
            sparams.SetupMasterSecret(decrypted);
        }
Esempio n. 6
0
 public void ComputeServerMasterSecret(SecurityParameters sparams, byte[] raw, int offset, int length)
 {
     ushort len = BitConverterBE.ReadUInt16AndMoveOffset (raw, ref offset);
     byte[] premaster = _dh.PerformKeyAgreement (raw, offset, len);
     sparams.SetupMasterSecret (premaster);
 }