]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Add method to get the PAC from a ticket
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 15 Oct 2021 01:27:25 +0000 (14:27 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 17 Oct 2021 22:53:37 +0000 (22:53 +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 29dc5f397b6889bde5be3c1aaeacbafbdc7a605d..0790ac13f99a42d2c230aeb95df0e19b35b89d30 100644 (file)
@@ -3447,6 +3447,15 @@ class RawKerberosTest(TestCaseInTempDir):
         _, pac = self.replace_pac(auth_data, None, expect_pac)
         return pac
 
+    def get_ticket_pac(self, ticket, expect_pac=True):
+        auth_data = ticket.ticket_private.get('authorization-data')
+        if expect_pac:
+            self.assertIsNotNone(auth_data)
+        elif auth_data is None:
+            return None
+
+        return self.get_pac(auth_data, expect_pac=expect_pac)
+
     def get_krbtgt_checksum_key(self):
         krbtgt_creds = self.get_krbtgt_creds()
         krbtgt_key = self.TicketDecryptionKey_from_creds(krbtgt_creds)