]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Use arc4random(void *, size) in TSIG generation
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 1 Jul 2025 12:15:28 +0000 (14:15 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 1 Jul 2025 12:15:28 +0000 (14:15 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/tsigutils.cc

index e81386bd8ff119d97c2dc3339cfb16b4d21d1197..08378abac8d45c860fe98805303c906817566915 100644 (file)
@@ -50,10 +50,6 @@ std::string makeTSIGKey(const DNSName& algorithm) {
   tmpkey.resize(klen);
 
   // Fill out the key
-  for (size_t i = 0; i < klen; i += sizeof(uint32_t)) {
-    uint32_t t = dns_random_uint32();
-    memcpy(&tmpkey.at(i), &t, sizeof(uint32_t));
-  }
-
+  dns_random(tmpkey.data(), klen);
   return Base64Encode(tmpkey);
 }