summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-10-15 14:27:25 +1300
committerStefan Metzmacher <metze@samba.org>2021-10-26 12:00:27 +0000
commitbb3fbf53ad1bd665d0a02e5459a9eef631802f4c (patch)
treecef1d9c3bd081b6fd29788a02b0cbf15fec8f434
parentd09fa6b47b30165769041143f210816a447f5c9f (diff)
downloadsamba-bb3fbf53ad1bd665d0a02e5459a9eef631802f4c.tar.gz
tests/krb5: Add method to get the PAC from a ticket
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14642 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14881 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 288355896a2b6f460c42559ec46ff980ab57782e)
-rw-r--r--python/samba/tests/krb5/raw_testcase.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py
index 29dc5f397b6..0790ac13f99 100644
--- a/python/samba/tests/krb5/raw_testcase.py
+++ b/python/samba/tests/krb5/raw_testcase.py
@@ -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)