]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Fix handling authdata with missing PAC
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 28 Sep 2021 23:06:03 +0000 (12:06 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Oct 2021 18:59:31 +0000 (18:59 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14642

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/krb5/raw_testcase.py

index 4c1aedbca0f186b663bc010553515f29a663c1f7..b9895e547c4a7080baab6e9cbdf4ec8117237acb 100644 (file)
@@ -3200,11 +3200,11 @@ class RawKerberosTest(TestCaseInTempDir):
                 # Get a copy of the authdata with an empty PAC, and the
                 # existing PAC (if present).
                 empty_pac = self.get_empty_pac()
-                empty_pac_auth_data, pac_data = self.replace_pac(auth_data,
-                                                                 empty_pac)
+                empty_pac_auth_data, pac_data = self.replace_pac(
+                    auth_data,
+                    empty_pac,
+                    expect_pac=expect_pac)
 
-                if expect_pac:
-                    self.assertIsNotNone(pac_data)
                 if pac_data is not None:
                     pac = ndr_unpack(krb5pac.PAC_DATA, pac_data)
 
@@ -3234,7 +3234,8 @@ class RawKerberosTest(TestCaseInTempDir):
 
             # Replace the PAC in the authorization data and re-add it to the
             # ticket enc-part.
-            auth_data, _ = self.replace_pac(auth_data, new_pac)
+            auth_data, _ = self.replace_pac(auth_data, new_pac,
+                                            expect_pac=expect_pac)
             enc_part['authorization-data'] = auth_data
 
         # Re-encrypt the ticket enc-part with the new key.