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

auth:creds: Use gnutls_error_to_ntstatus() in credentials_ntlm

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2019-06-11 15:22:06 +02:00 committed by Andreas Schneider
parent aaf41bf96f
commit b21af2f173

View File

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