diff options
author | Andreas Schneider <asn@samba.org> | 2019-06-11 15:16:31 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-24 06:11:17 +0000 |
commit | 35573821b633e421fc02d6620abfdb13f25e7622 (patch) | |
tree | 2e1d702e48f7d6f0f77cb877b3d8303f2c5ed8d8 /auth | |
parent | 226895baa914e77d110bef594d640a546392837d (diff) | |
download | samba-35573821b633e421fc02d6620abfdb13f25e7622.tar.gz |
auth:ntlmssp: Use gnutls_error_to_ntstatus() in ntlmssp_client
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth')
-rw-r--r-- | auth/ntlmssp/ntlmssp_client.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/auth/ntlmssp/ntlmssp_client.c b/auth/ntlmssp/ntlmssp_client.c index 792afcf6d20..8940522d39c 100644 --- a/auth/ntlmssp/ntlmssp_client.c +++ b/auth/ntlmssp/ntlmssp_client.c @@ -35,6 +35,7 @@ struct auth_session_info; #include "../auth/ntlmssp/ntlmssp_ndr.h" #include "../nsswitch/libwbclient/wbclient.h" +#include "libcli/util/gnutls_error.h" #include <gnutls/gnutls.h> #include <gnutls/crypto.h> @@ -749,10 +750,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security, session_key.data, MIN(session_key.length, 64)); if (rc < 0) { - nt_status = NT_STATUS_NO_MEMORY; - if (rc == GNUTLS_E_UNWANTED_ALGORITHM) { - nt_status = NT_STATUS_NTLM_BLOCKED; - } + nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED); goto done; } @@ -761,19 +759,19 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security, ntlmssp_state->negotiate_blob.length); if (rc < 0) { gnutls_hmac_deinit(hmac_hnd, NULL); - nt_status = NT_STATUS_INTERNAL_ERROR; + nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED); goto done; } rc = gnutls_hmac(hmac_hnd, in.data, in.length); if (rc < 0) { gnutls_hmac_deinit(hmac_hnd, NULL); - nt_status = NT_STATUS_INTERNAL_ERROR; + nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED); goto done; } rc = gnutls_hmac(hmac_hnd, out->data, out->length); if (rc < 0) { gnutls_hmac_deinit(hmac_hnd, NULL); - nt_status = NT_STATUS_INTERNAL_ERROR; + nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED); goto done; } |