mbedtls: Avoid memory leak when handling ECDSA keys

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2024-07-01 19:57:53 +02:00
parent 2d3b7e07af
commit ec6363d6b5
5 changed files with 128 additions and 105 deletions

View File

@@ -60,7 +60,7 @@ struct ssh_key_struct {
gcry_sexp_t rsa;
gcry_sexp_t ecdsa;
#elif defined(HAVE_LIBMBEDCRYPTO)
mbedtls_pk_context *rsa;
mbedtls_pk_context *pk;
mbedtls_ecdsa_context *ecdsa;
#elif defined(HAVE_LIBCRYPTO)
/* This holds either ENGINE key for PKCS#11 support or just key in