use 256 bytes block for keys expansion

This commit is contained in:
orignal 2015-02-19 13:50:04 -05:00
parent 5deccd7833
commit e5d9c26868

View File

@ -633,10 +633,10 @@ namespace data
// calculate master secret
PRF (secret, "master secret", random, 64, 48, masterSecret);
// expand master secret
uint8_t keys[128]; // clientMACKey, serverMACKey, clientKey, serverKey
uint8_t keys[256]; // clientMACKey, serverMACKey, clientKey, serverKey
memcpy (random, serverRandom, 32);
memcpy (random + 32, clientHello + 11, 32);
PRF (masterSecret, "key expansion", random, 64, sizeof (keys), keys);
PRF (masterSecret, "key expansion", random, 64, 256, keys);
memcpy (m_MacKey, keys, 32);
m_Encryption.SetKey (keys + 64);
m_Decryption.SetKey (keys + 96);