openssl: Fix potential crash with ECDH on Windows

Apparently, we should use OPENSSL_free() to release memory allocated by
OpenSSL.  While it generally maps to free() that's apparently not the
case on Windows, where the ECP test vectors caused `ACCESS_VIOLATION
exception` crashes (not always the same vector).

Fixes: 74e02ff5e624 ("openssl: Mainly use EVP interface for ECDH")
This commit is contained in:
Tobias Brunner 2021-01-26 19:33:24 +01:00
parent 55df5e9797
commit 6c26267b07

View File

@ -246,7 +246,7 @@ METHOD(diffie_hellman_t, get_my_public_value, bool,
if (pub.len != 0)
{
*value = chunk_clone(chunk_skip(pub, 1));
chunk_free(&pub);
OPENSSL_free(pub.ptr);
return value->len != 0;
}
return FALSE;