Don't use frame_length at all if we don't have libgcrypt >= 1.6.0 and encryption keys.

Change-Id: Ia82fa67bbb9056204ed70b150f3d1e6db9ceed25
Reviewed-on: https://code.wireshark.org/review/22116
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Guy Harris 2017-06-13 14:11:02 -07:00 committed by Michael Mann
parent f3267f17a3
commit 9c86ec08aa
1 changed files with 1 additions and 2 deletions

View File

@ -654,7 +654,6 @@ dissect_lorawan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *d
guint8 fport;
guint32 dev_address;
guint32 fcnt;
gint frame_length;
gboolean uplink = TRUE;
device_encryption_keys_t *encryption_keys = NULL;
@ -820,9 +819,9 @@ dissect_lorawan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *d
* MIC = cmac[0..3]
* B0 = 0x49 | 0x00 | 0x00 | 0x00 | 0x00 | dir | devAddr | fcntup/fcntdown | len(msg)
*/
frame_length = current_offset;
#if GCRYPT_VERSION_NUMBER >= 0x010600 /* 1.6.0 */
if (encryption_keys) {
gint frame_length = current_offset;
guint8 *msg = (guint8 *)wmem_alloc0(wmem_packet_scope(), frame_length + 16);
msg[0] = 0x49;
msg[5] = uplink ? 0 : 1;