aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2020-01-07 15:37:12 +0100
committerDario Lombardo <lomato@gmail.com>2020-01-07 16:52:24 +0000
commitb6b7065b7c654ba0e1b872cef38a298033c8f26b (patch)
tree6cc707dd3351cf08328a0760ed0f679091934384 /epan
parent984c7a9c42c09caa33641ec91c5c1491177970ed (diff)
dcerpc-netlogon: fix compilation with older gcrypt versions.
GCRY_CIPHER_MODE_CFB8 has been introduced in gcrypt 1.8.0: https://abi-laboratory.pro/?view=changelog&l=libgcrypt&v=1.8.0 Add conditional compilation code for older versions. Change-Id: I756cc118fce261a6e1a580f4a6a244c8ff0b381f Reviewed-on: https://code.wireshark.org/review/35678 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-dcerpc-netlogon.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c
index 7c60217a30..1b05041d1c 100644
--- a/epan/dissectors/packet-dcerpc-netlogon.c
+++ b/epan/dissectors/packet-dcerpc-netlogon.c
@@ -6652,7 +6652,7 @@ netlogon_dissect_netrserverauthenticate23_reply(tvbuff_t *tvb, int offset,
#endif
if( flags & NETLOGON_FLAG_AES )
{
-#ifdef HAVE_KERBEROS
+#if defined(HAVE_KERBEROS) && GCRYPT_VERSION_NUMBER >= 0x010800 /* 1.8.0 */
guint8 salt_buf[16] = { 0 };
guint8 sha256[HASH_SHA2_256_LENGTH];
guint64 calculated_cred;
@@ -7705,6 +7705,7 @@ static int get_seal_key(const guint8 *session_key,int key_len,guint8* seal_key)
}
+#if GCRYPT_VERSION_NUMBER >= 0x010800 /* 1.8.0 */
static guint64 uncrypt_sequence_aes(guint8* session_key,guint64 checksum,guint64 enc_seq,unsigned char is_server _U_)
{
gcry_error_t err;
@@ -7747,6 +7748,7 @@ static guint64 uncrypt_sequence_aes(guint8* session_key,guint64 checksum,guint64
gcry_cipher_close(cipher_hd);
return enc_seq;
}
+#endif
static guint64 uncrypt_sequence_strong(guint8* session_key,guint64 checksum,guint64 enc_seq,unsigned char is_server _U_)
{
@@ -7784,9 +7786,11 @@ static guint64 uncrypt_sequence_strong(guint8* session_key,guint64 checksum,guin
static guint64 uncrypt_sequence(guint32 flags, guint8* session_key,guint64 checksum,guint64 enc_seq,unsigned char is_server _U_)
{
+#if GCRYPT_VERSION_NUMBER >= 0x010800 /* 1.8.0 */
if (flags & NETLOGON_FLAG_AES) {
return uncrypt_sequence_aes(session_key, checksum, enc_seq, is_server);
}
+#endif
if (flags & NETLOGON_FLAG_STRONGKEY) {
return uncrypt_sequence_strong(session_key, checksum, enc_seq, is_server);
@@ -7795,6 +7799,7 @@ static guint64 uncrypt_sequence(guint32 flags, guint8* session_key,guint64 check
return 0;
}
+#if GCRYPT_VERSION_NUMBER >= 0x010800 /* 1.8.0 */
static gcry_error_t prepare_decryption_cipher_aes(netlogon_auth_vars *vars,
gcry_cipher_hd_t *_cipher_hd)
{
@@ -7833,6 +7838,7 @@ static gcry_error_t prepare_decryption_cipher_aes(netlogon_auth_vars *vars,
*_cipher_hd = cipher_hd;
return 0;
}
+#endif
static gcry_error_t prepare_decryption_cipher_strong(netlogon_auth_vars *vars,
gcry_cipher_hd_t *_cipher_hd)
@@ -7879,9 +7885,11 @@ static gcry_error_t prepare_decryption_cipher(netlogon_auth_vars *vars,
{
*_cipher_hd = NULL;
+#if GCRYPT_VERSION_NUMBER >= 0x010800 /* 1.8.0 */
if (vars->flags & NETLOGON_FLAG_AES) {
return prepare_decryption_cipher_aes(vars, _cipher_hd);
}
+#endif
if (vars->flags & NETLOGON_FLAG_STRONGKEY) {
return prepare_decryption_cipher_strong(vars, _cipher_hd);