]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Use PAC buffer type constants from krb5pac.idl
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 16 Sep 2021 00:06:51 +0000 (12:06 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 21 Sep 2021 23:05:41 +0000 (23:05 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14642

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

index ae62c9d5fc691bd945f71d79f5cdf62deabf7bd2..2cebd9ef0cf166a521b4255f440da76057d601a8 100644 (file)
@@ -1127,13 +1127,6 @@ class KDCBaseTest(RawKerberosTest):
     PacData = namedtuple(
         "PacData",
         "account_name account_sid logon_name upn domain_name")
-    PAC_LOGON_INFO = 1
-    PAC_CREDENTIAL_INFO = 2
-    PAC_SRV_CHECKSUM = 6
-    PAC_KDC_CHECKSUM = 7
-    PAC_LOGON_NAME = 10
-    PAC_CONSTRAINED_DELEGATION = 11
-    PAC_UPN_DNS_INFO = 12
 
     def get_pac_data(self, authorization_data):
         '''Decode the PAC element contained in the authorization-data element
@@ -1154,15 +1147,15 @@ class KDCBaseTest(RawKerberosTest):
             for ad in (x for x in buf if x['ad-type'] == AD_WIN2K_PAC):
                 pb = ndr_unpack(krb5pac.PAC_DATA, ad['ad-data'])
                 for pac in pb.buffers:
-                    if pac.type == self.PAC_LOGON_INFO:
+                    if pac.type == krb5pac.PAC_TYPE_LOGON_INFO:
                         account_name = (
                             pac.info.info.info3.base.account_name)
                         user_sid = (
                             str(pac.info.info.info3.base.domain_sid)
                             + "-" + str(pac.info.info.info3.base.rid))
-                    elif pac.type == self.PAC_LOGON_NAME:
+                    elif pac.type == krb5pac.PAC_TYPE_LOGON_NAME:
                         logon_name = pac.info.account_name
-                    elif pac.type == self.PAC_UPN_DNS_INFO:
+                    elif pac.type == krb5pac.PAC_TYPE_UPN_DNS_INFO:
                         upn = pac.info.upn_name
                         domain_name = pac.info.dns_domain_name