auth:creds: Use gnutls_error_to_ntstatus() in credentials_ntlm
authorAndreas Schneider <asn@samba.org>
Tue, 11 Jun 2019 13:22:06 +0000 (15:22 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 24 Jun 2019 06:11:17 +0000 (06:11 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/credentials/credentials_ntlm.c

index fa632fdeda3e48c566c98a01ee0a782ab3f11d6b..f437ee508798a53d9ef36af91d59622eb03e2deb 100644 (file)
@@ -28,6 +28,7 @@
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_internal.h"
 
+#include "libcli/util/gnutls_error.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
@@ -175,10 +176,7 @@ _PUBLIC_ NTSTATUS cli_credentials_get_ntlm_response(struct cli_credentials *cred
                                      sizeof(session_nonce),
                                      session_nonce_hash);
                if (rc < 0) {
-                       if (rc == GNUTLS_E_UNWANTED_ALGORITHM) {
-                               return NT_STATUS_NTLM_BLOCKED;
-                       }
-                       return NT_STATUS_INTERNAL_ERROR;
+                       return gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED);
                }
 
                DEBUG(5, ("NTLMSSP challenge set by NTLM2\n"));
@@ -211,10 +209,7 @@ _PUBLIC_ NTSTATUS cli_credentials_get_ntlm_response(struct cli_credentials *cred
                                      sizeof(session_nonce),
                                      session_key.data);
                if (rc < 0) {
-                       if (rc == GNUTLS_E_UNWANTED_ALGORITHM) {
-                               return NT_STATUS_NTLM_BLOCKED;
-                       }
-                       return NT_STATUS_INTERNAL_ERROR;
+                       return gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED);
                }
 
                ZERO_ARRAY(user_session_key);