diff options
author | Robert Sauter <sauter@locoslab.com> | 2018-03-28 22:49:58 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-03-30 07:29:03 +0000 |
commit | a67082d35438cd02cf5d75b0c1e8c7410c580ec9 (patch) | |
tree | 24e6d7b16fb94809aa3a3c253e3881556ee556c0 /epan/dissectors/packet-ieee802154.h | |
parent | afede5f8677cb4d580d81910c767cc5e6c58e442 (diff) |
IEEE 802.15.4: fix decryption results based on uninitialized data
Refactor ieee802154_set_mac_key to return the number of keys set and
only try to decrypt with the alt_key if actually provided
Bug: 14522
Change-Id: I40802dff8c08f7f82b792fb16f5f91aa3b9e20cc
Reviewed-on: https://code.wireshark.org/review/26677
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ieee802154.h')
-rw-r--r-- | epan/dissectors/packet-ieee802154.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ieee802154.h b/epan/dissectors/packet-ieee802154.h index 43be02d328..5d828c370f 100644 --- a/epan/dissectors/packet-ieee802154.h +++ b/epan/dissectors/packet-ieee802154.h @@ -542,19 +542,19 @@ typedef struct { ieee802154_decrypt_status* status; } ieee802154_decrypt_info_t; -/** Fill key and alt_key based on the provided information from the frame and an IEEE 802.15.4 preference table entry */ -typedef gboolean (*ieee802154_set_key_func) (ieee802154_packet * packet, unsigned char* key, unsigned char* alt_key, ieee802154_key_t* key_info); +/** Fill key and alt_key based on the provided information from the frame and an IEEE 802.15.4 preference table entry + * and return the number of keys set (0: none, 1: just key, 2: key and alt_key) */ +typedef guint (*ieee802154_set_key_func) (ieee802154_packet *packet, unsigned char *key, unsigned char *alt_key, ieee802154_key_t *uat_key); /** Decrypt the payload with the provided information */ typedef tvbuff_t* (*ieee802154_decrypt_func) (tvbuff_t *, guint, packet_info *, ieee802154_packet *, ieee802154_decrypt_info_t*); /** Loop over the keys specified in the IEEE 802.15.4 preferences, try to use them with the specified set_key_func * and try to decrypt with the specified decrypt_func */ -tvbuff_t *decrypt_ieee802154_payload(tvbuff_t * tvb, guint offset, packet_info * pinfo, proto_tree* key_tree, ieee802154_packet * packet, - ieee802154_decrypt_info_t* decrypt_info, ieee802154_set_key_func set_key_func, ieee802154_decrypt_func decrypt_func); +tvbuff_t *decrypt_ieee802154_payload(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *key_tree, ieee802154_packet *packet, + ieee802154_decrypt_info_t *decrypt_info, ieee802154_set_key_func set_key_func, ieee802154_decrypt_func decrypt_func); -typedef gboolean (*ieee802154_set_mac_key_func) (ieee802154_packet * packet, unsigned char* key, unsigned char* alt_key, ieee802154_key_t* uat_key); -extern void register_ieee802154_mac_key_hash_handler(guint hash_identifier, ieee802154_set_mac_key_func key_func); +extern void register_ieee802154_mac_key_hash_handler(guint hash_identifier, ieee802154_set_key_func key_func); /* Short to Extended Address Prototypes */ extern ieee802154_map_rec *ieee802154_addr_update(ieee802154_map_tab_t *, guint16, guint16, guint64, |