1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

tests/krb5: Save account SPN

This is useful for testing delegation.

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-29 16:41:23 +13:00 committed by Andrew Bartlett
parent 0e232fa1c9
commit bb58b4b58c
2 changed files with 8 additions and 0 deletions

View File

@ -285,6 +285,7 @@ class KDCBaseTest(RawKerberosTest):
else: else:
creds.set_workstation('') creds.set_workstation('')
creds.set_dn(ldb.Dn(samdb, dn)) creds.set_dn(ldb.Dn(samdb, dn))
creds.set_spn(spn)
# #
# Save the account name so it can be deleted in tearDownClass # Save the account name so it can be deleted in tearDownClass
self.accounts.add(dn) self.accounts.add(dn)

View File

@ -365,6 +365,7 @@ class KerberosCredentials(Credentials):
self.forced_salt = None self.forced_salt = None
self.dn = None self.dn = None
self.spn = None
def set_as_supported_enctypes(self, value): def set_as_supported_enctypes(self, value):
self.as_supported_enctypes = int(value) self.as_supported_enctypes = int(value)
@ -467,6 +468,12 @@ class KerberosCredentials(Credentials):
def get_dn(self): def get_dn(self):
return self.dn return self.dn
def set_spn(self, spn):
self.spn = spn
def get_spn(self):
return self.spn
class KerberosTicketCreds: class KerberosTicketCreds:
def __init__(self, ticket, session_key, def __init__(self, ticket, session_key,