From: Joseph Sutton Date: Mon, 25 Sep 2023 00:21:08 +0000 (+1300) Subject: tests/krb5: Also consider single‐component krbtgt principals to be TGS principals X-Git-Tag: talloc-2.4.2~1013 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f266f5c670b4338e38ed42adc8aa81e5fa580ec1;p=thirdparty%2Fsamba.git tests/krb5: Also consider single‐component krbtgt principals to be TGS principals BUG: https://bugzilla.samba.org/show_bug.cgi?id=15482 Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py index f433fa4bd4e..347874fc99a 100644 --- a/python/samba/tests/krb5/raw_testcase.py +++ b/python/samba/tests/krb5/raw_testcase.py @@ -5902,8 +5902,11 @@ class RawKerberosTest(TestCase): return name in ('kadmin', b'kadmin') def is_tgs(self, principal): - name = principal['name-string'][0] - return name in ('krbtgt', b'krbtgt') + name_string = principal['name-string'] + if 1 <= len(name_string) <= 2: + return name_string[0] in ('krbtgt', b'krbtgt') + + return False def is_tgt(self, ticket): sname = ticket.ticket['sname']