Skip to content

Commit

Permalink
temporary valgrind fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sumit-bose committed Sep 9, 2024
1 parent 4ec190c commit 9a0ce79
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/util/cert/libcrypto/cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static errno_t ec_pub_key_to_ssh(TALLOC_CTX *mem_ctx, EVP_PKEY *cert_pub_key,
#define SSH_RSA_HEADER_LEN (sizeof(SSH_RSA_HEADER) - 1)

static int sss_rsa_get_key(EVP_PKEY *cert_pub_key,
const BIGNUM **n, const BIGNUM **e)
BIGNUM **n, BIGNUM **e)
{
int ret;
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
Expand Down Expand Up @@ -420,8 +420,8 @@ static errno_t rsa_pub_key_to_ssh(TALLOC_CTX *mem_ctx, EVP_PKEY *cert_pub_key,
size_t c;
size_t size;
uint8_t *buf = NULL;
const BIGNUM *n = NULL;
const BIGNUM *e = NULL;
BIGNUM *n = NULL;
BIGNUM *e = NULL;
int modulus_len;
unsigned char modulus[OPENSSL_RSA_MAX_MODULUS_BITS/8];
int exponent_len;
Expand Down Expand Up @@ -475,6 +475,10 @@ static errno_t rsa_pub_key_to_ssh(TALLOC_CTX *mem_ctx, EVP_PKEY *cert_pub_key,
ret = EOK;

done:
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
BN_clear_free(n);
BN_clear_free(e);
#endif
if (ret != EOK) {
talloc_free(buf);
}
Expand Down

0 comments on commit 9a0ce79

Please sign in to comment.