From: Stefan Metzmacher Date: Mon, 28 Oct 2024 14:39:57 +0000 (+0100) Subject: python/tests: use encrypt_netr_PasswordInfo in KDCBaseTest._test_samlogon() X-Git-Tag: tdb-1.4.13~791 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7d57fc6e992ca212b834d5dd4d381244bca55c6;p=thirdparty%2Fsamba.git python/tests: use encrypt_netr_PasswordInfo in KDCBaseTest._test_samlogon() This will make it easier to implement netr_ServerAuthenticateKerberos() later... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py index df5e22be4ae..66e222caa47 100644 --- a/python/samba/tests/krb5/kdc_base_test.py +++ b/python/samba/tests/krb5/kdc_base_test.py @@ -54,6 +54,7 @@ from samba.credentials import ( from samba.crypto import des_crypt_blob_16, md4_hash_blob from samba.dcerpc import ( claims, + dcerpc, drsblobs, drsuapi, krb5ccache, @@ -3702,10 +3703,12 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): workstation = domain_joined_mach_creds.get_username() # Calling this initializes netlogon_creds on mach_creds, as is required - # before calling mach_creds.encrypt_samr_password(). + # before calling mach_creds.encrypt_netr_PasswordInfo(). conn = netlogon.netlogon(f'ncacn_ip_tcp:{dc_server}[schannel,seal]', self.get_lp(), domain_joined_mach_creds) + auth_type = dcerpc.DCERPC_AUTH_TYPE_SCHANNEL + auth_level = dcerpc.DCERPC_AUTH_LEVEL_PRIVACY if logon_type == netlogon.NetlogonInteractiveInformation: logon = netlogon.netr_PasswordInfo() @@ -3715,11 +3718,14 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): nt_pass = samr.Password() nt_pass.hash = list(creds.get_nt_hash()) - domain_joined_mach_creds.encrypt_samr_password(nt_pass) logon.lmpassword = lm_pass logon.ntpassword = nt_pass + domain_joined_mach_creds.encrypt_netr_PasswordInfo(info=logon, + auth_type=auth_type, + auth_level=auth_level) + elif logon_type == netlogon.NetlogonNetworkInformation: computername = ntlmssp.AV_PAIR() computername.AvId = ntlmssp.MsvAvNbComputerName