From: Stefan Metzmacher Date: Mon, 28 Oct 2024 14:56:09 +0000 (+0100) Subject: libcli/auth: make use of netlogon_creds_encrypt_samr_CryptPassword X-Git-Tag: tdb-1.4.13~787 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=285ec9ecde712e40e6f0981bcb379ee911bfe9d8;p=thirdparty%2Fsamba.git libcli/auth: make use of netlogon_creds_encrypt_samr_CryptPassword This will help when implementing netr_ServerAuthenticateKerberos()... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall --- diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 78aa9bf8b75..017f3060139 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -2346,22 +2346,13 @@ static void netlogon_creds_cli_ServerPasswordSet_locked(struct tevent_req *subre if (state->tmp_creds.negotiate_flags & NETLOGON_NEG_PASSWORD_SET2) { - if (state->tmp_creds.negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) { - status = netlogon_creds_aes_encrypt(&state->tmp_creds, - state->samr_crypt_password.data, - 516); - if (tevent_req_nterror(req, status)) { - netlogon_creds_cli_ServerPasswordSet_cleanup(req, status); - return; - } - } else { - status = netlogon_creds_arcfour_crypt(&state->tmp_creds, - state->samr_crypt_password.data, - 516); - if (tevent_req_nterror(req, status)) { - netlogon_creds_cli_ServerPasswordSet_cleanup(req, status); - return; - } + status = netlogon_creds_encrypt_samr_CryptPassword(&state->tmp_creds, + &state->samr_crypt_password, + state->auth_type, + state->auth_level); + if (tevent_req_nterror(req, status)) { + netlogon_creds_cli_ServerPasswordSet_cleanup(req, status); + return; } memcpy(state->netr_crypt_password.data,