Blob Blame History Raw
From de4a182c0fab70125cd7e572a8f913c2f686f827 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Thu, 14 Mar 2019 09:26:04 +0100
Subject: [PATCH 112/187] libcli:smb: Add gnutls_aead_cipher_hd_t to
 smb2_signing_key structure

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Adapted to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 37dc63e8afab8e1f88dc8a4b77c6ef3337933eb1)
---
 libcli/smb/smb2_signing.c | 5 +++++
 libcli/smb/smb2_signing.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/libcli/smb/smb2_signing.c b/libcli/smb/smb2_signing.c
index 2f9bae4ba8e..01027d55fbe 100644
--- a/libcli/smb/smb2_signing.c
+++ b/libcli/smb/smb2_signing.c
@@ -35,6 +35,11 @@ int smb2_signing_key_destructor(struct smb2_signing_key *key)
 		key->hmac_hnd = NULL;
 	}
 
+	if (key->cipher_hnd != NULL) {
+		gnutls_aead_cipher_deinit(key->cipher_hnd);
+		key->cipher_hnd = NULL;
+	}
+
 	return 0;
 }
 
diff --git a/libcli/smb/smb2_signing.h b/libcli/smb/smb2_signing.h
index 96a002f4a0c..13fb54e4e4e 100644
--- a/libcli/smb/smb2_signing.h
+++ b/libcli/smb/smb2_signing.h
@@ -25,9 +25,12 @@ struct iovec;
  /* Forward declaration of GnuTLS typedefs */
 struct hmac_hd_st;
 typedef struct hmac_hd_st* gnutls_hmac_hd_t;
+struct  api_aead_cipher_hd_st;
+typedef struct api_aead_cipher_hd_st *gnutls_aead_cipher_hd_t;
 
 struct smb2_signing_key {
 	gnutls_hmac_hd_t hmac_hnd;
+	gnutls_aead_cipher_hd_t cipher_hnd;
 	DATA_BLOB blob;
 };
 
-- 
2.23.0