]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Explicitly include file for openssl version number 16227/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 9 Oct 2025 10:23:39 +0000 (12:23 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 9 Oct 2025 12:25:07 +0000 (14:25 +0200)
Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/dnssecinfra.cc
pdns/recursordist/test-syncres_cc4.cc
pdns/test-signers.cc

index be8e8c17db03d6da8c144f41ae4df03fca9cc2cc..8e3cd65aff300830c6fd11e20aa1d65c3e814694 100644 (file)
@@ -429,17 +429,22 @@ void DNSCryptoKeyEngine::testMakers(unsigned int algo, maker_t* creator, maker_t
   auto dckeVerify = verifier(algo);
 
   cout<<"Testing algorithm "<<algo<<"("<<DNSSEC::algorithm2name(algo)<<"): '"<<dckeCreate->getName()<<"' ->'"<<dckeSign->getName()<<"' -> '"<<dckeVerify->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)
index 5fa61d66660fe8afad4c3dcea10869e1c890af5b..5ab63d1067219c4eafa36d07d257b5064fe2baa3 100644 (file)
@@ -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<DNSSECPrivateKey, DSRecordContent>(csk, ds);
+  keys[target] = std::pair<DNSSECPrivateKey, DSRecordContent>(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<DNSSECPrivateKey, DSRecordContent>(csk, ds);
+  keys[target] = std::pair<DNSSECPrivateKey, DSRecordContent>(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;
index 7fee63402c30d8adb2267fc5b5801e4d63f7a21e..392eb3eb9ee3cd72052d5bd783e36eca6790a042 100644 (file)
@@ -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 <openssl/sha.h>
+#include <openssl/opensslv.h> // OPENSSL_VERSION_MAJOR
 
 #include <unordered_map>