Blob Blame History Raw
From c75283e42d0758247fca67b6f59ac5a76ace2dd7 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 23 Aug 2019 09:27:35 +0200
Subject: [PATCH 127/187] libcli:smb: Use gnutls_error_to_ntstatus() in
 smb2_signing_decrypt_pdu()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit b9c4990f57aa778942c310b802437e6df1d17e04)
---
 libcli/smb/smb2_signing.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libcli/smb/smb2_signing.c b/libcli/smb/smb2_signing.c
index 9f40e8bbea5..15dbf3d8b2a 100644
--- a/libcli/smb/smb2_signing.c
+++ b/libcli/smb/smb2_signing.c
@@ -652,7 +652,7 @@ NTSTATUS smb2_signing_decrypt_pdu(struct smb2_signing_key *decryption_key,
 					     algo,
 					     &key);
 		if (rc < 0) {
-			status = NT_STATUS_NO_MEMORY;
+			status = gnutls_error_to_ntstatus(rc, NT_STATUS_INTERNAL_ERROR);
 			goto out;
 		}
 	}
@@ -710,10 +710,9 @@ NTSTATUS smb2_signing_decrypt_pdu(struct smb2_signing_key *decryption_key,
 						ptext,
 						&ptext_size);
 		if (rc < 0 || ptext_size != m_total) {
-			DBG_ERR("ERROR: %s\n", gnutls_strerror(rc));
 			TALLOC_FREE(ptext);
 			TALLOC_FREE(ctext);
-			status = NT_STATUS_INTERNAL_ERROR;
+			status = gnutls_error_to_ntstatus(rc, NT_STATUS_INTERNAL_ERROR);
 			goto out;
 		}
 
-- 
2.23.0