libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_logon()
authorAndreas Schneider <asn@samba.org>
Wed, 29 May 2019 14:49:29 +0000 (16:49 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 27 Jun 2019 12:54:23 +0000 (12:54 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/auth/credentials.c
libcli/auth/proto.h
source3/rpc_server/netlogon/srv_netlog_nt.c
source4/rpc_server/netlogon/dcerpc_netlogon.c

index b7d2c4fa3a3979ac4074ee2337a8bd1d194e7705..e0fec6e2ef291de32e43ede5197c741fc205543f 100644 (file)
@@ -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,
index 88ef50357c925f68d5c014275b5ff46d7438dd88..0ae5cbc4ed351c9cfd7f5fb78930d1b310036da7 100644 (file)
@@ -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);
index 95639eb7d3cb015de8e6077e48e3c0b71af42a4b..7a50e456ec6e96ecf3242cf6de01b33f2d5339d1 100644 (file)
@@ -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)) {
index 822a70575bb9db45cbf9d0409cca556ecef4bb96..b99964ebb8fba24eee638452a5a27a4184930667 100644 (file)
@@ -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: