Merge pull request #2340 from JacobBarthelmeh/Testing

fsanitize report fixes
This commit is contained in:
toddouska 2019-07-11 11:18:09 -07:00 committed by GitHub
commit b4765a5c9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -5659,6 +5659,10 @@ void FreeHandshakeResources(WOLFSSL* ssl)
#ifdef HAVE_SECURE_RENEGOTIATION
if (ssl->secure_renegotiation && ssl->secure_renegotiation->enabled) {
WOLFSSL_MSG("Secure Renegotiation needs to retain handshake resources");
#ifdef KEEP_PEER_CERT
/* free peer cert in preparation for new handshake */
FreeX509(&ssl->peerCert);
#endif
return;
}
#endif
@ -10106,6 +10110,15 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
ssl->peerRsaKeyPresent = 1;
#ifdef HAVE_PK_CALLBACKS
#ifndef NO_RSA
#ifdef HAVE_SECURE_RENEGOTIATION
if (ssl->buffers.peerRsaKey.buffer) {
XFREE(ssl->buffers.peerRsaKey.buffer,
ssl->heap, DYNAMIC_TYPE_RSA);
ssl->buffers.peerRsaKey.buffer = NULL;
}
#endif
ssl->buffers.peerRsaKey.buffer =
(byte*)XMALLOC(args->dCert->pubKeySize,
ssl->heap, DYNAMIC_TYPE_RSA);

View File

@ -9922,6 +9922,10 @@ int wolfSSL_Cleanup(void)
if (wc_FreeMutex(&count_mutex) != 0)
ret = BAD_MUTEX_E;
#ifdef OPENSSL_EXTRA
wolfSSL_RAND_Cleanup();
#endif
if (wolfCrypt_Cleanup() != 0) {
WOLFSSL_MSG("Error with wolfCrypt_Cleanup call");
ret = WC_CLEANUP_E;

View File

@ -13061,6 +13061,7 @@ int dh_test(void)
/* Test Check Key */
ret = wc_DhSetCheckKey(&key, dh_p, sizeof(dh_p), dh_g, sizeof(dh_g),
NULL, 0, 0, &rng);
keyInit = 1; /* DhSetCheckKey also initializes the key, free it */
}
#endif