Blob Blame History Raw
From cef95d8835a04065b9c7422a637f60efdb9a93fe Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet@samba.org>
Date: Fri, 16 Aug 2019 14:29:45 +1200
Subject: [PATCH 098/187] auth/credentials: Check NTSTATUS return from
 netlogon_creds_aes_encrypt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit fefd95091cc52f5e2655fa392312a8b1fa1d35fd)
---
 auth/credentials/credentials.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 5ebec483705..81f9dbb9eb3 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -1333,19 +1333,19 @@ _PUBLIC_ NTSTATUS netlogon_creds_session_encrypt(
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 	if (state->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) {
-		netlogon_creds_aes_encrypt(state,
-					   data.data,
-					   data.length);
+		status = netlogon_creds_aes_encrypt(state,
+						    data.data,
+						    data.length);
 	} else if (state->negotiate_flags & NETLOGON_NEG_ARCFOUR) {
 		status = netlogon_creds_arcfour_crypt(state,
 						      data.data,
 						      data.length);
-		if (!NT_STATUS_IS_OK(status)) {
-			return status;
-		}
 	} else {
 		DBG_ERR("Unsupported encryption option negotiated");
-		return NT_STATUS_NOT_SUPPORTED;
+		status = NT_STATUS_NOT_SUPPORTED;
+	}
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
 	}
 	return NT_STATUS_OK;
 }
-- 
2.23.0