]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2020-25719 tests/krb5: Add is_tgt() helper method
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 30 Sep 2021 03:53:22 +0000 (16:53 +1300)
committerJule Anger <janger@samba.org>
Mon, 8 Nov 2021 09:52:10 +0000 (10:52 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14686

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

index fdf078ea788ead5d120d1d4e8e243196f7759f5e..055209fd09df8c47f2c2905e3d84a8c679543a01 100644 (file)
@@ -3086,8 +3086,7 @@ class RawKerberosTest(TestCaseInTempDir):
     def verify_ticket(self, ticket, krbtgt_key, expect_pac=True,
                       expect_ticket_checksum=True):
         # Check if the ticket is a TGT.
-        sname = ticket.ticket['sname']
-        is_tgt = self.is_tgs(sname)
+        is_tgt = self.is_tgt(ticket)
 
         # Decrypt the ticket.
 
@@ -3506,6 +3505,10 @@ class RawKerberosTest(TestCaseInTempDir):
         name = principal['name-string'][0]
         return name in ('krbtgt', b'krbtgt')
 
+    def is_tgt(self, ticket):
+        sname = ticket.ticket['sname']
+        return self.is_tgs(sname)
+
     def get_empty_pac(self):
         return self.AuthorizationData_create(AD_WIN2K_PAC, bytes(1))