1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

libcli smb smb2: Use correct enumeration type

Clang gives the following error:
../../libcli/smb/smb2_signing.c:547:48: error:
   implicit conversion from enumeration type 'gnutls_mac_algorithm_t'
   to different enumeration type 'gnutls_digest_algorithm_t'
   [-Werror,-Wenum-conversion]
   const size_t digest_len = gnutls_hash_get_len(GNUTLS_MAC_SHA256);
~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~

Should be using GNUTLS_DIG_SHA256, which is set to GNUTLS_MAC_SHA256.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon Mar 29 23:19:24 UTC 2021 on sn-devel-184
This commit is contained in:
Gary Lockyer 2021-03-25 14:36:50 +13:00 committed by Gary Lockyer
parent b448eae5e9
commit 1432314f5c

View File

@ -544,7 +544,7 @@ NTSTATUS smb2_key_derivation(const uint8_t *KI, size_t KI_len,
gnutls_hmac_hd_t hmac_hnd = NULL;
uint8_t buf[4];
static const uint8_t zero = 0;
const size_t digest_len = gnutls_hash_get_len(GNUTLS_MAC_SHA256);
const size_t digest_len = gnutls_hash_get_len(GNUTLS_DIG_SHA256);
uint8_t digest[digest_len];
uint32_t i = 1;
uint32_t L = KO_len * 8;