From: Bob Halley Date: Sat, 13 Apr 2024 17:33:03 +0000 (-0700) Subject: do not use : in cookie EDNS text output X-Git-Tag: v2.7.0rc1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfd0919c83188c41fb9be6f857ff68fe179150c5;p=thirdparty%2Fdnspython.git do not use : in cookie EDNS text output --- diff --git a/dns/edns.py b/dns/edns.py index ef79b5f0..af90827a 100644 --- a/dns/edns.py +++ b/dns/edns.py @@ -455,7 +455,7 @@ class CookieOption(Option): server = binascii.hexlify(self.server).decode() else: server = "" - return f"COOKIE {client}:{server}" + return f"COOKIE {client}{server}" @classmethod def from_wire_parser( diff --git a/tests/test_edns.py b/tests/test_edns.py index 8e63b21d..74b16c5c 100644 --- a/tests/test_edns.py +++ b/tests/test_edns.py @@ -222,11 +222,11 @@ class OptionTestCase(unittest.TestCase): opt.to_wire(io) data = io.getvalue() self.assertEqual(data, b"12345678") - self.assertEqual(str(opt), "COOKIE 3132333435363738:") + self.assertEqual(str(opt), "COOKIE 3132333435363738") opt = dns.edns.CookieOption(b"12345678", b"abcdefgh") data = opt.to_wire() self.assertEqual(data, b"12345678abcdefgh") - self.assertEqual(str(opt), "COOKIE 3132333435363738:6162636465666768") + self.assertEqual(str(opt), "COOKIE 31323334353637386162636465666768") # maximal server opt = dns.edns.CookieOption(b"12345678", b"abcdefghabcdefghabcdefghabcdefgh") io = BytesIO()