1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-21 20:23:50 +03:00

tests/krb5: Add method to determine if principal is krbtgt

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>
This commit is contained in:
Joseph Sutton
2021-09-20 15:06:18 +12:00
committed by Andrew Bartlett
parent ea7b550a50
commit c0b81f0dd5

View File

@@ -2977,7 +2977,7 @@ class RawKerberosTest(TestCaseInTempDir):
def verify_ticket(self, ticket, krbtgt_key, expect_pac=True):
# Check if the ticket is a TGT.
sname = ticket.ticket['sname']
is_tgt = sname['name-string'][0] == b'krbtgt'
is_tgt = self.is_tgs(sname)
# Decrypt the ticket.
@@ -3371,6 +3371,10 @@ class RawKerberosTest(TestCaseInTempDir):
krb5pac.PAC_TYPE_KDC_CHECKSUM: krbtgt_key
}
def is_tgs(self, principal):
name = principal['name-string'][0]
return name in ('krbtgt', b'krbtgt')
def get_empty_pac(self):
return self.AuthorizationData_create(AD_WIN2K_PAC, bytes(1))