]> 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)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 6 Jun 2024 02:13:33 +0000 (02:13 +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>
python/samba/tests/dns_base.py
selftest/knownfail.d/dns_tkey

index f1c2d3da92647f9502e17a6a2ab5745e6aa19e15..7d533f8e3c780f96db0fba413c3a30c235c8b236 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