mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
CVE-2022-37966 tests/krb5: Allow passing expected etypes to get_keys()
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2f17cbf3b2
)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237
[jsutton@samba.org Removed changes to protected_users_tests.py]
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
3dec660ae2
commit
0fee9c469c
@ -538,7 +538,7 @@ class KDCBaseTest(RawKerberosTest):
|
||||
|
||||
return bind, identifier, attributes
|
||||
|
||||
def get_keys(self, samdb, dn):
|
||||
def get_keys(self, samdb, dn, expected_etypes=None):
|
||||
admin_creds = self.get_admin_creds()
|
||||
|
||||
bind, identifier, attributes = self.get_secrets(
|
||||
@ -576,9 +576,10 @@ class KDCBaseTest(RawKerberosTest):
|
||||
pwd = attr.value_ctr.values[0].blob
|
||||
keys[kcrypto.Enctype.RC4] = pwd.hex()
|
||||
|
||||
default_enctypes = self.get_default_enctypes()
|
||||
if expected_etypes is None:
|
||||
expected_etypes = self.get_default_enctypes()
|
||||
|
||||
self.assertCountEqual(default_enctypes, keys)
|
||||
self.assertCountEqual(expected_etypes, keys)
|
||||
|
||||
return keys
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user