Fix Checks

1. In the client, check the return code on wolfSSL_CTX_SetMinDhKey_Sz() as it is checked in the server. (Resolves issue #2037.)
2. In HashOutput(), check that the hsHashes exists for the session before hashing. (Resolves issue #2038.)
This commit is contained in:
John Safranek
2019-01-17 09:52:00 -08:00
parent c26cb53c05
commit f6240e5558
2 changed files with 7 additions and 1 deletions

View File

@ -2122,7 +2122,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
wolfSSL_CTX_set_group_messages(ctx);
#ifndef NO_DH
wolfSSL_CTX_SetMinDhKey_Sz(ctx, (word16)minDhKeyBits);
if (wolfSSL_CTX_SetMinDhKey_Sz(ctx, (word16)minDhKeyBits)
!= WOLFSSL_SUCCESS) {
err_sys("Error setting minimum DH key size");
}
#endif
if (usePsk) {

View File

@ -6479,6 +6479,9 @@ int HashOutput(WOLFSSL* ssl, const byte* output, int sz, int ivSz)
int ret = 0;
const byte* adj;
if (ssl->hsHashes == NULL)
return BAD_FUNC_ARG;
adj = output + RECORD_HEADER_SZ + ivSz;
sz -= RECORD_HEADER_SZ;