From: Otto Moerbeek Date: Thu, 9 Oct 2025 10:23:39 +0000 (+0200) Subject: Explicitly include file for openssl version number X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F16227%2Fhead;p=thirdparty%2Fpdns.git Explicitly include file for openssl version number Co-authored-by: Miod Vallat Signed-off-by: Otto Moerbeek --- diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index be8e8c17db..8e3cd65aff 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -429,17 +429,22 @@ void DNSCryptoKeyEngine::testMakers(unsigned int algo, maker_t* creator, maker_t auto dckeVerify = verifier(algo); cout<<"Testing algorithm "<getName()<<"' ->'"<getName()<<"' -> '"<getName()<<"' "; - unsigned int bits; - if(algo <= 10) - bits=2048; - else if(algo == DNSSEC::ECCGOST || algo == DNSSEC::ECDSA256 || algo == DNSSEC::ED25519) + unsigned int bits{}; + if(algo <= 10) { + bits = 2048; + } + else if(algo == DNSSEC::ECCGOST || algo == DNSSEC::ECDSA256 || algo == DNSSEC::ED25519) { bits = 256; - else if(algo == DNSSEC::ECDSA384) + } + else if(algo == DNSSEC::ECDSA384) { bits = 384; - else if(algo == DNSSEC::ED448) + } + else if(algo == DNSSEC::ED448) { bits = 456; - else - throw runtime_error("Can't guess key size for algorithm "+std::to_string(algo)); + } + else { + throw runtime_error("Can't guess key size for algorithm " + std::to_string(algo)); + } DTime dt; dt.set(); for(unsigned int n = 0; n < 100; ++n) diff --git a/pdns/recursordist/test-syncres_cc4.cc b/pdns/recursordist/test-syncres_cc4.cc index 5fa61d6666..5ab63d1067 100644 --- a/pdns/recursordist/test-syncres_cc4.cc +++ b/pdns/recursordist/test-syncres_cc4.cc @@ -785,14 +785,14 @@ BOOST_AUTO_TEST_CASE(test_dnssec_bogus_dnskey_without_zone_flag) dcke->create(dcke->getBits()); DNSSECPrivateKey csk; csk.setKey(std::move(dcke), 0); - DSRecordContent ds = makeDSFromDNSKey(target, csk.getDNSKEY(), DNSSEC::DIGEST_SHA256); + DSRecordContent dsContent = makeDSFromDNSKey(target, csk.getDNSKEY(), DNSSEC::DIGEST_SHA256); - keys[target] = std::pair(csk, ds); + keys[target] = std::pair(csk, dsContent); /* Set the root DS */ auto luaconfsCopy = g_luaconfs.getCopy(); luaconfsCopy.dsAnchors.clear(); - luaconfsCopy.dsAnchors[g_rootdnsname].insert(ds); + luaconfsCopy.dsAnchors[g_rootdnsname].insert(dsContent); g_luaconfs.setState(luaconfsCopy); size_t queriesCount = 0; @@ -861,14 +861,14 @@ BOOST_AUTO_TEST_CASE(test_dnssec_bogus_dnskey_revoked) dcke->create(dcke->getBits()); DNSSECPrivateKey csk; csk.setKey(std::move(dcke), 257 | 128); - DSRecordContent ds = makeDSFromDNSKey(target, csk.getDNSKEY(), DNSSEC::DIGEST_SHA256); + DSRecordContent dsContent = makeDSFromDNSKey(target, csk.getDNSKEY(), DNSSEC::DIGEST_SHA256); - keys[target] = std::pair(csk, ds); + keys[target] = std::pair(csk, dsContent); /* Set the root DS */ auto luaconfsCopy = g_luaconfs.getCopy(); luaconfsCopy.dsAnchors.clear(); - luaconfsCopy.dsAnchors[g_rootdnsname].insert(ds); + luaconfsCopy.dsAnchors[g_rootdnsname].insert(dsContent); g_luaconfs.setState(luaconfsCopy); size_t queriesCount = 0; diff --git a/pdns/test-signers.cc b/pdns/test-signers.cc index 7fee63402c..392eb3eb9e 100644 --- a/pdns/test-signers.cc +++ b/pdns/test-signers.cc @@ -16,9 +16,7 @@ #include "dnssecinfra.hh" #include "misc.hh" -// Include below is essential, otherwise we get failures I do not understand, maybe some runtime -// value does not get initialized? -#include +#include // OPENSSL_VERSION_MAJOR #include