summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-frame.c
diff options
context:
space:
mode:
authorErik de Jong <erikdejong@gmail.com>2017-02-13 19:31:26 +0100
committerPeter Wu <peter@lekensteyn.nl>2017-03-02 23:58:05 +0000
commitf1c75cf6ef7e9f9de1ec7fd798df941b972ec71c (patch)
tree7d7c2f66bf7595e010026d6f4d3b3a53175af824 /epan/dissectors/packet-frame.c
parent4bd3c4d44ddcdf8e98fdf08a425e3a68e9b18395 (diff)
downloadwireshark-f1c75cf6ef7e9f9de1ec7fd798df941b972ec71c.tar.gz
Rewrite dissectors to use Libgcrypt functions.
As discussed on the mailinglist, rewriting dissectors to use Libgcrypt functions as Libgcrypt will be mandatory after change 20030. Removal of following functions: - crypt_md4 - crypt_rc4* - aes_cmac_encrypt_* - md5_* - sha1_* - sha256_* Further candidates: - aes_* - rijndael_* - ... Added functions: - ws_hmac_buffer Added const macros: - HASH_MD5_LENGTH - HASH_SHA1_LENGTH Changes on epan/crypt/* verified with captures from https://wiki.wireshark.org/HowToDecrypt802.11 Changes on packet-snmp.c and packet-radius.c verified with captures from https://wiki.wireshark.org/SampleCapture Changes on packet-tacacs.c verified with capture from http://ccie-in-3-months.blogspot.nl/2009/04/decoding-login-credentials-regardless.html Change-Id: Iea6ba2bf207cf0f1bf2117068fb1abcfeaafaa46 Link: https://www.wireshark.org/lists/wireshark-dev/201702/msg00011.html Reviewed-on: https://code.wireshark.org/review/20095 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r--epan/dissectors/packet-frame.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index b4f17367b4..aa9d1f443a 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -38,7 +38,7 @@
#include <wiretap/wtap.h>
#include <epan/tap.h>
#include <epan/expert.h>
-#include <wsutil/md5.h>
+#include <wsutil/wsgcrypt.h>
#include <wsutil/str_util.h>
#include <wmem/wmem.h>
@@ -453,17 +453,13 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
if (generate_md5_hash) {
const guint8 *cp;
- md5_state_t md_ctx;
- md5_byte_t digest[16];
+ guint8 digest[HASH_MD5_LENGTH];
const gchar *digest_string;
cp = tvb_get_ptr(tvb, 0, cap_len);
- md5_init(&md_ctx);
- md5_append(&md_ctx, cp, cap_len);
- md5_finish(&md_ctx, digest);
-
- digest_string = bytestring_to_str(wmem_packet_scope(), digest, 16, '\0');
+ gcry_md_hash_buffer(GCRY_MD_MD5, digest, cp, cap_len);
+ digest_string = bytestring_to_str(wmem_packet_scope(), digest, HASH_MD5_LENGTH, '\0');
ti = proto_tree_add_string(fh_tree, hf_frame_md5_hash, tvb, 0, 0, digest_string);
PROTO_ITEM_SET_GENERATED(ti);
}