1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

rpc_server: Slightly simplify set_user_info_18()

Instead of adding the NULL check to data_blob_talloc_zero() put "out"
on the stack.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-08-17 20:18:45 +02:00 committed by Jeremy Allison
parent ebac118da5
commit 2154bb50f6

View File

@ -4622,11 +4622,9 @@ static NTSTATUS set_user_info_18(struct samr_UserInfo18 *id18,
}
if (id18->nt_pwd_active) {
DATA_BLOB in, out;
in = data_blob_const(id18->nt_pwd.hash, 16);
out = data_blob_talloc_zero(mem_ctx, 16);
DATA_BLOB in = data_blob_const(id18->nt_pwd.hash, 16);
uint8_t outbuf[16] = { 0, };
DATA_BLOB out = data_blob_const(outbuf, sizeof(outbuf));
rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
if (rc != 0) {
@ -4642,11 +4640,9 @@ static NTSTATUS set_user_info_18(struct samr_UserInfo18 *id18,
}
if (id18->lm_pwd_active) {
DATA_BLOB in, out;
in = data_blob_const(id18->lm_pwd.hash, 16);
out = data_blob_talloc_zero(mem_ctx, 16);
DATA_BLOB in = data_blob_const(id18->lm_pwd.hash, 16);
uint8_t outbuf[16] = { 0, };
DATA_BLOB out = data_blob_const(outbuf, sizeof(outbuf));
rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
if (rc != 0) {