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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f24f26aaa58b9223e2c0cfd3e5086278b27903f1)
---
 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 682327bb21b..c39f8e4780a 100644
--- a/libcli/smb/smb2_signing.c
+++ b/libcli/smb/smb2_signing.c
@@ -470,7 +470,7 @@ NTSTATUS smb2_signing_encrypt_pdu(struct smb2_signing_key *encryption_key,
 					algo,
 					&key);
 		if (rc < 0) {
-			status = NT_STATUS_NO_MEMORY;
+			status = gnutls_error_to_ntstatus(rc, NT_STATUS_INTERNAL_ERROR);
 			goto out;
 		}
 	}
@@ -523,10 +523,9 @@ NTSTATUS smb2_signing_encrypt_pdu(struct smb2_signing_key *encryption_key,
 						ctext,
 						&ctext_size);
 		if (rc < 0 || ctext_size != m_total + tag_size) {
-			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