]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:tests/dns_base: let verify_packet() work against Windows
authorStefan Metzmacher <metze@samba.org>
Wed, 29 May 2024 11:17:54 +0000 (13:17 +0200)
committerJule Anger <janger@samba.org>
Wed, 3 Jul 2024 08:48:11 +0000 (08:48 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 8324d0739dfdd0a081c403e298a9038ee7df681f)

python/samba/tests/dns_base.py
selftest/knownfail.d/dns_tkey

index b8afc1f22a2f558cac3c833379ddc0ea7d3b5b38..3d751faee5cf75afd5f93216f7653d8543d221ae 100644 (file)
@@ -353,6 +353,15 @@ class DNSTKeyTest(DNSTest):
         self.assertEqual(response.arcount, 1)
         self.assertEqual(response.additional[0].rr_type, dns.DNS_QTYPE_TSIG)
 
+        if self.tkey['algorithm'] == "gss-tsig":
+            gss_tsig = True
+        else:
+            gss_tsig = False
+
+        request_mac_len = b""
+        if len(request_mac) > 0 and gss_tsig:
+            request_mac_len = struct.pack('!H', len(request_mac))
+
         tsig_record = response.additional[0].rdata
         mac = bytes(tsig_record.mac)
 
@@ -378,7 +387,7 @@ class DNSTKeyTest(DNSTest):
         fake_tsig.other_data = tsig_record.other_data
         fake_tsig_packet = ndr.ndr_pack(fake_tsig)
 
-        data = request_mac + response_packet_wo_tsig + fake_tsig_packet
+        data = request_mac_len + request_mac + response_packet_wo_tsig + fake_tsig_packet
         try:
             self.tkey['gensec'].check_packet(data, data, mac)
         except NTSTATUSError as nt:
index f1889609e6d3d81b1e3a9156453acbab88bbd587..19fe5c8bde3a16b4ac1240187c46e70e6c998c2d 100644 (file)
@@ -9,3 +9,5 @@
 ^samba.tests.dns_tkey.__main__.TestDNSUpdates.test_update_tsig_bad_algorithm.fl2008r2dc
 ^samba.tests.dns_tkey.__main__.TestDNSUpdates.test_update_tsig_changed_algorithm1.fl2008r2dc
 ^samba.tests.dns_tkey.__main__.TestDNSUpdates.test_update_tsig_changed_algorithm2.fl2008r2dc
+^samba.tests.dns_tkey.__main__.TestDNSUpdates.test_update_gss_tsig_tkey_req_additional.fl2008r2dc
+^samba.tests.dns_tkey.__main__.TestDNSUpdates.test_update_tsig_windows.fl2008r2dc