summaryrefslogtreecommitdiff
path: root/libcli/samsync
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-05-29 14:46:17 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-06-27 12:54:23 +0000
commit67e6a9af2c688ce89c87b0ed381274b3c12c37a9 (patch)
tree67d702d72da3d9588bf03dd6ee4836ca8893729d /libcli/samsync
parent99d250a3abb1761e509359532e72caee2af6ee81 (diff)
downloadsamba-67e6a9af2c688ce89c87b0ed381274b3c12c37a9.tar.gz
libcli:auth: Return NTSTATUS for netlogon_creds_arcfour_crypt()
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli/samsync')
-rw-r--r--libcli/samsync/decrypt.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/libcli/samsync/decrypt.c b/libcli/samsync/decrypt.c
index f5ea4cc70fc..5cda966fb42 100644
--- a/libcli/samsync/decrypt.c
+++ b/libcli/samsync/decrypt.c
@@ -69,9 +69,18 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx,
DATA_BLOB data;
struct netr_USER_KEYS keys;
enum ndr_err_code ndr_err;
+ NTSTATUS status;
+
data.data = user->user_private_info.SensitiveData;
data.length = user->user_private_info.DataLength;
- netlogon_creds_arcfour_crypt(creds, data.data, data.length);
+
+ status = netlogon_creds_arcfour_crypt(creds,
+ data.data,
+ data.length);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
user->user_private_info.SensitiveData = data.data;
user->user_private_info.DataLength = data.length;
@@ -125,11 +134,21 @@ static NTSTATUS fix_secret(TALLOC_CTX *mem_ctx,
struct netr_DELTA_ENUM *delta)
{
struct netr_DELTA_SECRET *secret = delta->delta_union.secret;
- netlogon_creds_arcfour_crypt(creds, secret->current_cipher.cipher_data,
- secret->current_cipher.maxlen);
+ NTSTATUS status;
- netlogon_creds_arcfour_crypt(creds, secret->old_cipher.cipher_data,
- secret->old_cipher.maxlen);
+ status = netlogon_creds_arcfour_crypt(creds,
+ secret->current_cipher.cipher_data,
+ secret->current_cipher.maxlen);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ status = netlogon_creds_arcfour_crypt(creds,
+ secret->old_cipher.cipher_data,
+ secret->old_cipher.maxlen);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
return NT_STATUS_OK;
}