- Default: (empty)
When set, PowerDNS will respond with :rfc:`9018` EDNS Cookies to queries that have the EDNS0 Cookie option.
-PowerDNS will also respond with BADCOOKIE to clients that have no or a bad server cookie (section 5.2.3 and 5.2.4 of :rfc:`7873`).
+PowerDNS will also respond with BADCOOKIE to clients that have sent only a client cookie, or a bad server cookie (section 5.2.3 and 5.2.4 of :rfc:`7873`).
This setting MUST be 32 hexadecimal characters, as the siphash algorithm's key used to create the cookie requires a 128-bit key.
dnssecsigner.cc \
dnswriter.cc dnswriter.hh \
dynlistener.cc \
- ednscookies.cc \
+ ednscookies.cc ednscookies.hh \
ednsoptions.cc ednsoptions.hh \
ednssubnet.cc \
ipcipher.cc ipcipher.hh \
::arg().setSwitch("any-to-tcp","Answer ANY queries with tc=1, shunting to TCP")="yes";
::arg().setSwitch("edns-subnet-processing","If we should act on EDNS Subnet options")="no";
- ::arg().set("edns-cookie-secret", "When set, set a server cookie in a response to a query with a Client cookie (in hex)")="";
+ ::arg().set("edns-cookie-secret", "When set, set a server cookie when responding to a query with a Client cookie (in hex)")="";
::arg().setSwitch("webserver","Start a webserver for monitoring (api=yes also enables the HTTP listener)")="no";
::arg().setSwitch("webserver-print-arguments","If the webserver should print arguments")="no";
exit(1);
}
#else
- g_log<<Logger::Error<<"Support for EDNS Cookies is not available because of missing cryptographic functions"<<endl;
+ g_log<<Logger::Error<<"Support for EDNS Cookies is not available because of missing cryptographic functions (libsodium support should be enabled, with the crypto_shorthash() function available)"<<endl;
exit(1);
#endif
}
}
server.clear();
+ server.reserve(16);
server = "\x01"; // Version
server.resize(4, '\0'); // 3 reserved bytes
uint32_t now = htonl(static_cast<uint32_t>(time(nullptr)));
- server += string(reinterpret_cast<const char*>(&now), 4);
+ server += string(reinterpret_cast<const char*>(&now), sizeof(now));
server.resize(8);
string toHash = client;