summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2012-11-29 21:34:36 +0100
committerStefan Metzmacher <metze@samba.org>2012-12-09 19:39:07 +0100
commit64345018cda744d16b123d6ef5c4a982340484dc (patch)
tree95fb1a638ff5173b84c45360e536f1c0f01beccd
parentec06c81db313f2862544c972cbf582a07bb844c2 (diff)
downloadsamba-64345018cda744d16b123d6ef5c4a982340484dc.tar.gz
samba-64345018cda744d16b123d6ef5c4a982340484dc.tar.bz2
samba-64345018cda744d16b123d6ef5c4a982340484dc.zip
s3-rpc_client: support AES encryption in netr_ServerPasswordSet2 client.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/rpc_client/init_netlogon.c8
1 files changed, 6 insertions, 2 deletions
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);
}