From 64345018cda744d16b123d6ef5c4a982340484dc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 29 Nov 2012 21:34:36 +0100 Subject: s3-rpc_client: support AES encryption in netr_ServerPasswordSet2 client. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/init_netlogon.c b/source3/rpc_client/init_netlogon.c index 0d33d6fdd6..4d9157bbb8 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); } -- cgit