From: Andreas Schneider Date: Tue, 11 Jun 2019 12:44:10 +0000 (+0200) Subject: s3:smbd: Use gnutls_error_to_ntstatus() in smb2_sesssetup X-Git-Tag: ldb-2.0.5~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7cea1d49c2fafd9883ce546a6be4c8ccc30ef80;p=thirdparty%2Fsamba.git s3:smbd: Use gnutls_error_to_ntstatus() in smb2_sesssetup Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index c302929335c..eb81e237914 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -32,6 +32,7 @@ #include "lib/crypto/aes_ccm_128.h" #include "lib/crypto/aes_gcm_128.h" +#include "libcli/util/gnutls_error.h" #include #include @@ -229,7 +230,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session, rc = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_SHA512); if (rc < 0) { - return NT_STATUS_NO_MEMORY; + return gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED); } rc = gnutls_hash(hash_hnd, preauth->sha512_value, @@ -682,7 +683,7 @@ static NTSTATUS smbd_smb2_bind_auth_return(struct smbXsrv_session *session, rc = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_SHA512); if (rc < 0) { - return NT_STATUS_NO_MEMORY; + return gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED); } rc = gnutls_hash(hash_hnd, @@ -690,7 +691,7 @@ static NTSTATUS smbd_smb2_bind_auth_return(struct smbXsrv_session *session, sizeof(preauth->sha512_value)); if (rc < 0) { gnutls_hash_deinit(hash_hnd, NULL); - return NT_STATUS_INTERNAL_ERROR; + return gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED); } for (i = 1; i < smb2req->in.vector_count; i++) { rc = gnutls_hash(hash_hnd, @@ -698,7 +699,7 @@ static NTSTATUS smbd_smb2_bind_auth_return(struct smbXsrv_session *session, smb2req->in.vector[i].iov_len); if (rc < 0) { gnutls_hash_deinit(hash_hnd, NULL); - return NT_STATUS_INTERNAL_ERROR; + return gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED); } } gnutls_hash_deinit(hash_hnd, preauth->sha512_value);