step the credentials to the next element in the chain, updating the
current client and server credentials and the seed
*/
-static void netlogon_creds_step(struct netlogon_creds_CredentialState *creds)
+static NTSTATUS netlogon_creds_step(struct netlogon_creds_CredentialState *creds)
{
struct netr_Credential time_cred;
+ NTSTATUS status;
DEBUG(5,("\tseed %08x:%08x\n",
IVAL(creds->seed.data, 0), IVAL(creds->seed.data, 4)));
IVAL(creds->server.data, 0), IVAL(creds->server.data, 4)));
creds->seed = time_cred;
+
+ return NT_STATUS_OK;
}
struct netr_Authenticator *next)
{
uint32_t t32n = (uint32_t)time(NULL);
+ NTSTATUS status;
/*
* we always increment and ignore an overflow here
}
}
- netlogon_creds_step(creds);
+ status = netlogon_creds_step(creds);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
next->cred = creds->client;
next->timestamp = creds->sequence;
const struct netr_Authenticator *received_authenticator,
struct netr_Authenticator *return_authenticator)
{
+ NTSTATUS status;
+
if (!received_authenticator || !return_authenticator) {
return NT_STATUS_INVALID_PARAMETER;
}
}
creds->sequence = received_authenticator->timestamp;
- netlogon_creds_step(creds);
+ status = netlogon_creds_step(creds);
+ if (!NT_STATUS_IS_OK(status)) {
+ ZERO_STRUCTP(return_authenticator);
+ return status;
+ }
+
if (netlogon_creds_server_check_internal(creds, &received_authenticator->cred)) {
return_authenticator->cred = creds->server;
return_authenticator->timestamp = 0;