From 3642224ee516ab83d6bd2acae1b192ebcc3d35dd Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 16 Dec 2019 16:54:56 +0100 Subject: [PATCH] legacy,keys: Fix the macro conditions Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- include/libssh/keys.h | 12 ++++++------ src/legacy.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/libssh/keys.h b/include/libssh/keys.h index f25283ae..7b138612 100644 --- a/include/libssh/keys.h +++ b/include/libssh/keys.h @@ -28,13 +28,13 @@ struct ssh_public_key_struct { int type; const char *type_c; /* Don't free it ! it is static */ -#ifdef HAVE_LIBGCRYPT +#if defined(HAVE_LIBGCRYPT) gcry_sexp_t dsa_pub; gcry_sexp_t rsa_pub; -#elif HAVE_LIBCRYPTO +#elif defined(HAVE_LIBCRYPTO) DSA *dsa_pub; RSA *rsa_pub; -#elif HAVE_LIBMBEDCRYPTO +#elif defined(HAVE_LIBMBEDCRYPTO) mbedtls_pk_context *rsa_pub; void *dsa_pub; #endif @@ -42,13 +42,13 @@ struct ssh_public_key_struct { struct ssh_private_key_struct { int type; -#ifdef HAVE_LIBGCRYPT +#if defined(HAVE_LIBGCRYPT) gcry_sexp_t dsa_priv; gcry_sexp_t rsa_priv; -#elif defined HAVE_LIBCRYPTO +#elif defined(HAVE_LIBCRYPTO) DSA *dsa_priv; RSA *rsa_priv; -#elif HAVE_LIBMBEDCRYPTO +#elif defined(HAVE_LIBMBEDCRYPTO) mbedtls_pk_context *rsa_priv; void *dsa_priv; #endif diff --git a/src/legacy.c b/src/legacy.c index b92ee662..8ae3d920 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -353,7 +353,7 @@ void publickey_free(ssh_public_key key) { case SSH_KEYTYPE_DSS: #ifdef HAVE_LIBGCRYPT gcry_sexp_release(key->dsa_pub); -#elif HAVE_LIBCRYPTO +#elif defined HAVE_LIBCRYPTO DSA_free(key->dsa_pub); #endif break;