From fa7924008e838cded7e8a561356ffe5e06e0ed64 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 6 Dec 2019 14:17:26 +1100 Subject: [PATCH] Wrap ECC specific bits in ifdef. Fixes tests when built against an OpenSSL configured with no-ec. --- regress/misc/sk-dummy/sk-dummy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/regress/misc/sk-dummy/sk-dummy.c b/regress/misc/sk-dummy/sk-dummy.c index f63dc4d18..40a4ed2cc 100644 --- a/regress/misc/sk-dummy/sk-dummy.c +++ b/regress/misc/sk-dummy/sk-dummy.c @@ -115,6 +115,7 @@ sk_api_version(void) static int pack_key_ecdsa(struct sk_enroll_response *response) { +#ifdef OPENSSL_HAS_ECC EC_KEY *key = NULL; const EC_GROUP *g; const EC_POINT *q; @@ -194,6 +195,9 @@ pack_key_ecdsa(struct sk_enroll_response *response) BIO_free(bio); EC_KEY_free(key); return ret; +#else + return -1; +#endif } static int @@ -310,6 +314,7 @@ sig_ecdsa(const uint8_t *message, size_t message_len, const uint8_t *key_handle, size_t key_handle_len, struct sk_sign_response *response) { +#ifdef OPENSSL_HAS_ECC ECDSA_SIG *sig = NULL; const BIGNUM *sig_r, *sig_s; int ret = -1; @@ -394,6 +399,9 @@ sig_ecdsa(const uint8_t *message, size_t message_len, EC_KEY_free(ec); EVP_PKEY_free(pk); return ret; +#else + return -1; +#endif } static int