free old peer RSA key in secure renegotiation when getting new one

This commit is contained in:
Jacob Barthelmeh 2019-07-10 17:07:16 -06:00
parent 6c9fac2a71
commit a6cc9af1fc

View File

@ -10102,6 +10102,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);