From: Andreas Schneider Date: Fri, 1 Mar 2019 16:33:01 +0000 (+0100) Subject: libcli:auth: Use netlogon_creds_aes_encrypt() in netlogon_creds_step_crypt() X-Git-Tag: tevent-0.10.1~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd97c47873007bfc502926070a758b520d95abf1;p=thirdparty%2Fsamba.git libcli:auth: Use netlogon_creds_aes_encrypt() in netlogon_creds_step_crypt() Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c index 319dacdac0b..3b31d1e0300 100644 --- a/libcli/auth/credentials.c +++ b/libcli/auth/credentials.c @@ -35,12 +35,9 @@ static void netlogon_creds_step_crypt(struct netlogon_creds_CredentialState *cre struct netr_Credential *out) { if (creds->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) { - AES_KEY key; - uint8_t iv[AES_BLOCK_SIZE] = {0}; + memcpy(out->data, in->data, sizeof(out->data)); - AES_set_encrypt_key(creds->session_key, 128, &key); - - aes_cfb8_encrypt(in->data, out->data, 8, &key, iv, AES_ENCRYPT); + netlogon_creds_aes_encrypt(creds, out->data, sizeof(out->data)); } else { des_crypt112(out->data, in->data, creds->session_key, 1); }