mirror of
https://github.com/samba-team/samba.git
synced 2025-12-23 00:23:53 +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:
committed by
Andrew Bartlett
parent
ea7b550a50
commit
c0b81f0dd5
@@ -2977,7 +2977,7 @@ class RawKerberosTest(TestCaseInTempDir):
|
|||||||
def verify_ticket(self, ticket, krbtgt_key, expect_pac=True):
|
def verify_ticket(self, ticket, krbtgt_key, expect_pac=True):
|
||||||
# Check if the ticket is a TGT.
|
# Check if the ticket is a TGT.
|
||||||
sname = ticket.ticket['sname']
|
sname = ticket.ticket['sname']
|
||||||
is_tgt = sname['name-string'][0] == b'krbtgt'
|
is_tgt = self.is_tgs(sname)
|
||||||
|
|
||||||
# Decrypt the ticket.
|
# Decrypt the ticket.
|
||||||
|
|
||||||
@@ -3371,6 +3371,10 @@ class RawKerberosTest(TestCaseInTempDir):
|
|||||||
krb5pac.PAC_TYPE_KDC_CHECKSUM: krbtgt_key
|
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):
|
def get_empty_pac(self):
|
||||||
return self.AuthorizationData_create(AD_WIN2K_PAC, bytes(1))
|
return self.AuthorizationData_create(AD_WIN2K_PAC, bytes(1))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user