From 64345018cda744d16b123d6ef5c4a982340484dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Thu, 29 Nov 2012 21:34:36 +0100 Subject: [PATCH] s3-rpc_client: support AES encryption in netr_ServerPasswordSet2 client. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Guenther Signed-off-by: Günther Deschner Reviewed-by: Stefan Metzmacher --- source3/rpc_client/init_netlogon.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/rpc_client/init_netlogon.c b/source3/rpc_client/init_netlogon.c index 0d33d6fdd6a..4d9157bbb8c 100644 --- a/source3/rpc_client/init_netlogon.c +++ b/source3/rpc_client/init_netlogon.c @@ -19,7 +19,7 @@ #include "includes.h" #include "../libcli/auth/libcli_auth.h" -#include "../lib/crypto/arcfour.h" +#include "../lib/crypto/crypto.h" #include "rpc_client/init_netlogon.h" /************************************************************************* @@ -34,7 +34,11 @@ void init_netr_CryptPassword(const char *pwd, encode_pw_buffer(password_buf.data, pwd, STR_UNICODE); - netlogon_creds_arcfour_crypt(creds, password_buf.data, 516); + if (creds->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) { + netlogon_creds_aes_encrypt(creds, password_buf.data, 516); + } else { + netlogon_creds_arcfour_crypt(creds, password_buf.data, 516); + } memcpy(pwd_buf->data, password_buf.data, 512); pwd_buf->length = IVAL(password_buf.data, 512); } -- 2.11.4.GIT