]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Only declare 'engine' if it is used
authorMark Andrews <marka@isc.org>
Thu, 26 Oct 2023 23:49:38 +0000 (10:49 +1100)
committerMark Andrews <marka@isc.org>
Fri, 27 Oct 2023 22:01:51 +0000 (09:01 +1100)
Move the declaration of 'engine' within the appropriate #if/#endif
block.  Remove the UNUSED(engine) from the #else block.

(cherry picked from commit 8b11061b91f01b2e6c993faed18efb976a5af842)

lib/dns/opensslrsa_link.c

index 1f2a2e0b760626b5a9b4c648c141c0f36439a623..09412c58b56b60b8493a2e40950400351d3ca13d 100644 (file)
@@ -895,9 +895,10 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
 #if !defined(OPENSSL_NO_ENGINE)
        ENGINE *ep = NULL;
        const BIGNUM *ex = NULL;
+       const char *engine = NULL;
 #endif /* if !defined(OPENSSL_NO_ENGINE) */
        isc_mem_t *mctx = key->mctx;
-       const char *engine = NULL, *label = NULL;
+       const char *label = NULL;
        EVP_PKEY *pkey = NULL;
        BIGNUM *n = NULL, *e = NULL, *d = NULL;
        BIGNUM *p = NULL, *q = NULL;
@@ -930,9 +931,11 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
 
        for (i = 0; i < priv.nelements; i++) {
                switch (priv.elements[i].tag) {
+#if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000
                case TAG_RSA_ENGINE:
                        engine = (char *)priv.elements[i].data;
                        break;
+#endif
                case TAG_RSA_LABEL:
                        label = (char *)priv.elements[i].data;
                        break;