Generate larger block of key material correctly for SSL3 as well as TLS.

Add assert to detect if key material is ever too small again.
This commit is contained in:
nelsonb%netscape.com 2001-09-20 04:36:14 +00:00
Родитель 99a4abe7dd
Коммит 3870ce15b8
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -4432,8 +4432,17 @@ loser:
/*
* SSL Key generation given pre master secret
*/
static char *mixers[] = { "A", "BB", "CCC", "DDDD", "EEEEE", "FFFFFF", "GGGGGGG"};
#define NUM_MIXERS 9
static const char * const mixers[NUM_MIXERS] = {
"A",
"BB",
"CCC",
"DDDD",
"EEEEE",
"FFFFFF",
"GGGGGGG",
"HHHHHHHH",
"IIIIIIIII" };
#define SSL3_PMS_LENGTH 48
#define SSL3_MASTER_SECRET_LENGTH 48
@ -4853,6 +4862,7 @@ CK_RV NSC_DeriveKey( CK_SESSION_HANDLE hSession,
*/
PORT_Memcpy(ssl3_keys_out->pIVServer, &key_block[i], IVSize);
i += IVSize;
PORT_Assert(i <= sizeof key_block);
} else if (!isTLS) {