Blob Blame History Raw
From d5b5b280fefca55a96456b9348b20b78a36fc227 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Wed, 13 Nov 2019 09:52:53 +0100
Subject: [PATCH 149/187] libcli:auth: Return NTSTATUS for
 netlogon_creds_client_authenticator()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7c7dc855ba982a37cb5040752ca473aab3446d6c)
---
 libcli/auth/credentials.c | 7 +++++--
 libcli/auth/proto.h       | 5 +++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c
index 359ba8c4b90..e5bf2c4703c 100644
--- a/libcli/auth/credentials.c
+++ b/libcli/auth/credentials.c
@@ -513,8 +513,9 @@ struct netlogon_creds_CredentialState *netlogon_creds_client_init_session_key(TA
   produce the next authenticator in the sequence ready to send to
   the server
 */
-void netlogon_creds_client_authenticator(struct netlogon_creds_CredentialState *creds,
-				struct netr_Authenticator *next)
+NTSTATUS
+netlogon_creds_client_authenticator(struct netlogon_creds_CredentialState *creds,
+				    struct netr_Authenticator *next)
 {
 	uint32_t t32n = (uint32_t)time(NULL);
 
@@ -543,6 +544,8 @@ void netlogon_creds_client_authenticator(struct netlogon_creds_CredentialState *
 
 	next->cred = creds->client;
 	next->timestamp = creds->sequence;
+
+	return NT_STATUS_OK;
 }
 
 /*
diff --git a/libcli/auth/proto.h b/libcli/auth/proto.h
index 52a33d8d457..eef1c8dc095 100644
--- a/libcli/auth/proto.h
+++ b/libcli/auth/proto.h
@@ -40,8 +40,9 @@ struct netlogon_creds_CredentialState *netlogon_creds_client_init(TALLOC_CTX *me
 								  uint32_t negotiate_flags);
 struct netlogon_creds_CredentialState *netlogon_creds_client_init_session_key(TALLOC_CTX *mem_ctx, 
 									      const uint8_t session_key[16]);
-void netlogon_creds_client_authenticator(struct netlogon_creds_CredentialState *creds,
-				struct netr_Authenticator *next);
+NTSTATUS
+netlogon_creds_client_authenticator(struct netlogon_creds_CredentialState *creds,
+				    struct netr_Authenticator *next);
 bool netlogon_creds_client_check(struct netlogon_creds_CredentialState *creds,
 			const struct netr_Credential *received_credentials);
 struct netlogon_creds_CredentialState *netlogon_creds_copy(
-- 
2.23.0