]> 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>
Thu, 26 Oct 2023 23:49:38 +0000 (10:49 +1100)
Move the declaration of 'engine' within the appropriate #if/#endif
block.  Remove the UNUSED(engine) from the #else block.

lib/dns/opensslrsa_link.c

index dc7382c4c1711a9f22baca03d820fac1d3619461..1a0bb0fdc6521902d466bc2702c44a3f08989ab6 100644 (file)
@@ -1135,9 +1135,10 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
 #if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000
        const BIGNUM *ex = NULL;
        ENGINE *ep = NULL;
+       const char *engine = NULL;
 #endif /* if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000 */
        isc_mem_t *mctx = NULL;
-       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;
@@ -1175,9 +1176,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;
@@ -1229,7 +1232,6 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
                pkey = NULL;
                DST_RET(ISC_R_SUCCESS);
 #else  /* if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000 */
-               UNUSED(engine);
                DST_RET(DST_R_NOENGINE);
 #endif /* if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000 */
        }