diff options
author | Andreas Schneider <asn@samba.org> | 2019-06-11 14:44:10 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-24 06:11:17 +0000 |
commit | c7cea1d49c2fafd9883ce546a6be4c8ccc30ef80 (patch) | |
tree | e430910e502b4eca67e84838ce99c6c1da9abf2d | |
parent | 929e10b5fb7533973cbe2d79b14c86098510ac86 (diff) | |
download | samba-c7cea1d49c2fafd9883ce546a6be4c8ccc30ef80.tar.gz |
s3:smbd: Use gnutls_error_to_ntstatus() in smb2_sesssetup
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 <gnutls/gnutls.h> #include <gnutls/crypto.h> @@ -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); |