CVE-2025-8277: wrapper: Free cv25519 private key on cleanup

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-08-06 14:22:25 +02:00
parent d357a9f3e2
commit 9ada7aa0e4

View File

@@ -188,6 +188,8 @@ void crypto_free(struct ssh_crypto_struct *crypto)
#endif
#ifdef HAVE_LIBCRYPTO
EVP_PKEY_free(crypto->curve25519_privkey);
#elif defined(HAVE_GCRYPT_CURVE25519)
gcry_sexp_release(crypto->curve25519_privkey);
#endif
SAFE_FREE(crypto->dh_server_signature);
if (crypto->session_id != NULL) {