1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_validation()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2019-05-29 14:35:20 +02:00 committed by Andreas Schneider
parent 00dd1a8bf8
commit 2e6fe27bad
4 changed files with 49 additions and 21 deletions

View File

@ -680,12 +680,14 @@ static void netlogon_creds_crypt_samlogon_validation(struct netlogon_creds_Crede
}
}
void netlogon_creds_decrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds,
uint16_t validation_level,
union netr_Validation *validation)
NTSTATUS netlogon_creds_decrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds,
uint16_t validation_level,
union netr_Validation *validation)
{
netlogon_creds_crypt_samlogon_validation(creds, validation_level,
validation, false);
return NT_STATUS_OK;
}
NTSTATUS netlogon_creds_encrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds,

View File

@ -2531,9 +2531,13 @@ static void netlogon_creds_cli_LogonSamLogon_done(struct tevent_req *subreq)
return;
}
netlogon_creds_decrypt_samlogon_validation(state->ro_creds,
state->validation_level,
state->validation);
status = netlogon_creds_decrypt_samlogon_validation(state->ro_creds,
state->validation_level,
state->validation);
if (tevent_req_nterror(req, status)) {
netlogon_creds_cli_LogonSamLogon_cleanup(req, status);
return;
}
tevent_req_done(req);
return;
@ -2601,9 +2605,13 @@ static void netlogon_creds_cli_LogonSamLogon_done(struct tevent_req *subreq)
return;
}
netlogon_creds_decrypt_samlogon_validation(&state->tmp_creds,
state->validation_level,
state->validation);
status = netlogon_creds_decrypt_samlogon_validation(&state->tmp_creds,
state->validation_level,
state->validation);
if (tevent_req_nterror(req, result)) {
netlogon_creds_cli_LogonSamLogon_cleanup(req, result);
return;
}
tevent_req_done(req);
}

View File

@ -59,9 +59,9 @@ struct netlogon_creds_CredentialState *netlogon_creds_server_init(TALLOC_CTX *me
NTSTATUS netlogon_creds_server_step_check(struct netlogon_creds_CredentialState *creds,
const struct netr_Authenticator *received_authenticator,
struct netr_Authenticator *return_authenticator) ;
void netlogon_creds_decrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds,
uint16_t validation_level,
union netr_Validation *validation);
NTSTATUS netlogon_creds_decrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds,
uint16_t validation_level,
union netr_Validation *validation);
NTSTATUS netlogon_creds_encrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds,
uint16_t validation_level,
union netr_Validation *validation);

View File

@ -176,9 +176,15 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
validation_level = r->in.validation_level;
netlogon_creds_decrypt_samlogon_validation(samlogon_state->creds,
validation_level,
r->out.validation);
status = netlogon_creds_decrypt_samlogon_validation(samlogon_state->creds,
validation_level,
r->out.validation);
if (!NT_STATUS_IS_OK(status)) {
if (error_string) {
*error_string = strdup(nt_errstr(status));
}
return status;
}
switch (validation_level) {
case 2:
@ -210,9 +216,15 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
validation_level = r_ex->in.validation_level;
netlogon_creds_decrypt_samlogon_validation(samlogon_state->creds,
validation_level,
r_ex->out.validation);
status = netlogon_creds_decrypt_samlogon_validation(samlogon_state->creds,
validation_level,
r_ex->out.validation);
if (!NT_STATUS_IS_OK(status)) {
if (error_string) {
*error_string = strdup(nt_errstr(status));
}
return status;
}
switch (validation_level) {
case 2:
@ -252,9 +264,15 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
validation_level = r_flags->in.validation_level;
netlogon_creds_decrypt_samlogon_validation(samlogon_state->creds,
validation_level,
r_flags->out.validation);
status = netlogon_creds_decrypt_samlogon_validation(samlogon_state->creds,
validation_level,
r_flags->out.validation);
if (!NT_STATUS_IS_OK(status)) {
if (error_string) {
*error_string = strdup(nt_errstr(status));
}
return status;
}
switch (validation_level) {
case 2: