From: Remi Gacogne Date: Fri, 16 Jan 2026 14:27:33 +0000 (+0100) Subject: EDNS cookies: Test the timestamp handling in our unit tests X-Git-Tag: rec-5.4.0-beta1~39^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16733%2Fhead;p=thirdparty%2Fpdns.git EDNS cookies: Test the timestamp handling in our unit tests Signed-off-by: Remi Gacogne --- diff --git a/pdns/test-ednscookie_cc.cc b/pdns/test-ednscookie_cc.cc index e397e67ef6..7d399ebd43 100644 --- a/pdns/test-ednscookie_cc.cc +++ b/pdns/test-ednscookie_cc.cc @@ -106,6 +106,10 @@ BOOST_AUTO_TEST_CASE(test_createEDNSServerCookie) BOOST_CHECK(!eco2.isValid(secret, ComboAddress("192.0.2.1"))); BOOST_CHECK(!eco2.isValid("blablablablabla1", remote)); BOOST_CHECK(eco2.isValid(secret, remote)); + + /* very old cookie (epoch) */ + const auto veryOldCookie = EDNSCookiesOpt(std::string("\x12\x34\x56\x78\x90\xab\xcd\xef\x01\x00\x00\x00\x00\x00\x00\x00\xcb\xc9\x38\x5f\xb5\x75\x75\x2a", (8U + 16U))); + BOOST_CHECK(!veryOldCookie.isValid(secret, remote)); } #endif