diff options
author | Richard Levitte <levitte@openssl.org> | 2020-12-02 18:30:55 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-12-16 11:56:38 +0100 |
commit | a2e145f8dbf064b56f793fc77b3ccd79f7c67689 (patch) | |
tree | ffa00af5cda2df173609fe362f9119092f9842cf /providers/implementations/encode_decode/encode_key2any.c | |
parent | c2403f362efc519e473269d183adc7cceddb8c54 (diff) |
Add necessary checks of OPENSSL_NO_DH, OPENSSL_NO_DSA and OPENSSL_NO_EC
When OpenSSL is configured with 'no-dh', 'no-dsa' and 'no-ec'
combined, some static functions have no use, which the compiler may
complain about. We therefore add extra guards to silence it.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13589)
Diffstat (limited to 'providers/implementations/encode_decode/encode_key2any.c')
-rw-r--r-- | providers/implementations/encode_decode/encode_key2any.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/providers/implementations/encode_decode/encode_key2any.c b/providers/implementations/encode_decode/encode_key2any.c index 30837612cc..ee2930852e 100644 --- a/providers/implementations/encode_decode/encode_key2any.c +++ b/providers/implementations/encode_decode/encode_key2any.c @@ -36,6 +36,10 @@ #include "prov/der_rsa.h" #include "endecoder_local.h" +#if defined(OPENSSL_NO_DH) && defined(OPENSSL_NO_DSA) && defined(OPENSSL_NO_EC) +# define OPENSSL_NO_KEYPARAMS +#endif + struct key2any_ctx_st { PROV_CTX *provctx; @@ -330,8 +334,7 @@ static int key_to_type_specific_pem_pub_bio(BIO *out, const void *key, p2s, k2d, ctx, NULL, NULL); } -#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_DSA) \ - || !defined(OPENSSL_NO_EC) +#ifndef OPENSSL_NO_KEYPARAMS static int key_to_type_specific_pem_param_bio(BIO *out, const void *key, int key_nid, const char *pemname, key_to_paramstring_fn *p2s, |