summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-04 10:05:51 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-04 12:33:06 +0200
commit396f3177cafdf0ed9a42d28c60ac59579864eae1 (patch)
tree7362eb7d9ac5b5162c81da15e7258b9849c4de9c
parent49d0432efd84ef2e4bcaa85d4aad11c18d947db1 (diff)
downloadsamba-396f3177cafdf0ed9a42d28c60ac59579864eae1.tar.gz
samba-396f3177cafdf0ed9a42d28c60ac59579864eae1.tar.bz2
samba-396f3177cafdf0ed9a42d28c60ac59579864eae1.zip
s3:rpc_server/netlogon: make usage of session_extract_session_key()
This makes sure we return NO_USER_SESSION_KEY if there's no session key. metze
-rw-r--r--source3/rpc_server/netlogon/srv_netlog_nt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c
index 4621590169..d992a65561 100644
--- a/source3/rpc_server/netlogon/srv_netlog_nt.c
+++ b/source3/rpc_server/netlogon/srv_netlog_nt.c
@@ -1142,9 +1142,17 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
struct samr_UserInfo18 info18;
DATA_BLOB in,out;
int rc;
+ DATA_BLOB session_key;
ZERO_STRUCT(user_handle);
+ status = session_extract_session_key(session_info,
+ &session_key,
+ KEY_USE_16BYTES);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto out;
+ }
+
rc = tsocket_address_inet_from_strings(mem_ctx,
"ip",
"127.0.0.1",
@@ -1210,7 +1218,7 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
in = data_blob_const(nt_hash->hash, 16);
out = data_blob_talloc_zero(mem_ctx, 16);
- sess_crypt_blob(&out, &in, &session_info->session_key, true);
+ sess_crypt_blob(&out, &in, &session_key, true);
memcpy(info18.nt_pwd.hash, out.data, out.length);
info18.nt_pwd_active = true;