DTLS Multicast

wolfSSL_set_secret() was checking the preMasterSz against the sizeof
the preMasterSecret member of the Arrays structure. That member
was changed to a pointer and allocated dynamically for the session
write-duping. The comparison between the passed in size and the size
of the parameter started failing. The check now uses the constant
that is used for allocating the preMasterSecret member.
This commit is contained in:
John Safranek
2017-04-21 16:00:41 -07:00
parent 4c5ddc8482
commit 3b5e537f08

View File

@ -902,8 +902,8 @@ int wolfSSL_set_secret(WOLFSSL* ssl, word16 epoch,
WOLFSSL_ENTER("wolfSSL_set_secret()");
if (ssl == NULL || preMasterSecret == NULL || preMasterSz == 0 ||
preMasterSz > sizeof(ssl->arrays->preMasterSecret) ||
if (ssl == NULL || preMasterSecret == NULL ||
preMasterSz == 0 || preMasterSz > ENCRYPT_LEN ||
clientRandom == NULL || serverRandom == NULL || suite == NULL) {
ret = BAD_FUNC_ARG;