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:
parent
ebac118da5
commit
2154bb50f6
@ -4622,11 +4622,9 @@ static NTSTATUS set_user_info_18(struct samr_UserInfo18 *id18,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id18->nt_pwd_active) {
|
if (id18->nt_pwd_active) {
|
||||||
|
DATA_BLOB in = data_blob_const(id18->nt_pwd.hash, 16);
|
||||||
DATA_BLOB in, out;
|
uint8_t outbuf[16] = { 0, };
|
||||||
|
DATA_BLOB out = data_blob_const(outbuf, sizeof(outbuf));
|
||||||
in = data_blob_const(id18->nt_pwd.hash, 16);
|
|
||||||
out = data_blob_talloc_zero(mem_ctx, 16);
|
|
||||||
|
|
||||||
rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
|
rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
@ -4642,11 +4640,9 @@ static NTSTATUS set_user_info_18(struct samr_UserInfo18 *id18,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id18->lm_pwd_active) {
|
if (id18->lm_pwd_active) {
|
||||||
|
DATA_BLOB in = data_blob_const(id18->lm_pwd.hash, 16);
|
||||||
DATA_BLOB in, out;
|
uint8_t outbuf[16] = { 0, };
|
||||||
|
DATA_BLOB out = data_blob_const(outbuf, sizeof(outbuf));
|
||||||
in = data_blob_const(id18->lm_pwd.hash, 16);
|
|
||||||
out = data_blob_talloc_zero(mem_ctx, 16);
|
|
||||||
|
|
||||||
rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
|
rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user