(EC)DH memory handling fixes.

Submitted by: Adam Langley
This commit is contained in:
Bodo Möller
2011-09-05 10:25:21 +00:00
parent 8eaf563c41
commit e935440ad7
4 changed files with 30 additions and 9 deletions

View File

@@ -1030,12 +1030,11 @@ int dtls1_send_server_key_exchange(SSL *s)
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
if (!EC_KEY_up_ref(ecdhp))
if ((ecdh = EC_KEY_dup(ecdhp)) == NULL)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
ecdh = ecdhp;
s->s3->tmp.ecdh=ecdh;
if ((EC_KEY_get0_public_key(ecdh) == NULL) ||