samba/SOURCES/0015-libcli-auth-Rename-enc...

98 lines
3.8 KiB
Diff

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