]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Fix the NSEC3 hashes cache on older systems 9856/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 14 Dec 2020 10:44:41 +0000 (11:44 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 14 Dec 2020 10:44:41 +0000 (11:44 +0100)
By explicitely constructing the tuple.

pdns/validate.cc

index 9b709522843996f93b240ed01980c824de9b6f08..08e00dd6dfd571b49833c4c3108b25f6ebe25d17 100644 (file)
@@ -90,14 +90,15 @@ static std::string getHashFromNSEC3(const DNSName& qname, const std::shared_ptr<
     return result;
   }
 
-  auto it = cache.find({qname, nsec3->d_salt, nsec3->d_iterations});
+  auto key = std::make_tuple(qname, nsec3->d_salt, nsec3->d_iterations);
+  auto it = cache.find(key);
   if (it != cache.end())
   {
     return it->second;
   }
 
   result = hashQNameWithSalt(nsec3->d_salt, nsec3->d_iterations, qname);
-  cache[{qname, nsec3->d_salt, nsec3->d_iterations}] = result;
+  cache[key] = result;
   return result;
 }