From: Andreas Schneider Date: Wed, 29 May 2019 14:49:29 +0000 (+0200) Subject: libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_logon() X-Git-Tag: ldb-2.0.5~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cad3adb0b478e3bb2b964d4eefba4e96f34d4270;p=thirdparty%2Fsamba.git libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_logon() Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c index b7d2c4fa3a3..e0fec6e2ef2 100644 --- a/libcli/auth/credentials.c +++ b/libcli/auth/credentials.c @@ -804,11 +804,13 @@ static void netlogon_creds_crypt_samlogon_logon(struct netlogon_creds_Credential } } -void netlogon_creds_decrypt_samlogon_logon(struct netlogon_creds_CredentialState *creds, - enum netr_LogonInfoClass level, - union netr_LogonLevel *logon) +NTSTATUS netlogon_creds_decrypt_samlogon_logon(struct netlogon_creds_CredentialState *creds, + enum netr_LogonInfoClass level, + union netr_LogonLevel *logon) { netlogon_creds_crypt_samlogon_logon(creds, level, logon, false); + + return NT_STATUS_OK; } NTSTATUS netlogon_creds_encrypt_samlogon_logon(struct netlogon_creds_CredentialState *creds, diff --git a/libcli/auth/proto.h b/libcli/auth/proto.h index 88ef50357c9..0ae5cbc4ed3 100644 --- a/libcli/auth/proto.h +++ b/libcli/auth/proto.h @@ -65,9 +65,9 @@ NTSTATUS netlogon_creds_decrypt_samlogon_validation(struct netlogon_creds_Creden NTSTATUS netlogon_creds_encrypt_samlogon_validation(struct netlogon_creds_CredentialState *creds, uint16_t validation_level, union netr_Validation *validation); -void netlogon_creds_decrypt_samlogon_logon(struct netlogon_creds_CredentialState *creds, - enum netr_LogonInfoClass level, - union netr_LogonLevel *logon); +NTSTATUS netlogon_creds_decrypt_samlogon_logon(struct netlogon_creds_CredentialState *creds, + enum netr_LogonInfoClass level, + union netr_LogonLevel *logon); NTSTATUS netlogon_creds_encrypt_samlogon_logon(struct netlogon_creds_CredentialState *creds, enum netr_LogonInfoClass level, union netr_LogonLevel *logon); diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c index 95639eb7d3c..7a50e456ec6 100644 --- a/source3/rpc_server/netlogon/srv_netlog_nt.c +++ b/source3/rpc_server/netlogon/srv_netlog_nt.c @@ -1584,11 +1584,12 @@ static NTSTATUS _netr_LogonSamLogon_base(struct pipes_struct *p, DEBUG(5,("Attempting validation level %d for unmapped username %s.\n", r->in.validation_level, nt_username)); - status = NT_STATUS_OK; - - netlogon_creds_decrypt_samlogon_logon(creds, - r->in.logon_level, - logon); + status = netlogon_creds_decrypt_samlogon_logon(creds, + r->in.logon_level, + logon); + if (!NT_STATUS_IS_OK(status)) { + return status; + } status = make_auth3_context_for_netlogon(talloc_tos(), &auth_context); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 822a70575bb..b99964ebb8f 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -970,9 +970,10 @@ static NTSTATUS dcesrv_netr_LogonSamLogon_base_call(struct dcesrv_netr_LogonSamL user_info->service_description = "SamLogon"; - netlogon_creds_decrypt_samlogon_logon(creds, - r->in.logon_level, - r->in.logon); + nt_status = netlogon_creds_decrypt_samlogon_logon(creds, + r->in.logon_level, + r->in.logon); + NT_STATUS_NOT_OK_RETURN(nt_status); switch (r->in.logon_level) { case NetlogonInteractiveInformation: