]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that 'e' and 'n' are non-NULL in opensslrsa_todns
authorMark Andrews <marka@isc.org>
Mon, 26 Sep 2022 01:52:55 +0000 (11:52 +1000)
committerMark Andrews <marka@isc.org>
Tue, 27 Sep 2022 23:24:34 +0000 (09:24 +1000)
lib/dns/opensslrsa_link.c

index 3c72441727ed23a00bec8f45789838ff0c492f7a..64287854cc656d3b357220c3f00b8d988675e06f 100644 (file)
@@ -591,10 +591,10 @@ opensslrsa_todns(const dst_key_t *key, isc_buffer_t *data) {
 #else
        EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_E, &e);
        EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_N, &n);
+#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L || OPENSSL_API_LEVEL < 30000 */
        if (e == NULL || n == NULL) {
                DST_RET(dst__openssl_toresult(DST_R_OPENSSLFAILURE));
        }
-#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L || OPENSSL_API_LEVEL < 30000 */
 
        mod_bytes = BN_num_bytes(n);
        e_bytes = BN_num_bytes(e);