b6b438
From d2c3c0ccc6ec7f38b995545d31431d013bd7e047 Mon Sep 17 00:00:00 2001
b6b438
From: Andreas Schneider <asn@samba.org>
b6b438
Date: Mon, 4 Nov 2019 08:40:34 +0100
b6b438
Subject: [PATCH 138/187] libcli:smb: Do not use gnutls_aead_cipher_encryptv2()
b6b438
 with GnuTLS 3.6.10
b6b438
b6b438
The gnutls_aead_cipher_encryptv2() implementation was released with a
b6b438
bug. This wont be fixed before 3.6.11.
b6b438
b6b438
See https://gitlab.com/gnutls/gnutls/merge_requests/1085
b6b438
b6b438
Signed-off-by: Andreas Schneider <asn@samba.org>
b6b438
Reviewed-by: Alexander Bokovoy <ab@samba.org>
b6b438
(cherry picked from commit 176d0f0364bc1deb3c8df2f3bb928e01f89f216b)
b6b438
---
b6b438
 libcli/smb/smb2_signing.c | 8 ++++++--
b6b438
 1 file changed, 6 insertions(+), 2 deletions(-)
b6b438
b6b438
diff --git a/libcli/smb/smb2_signing.c b/libcli/smb/smb2_signing.c
b6b438
index 166ab9d83ff..7561a7a858d 100644
b6b438
--- a/libcli/smb/smb2_signing.c
b6b438
+++ b/libcli/smb/smb2_signing.c
b6b438
@@ -478,7 +478,9 @@ NTSTATUS smb2_signing_encrypt_pdu(struct smb2_signing_key *encryption_key,
b6b438
 	       0,
b6b438
 	       16 - iv_size);
b6b438
 
b6b438
-#ifdef HAVE_GNUTLS_AEAD_CIPHER_ENCRYPTV2
b6b438
+/* gnutls_aead_cipher_encryptv2() has a bug in version 3.6.10 */
b6b438
+#if defined(HAVE_GNUTLS_AEAD_CIPHER_ENCRYPTV2) && \
b6b438
+    GNUTLS_VERSION_NUMBER > 0x03060a
b6b438
 	{
b6b438
 		uint8_t tag[tag_size];
b6b438
 		giovec_t auth_iov[1];
b6b438
@@ -679,7 +681,9 @@ NTSTATUS smb2_signing_decrypt_pdu(struct smb2_signing_key *decryption_key,
b6b438
 		}
b6b438
 	}
b6b438
 
b6b438
-#ifdef HAVE_GNUTLS_AEAD_CIPHER_ENCRYPTV2
b6b438
+/* gnutls_aead_cipher_encryptv2() has a bug in version 3.6.10 */
b6b438
+#if defined(HAVE_GNUTLS_AEAD_CIPHER_ENCRYPTV2) && \
b6b438
+    GNUTLS_VERSION_NUMBER > 0x03060a
b6b438
 	{
b6b438
 		giovec_t auth_iov[1];
b6b438
 
b6b438
-- 
b6b438
2.23.0
b6b438