|
|
b6b438 |
From 228c16e06b82a3d7a33c2d4440aa258518c8c29f Mon Sep 17 00:00:00 2001
|
|
|
b6b438 |
From: Andreas Schneider <asn@samba.org>
|
|
|
b6b438 |
Date: Fri, 5 Jul 2019 10:12:43 +0200
|
|
|
b6b438 |
Subject: [PATCH 015/187] libcli:auth: Rename
|
|
|
b6b438 |
encode_or_decode_arc4_passwd_buffer()
|
|
|
b6b438 |
|
|
|
b6b438 |
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031
|
|
|
b6b438 |
|
|
|
b6b438 |
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
|
b6b438 |
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
|
|
b6b438 |
(cherry picked from commit 89f8b028e2d595348f9996854488d7aa552ae905)
|
|
|
b6b438 |
---
|
|
|
b6b438 |
libcli/auth/proto.h | 4 ++--
|
|
|
b6b438 |
libcli/auth/smbencrypt.c | 4 ++--
|
|
|
b6b438 |
libcli/auth/tests/test_rc4_passwd_buffer.c | 6 ++----
|
|
|
b6b438 |
source3/rpc_server/samr/srv_samr_nt.c | 4 ++--
|
|
|
b6b438 |
4 files changed, 8 insertions(+), 10 deletions(-)
|
|
|
b6b438 |
|
|
|
b6b438 |
diff --git a/libcli/auth/proto.h b/libcli/auth/proto.h
|
|
|
b6b438 |
index 651f1139cf5..1bcbeddb228 100644
|
|
|
b6b438 |
--- a/libcli/auth/proto.h
|
|
|
b6b438 |
+++ b/libcli/auth/proto.h
|
|
|
b6b438 |
@@ -184,8 +184,8 @@ bool decode_pw_buffer(TALLOC_CTX *ctx,
|
|
|
b6b438 |
/***********************************************************
|
|
|
b6b438 |
Decode an arc4 encrypted password change buffer.
|
|
|
b6b438 |
************************************************************/
|
|
|
b6b438 |
-NTSTATUS encode_or_decode_arc4_passwd_buffer(unsigned char pw_buf[532],
|
|
|
b6b438 |
- const DATA_BLOB *psession_key);
|
|
|
b6b438 |
+NTSTATUS decode_rc4_passwd_buffer(unsigned char pw_buf[532],
|
|
|
b6b438 |
+ const DATA_BLOB *psession_key);
|
|
|
b6b438 |
|
|
|
b6b438 |
/***********************************************************
|
|
|
b6b438 |
encode a password buffer with an already unicode password. The
|
|
|
b6b438 |
diff --git a/libcli/auth/smbencrypt.c b/libcli/auth/smbencrypt.c
|
|
|
b6b438 |
index 17c1e1f69ff..7e343f71577 100644
|
|
|
b6b438 |
--- a/libcli/auth/smbencrypt.c
|
|
|
b6b438 |
+++ b/libcli/auth/smbencrypt.c
|
|
|
b6b438 |
@@ -843,8 +843,8 @@ bool decode_pw_buffer(TALLOC_CTX *ctx,
|
|
|
b6b438 |
Decode an arc4 encrypted password change buffer.
|
|
|
b6b438 |
************************************************************/
|
|
|
b6b438 |
|
|
|
b6b438 |
-NTSTATUS encode_or_decode_arc4_passwd_buffer(unsigned char pw_buf[532],
|
|
|
b6b438 |
- const DATA_BLOB *psession_key)
|
|
|
b6b438 |
+NTSTATUS decode_rc4_passwd_buffer(unsigned char pw_buf[532],
|
|
|
b6b438 |
+ const DATA_BLOB *psession_key)
|
|
|
b6b438 |
{
|
|
|
b6b438 |
/* Confounder is last 16 bytes. */
|
|
|
b6b438 |
DATA_BLOB confounder = data_blob_const(&pw_buf[516], 16);
|
|
|
b6b438 |
diff --git a/libcli/auth/tests/test_rc4_passwd_buffer.c b/libcli/auth/tests/test_rc4_passwd_buffer.c
|
|
|
b6b438 |
index f40ac3a5655..eb737703230 100644
|
|
|
b6b438 |
--- a/libcli/auth/tests/test_rc4_passwd_buffer.c
|
|
|
b6b438 |
+++ b/libcli/auth/tests/test_rc4_passwd_buffer.c
|
|
|
b6b438 |
@@ -114,8 +114,7 @@ static void torture_decode_rc4_passwd_buffer(void **state)
|
|
|
b6b438 |
encrypted_test_blob,
|
|
|
b6b438 |
sizeof(out_pwd_buf.data));
|
|
|
b6b438 |
|
|
|
b6b438 |
- status = encode_or_decode_arc4_passwd_buffer(out_pwd_buf.data,
|
|
|
b6b438 |
- &session_key);
|
|
|
b6b438 |
+ status = decode_rc4_passwd_buffer(out_pwd_buf.data, &session_key);
|
|
|
b6b438 |
assert_true(NT_STATUS_IS_OK(status));
|
|
|
b6b438 |
|
|
|
b6b438 |
ok = decode_pw_buffer(NULL,
|
|
|
b6b438 |
@@ -144,8 +143,7 @@ static void torture_rc4_passwd_buffer(void **state)
|
|
|
b6b438 |
&out_pwd_buf);
|
|
|
b6b438 |
assert_true(NT_STATUS_IS_OK(status));
|
|
|
b6b438 |
|
|
|
b6b438 |
- status = encode_or_decode_arc4_passwd_buffer(out_pwd_buf.data,
|
|
|
b6b438 |
- &session_key);
|
|
|
b6b438 |
+ status = decode_rc4_passwd_buffer(out_pwd_buf.data, &session_key);
|
|
|
b6b438 |
assert_true(NT_STATUS_IS_OK(status));
|
|
|
b6b438 |
|
|
|
b6b438 |
ok = decode_pw_buffer(NULL,
|
|
|
b6b438 |
diff --git a/source3/rpc_server/samr/srv_samr_nt.c b/source3/rpc_server/samr/srv_samr_nt.c
|
|
|
b6b438 |
index c2be8bfc19a..4dc9132511f 100644
|
|
|
b6b438 |
--- a/source3/rpc_server/samr/srv_samr_nt.c
|
|
|
b6b438 |
+++ b/source3/rpc_server/samr/srv_samr_nt.c
|
|
|
b6b438 |
@@ -5185,7 +5185,7 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p,
|
|
|
b6b438 |
if(!NT_STATUS_IS_OK(status)) {
|
|
|
b6b438 |
break;
|
|
|
b6b438 |
}
|
|
|
b6b438 |
- status = encode_or_decode_arc4_passwd_buffer(
|
|
|
b6b438 |
+ status = decode_rc4_passwd_buffer(
|
|
|
b6b438 |
info->info25.password.data,
|
|
|
b6b438 |
&session_key);
|
|
|
b6b438 |
if (!NT_STATUS_IS_OK(status)) {
|
|
|
b6b438 |
@@ -5204,7 +5204,7 @@ NTSTATUS _samr_SetUserInfo(struct pipes_struct *p,
|
|
|
b6b438 |
if(!NT_STATUS_IS_OK(status)) {
|
|
|
b6b438 |
break;
|
|
|
b6b438 |
}
|
|
|
b6b438 |
- status = encode_or_decode_arc4_passwd_buffer(
|
|
|
b6b438 |
+ status = decode_rc4_passwd_buffer(
|
|
|
b6b438 |
info->info26.password.data,
|
|
|
b6b438 |
&session_key);
|
|
|
b6b438 |
if (!NT_STATUS_IS_OK(status)) {
|
|
|
b6b438 |
--
|
|
|
b6b438 |
2.23.0
|
|
|
b6b438 |
|