diff options
author | Erik de Jong <erikdejong@gmail.com> | 2017-02-13 19:31:26 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2017-03-02 23:58:05 +0000 |
commit | f1c75cf6ef7e9f9de1ec7fd798df941b972ec71c (patch) | |
tree | 7d7c2f66bf7595e010026d6f4d3b3a53175af824 /editcap.c | |
parent | 4bd3c4d44ddcdf8e98fdf08a425e3a68e9b18395 (diff) |
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 'editcap.c')
-rw-r--r-- | editcap.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -80,7 +80,7 @@ #include <wsutil/cmdarg_err.h> #include <wsutil/filesystem.h> #include <wsutil/file_util.h> -#include <wsutil/md5.h> +#include <wsutil/wsgcrypt.h> #include <wsutil/plugins.h> #include <wsutil/privileges.h> #include <wsutil/report_err.h> @@ -113,7 +113,7 @@ struct select_item { * Duplicate frame detection */ typedef struct _fd_hash_t { - md5_byte_t digest[16]; + guint8 digest[16]; guint32 len; nstime_t frame_time; } fd_hash_t; @@ -587,7 +587,6 @@ remove_vlan_info(const struct wtap_pkthdr *phdr, guint8* fd, guint32* len) { static gboolean is_duplicate(guint8* fd, guint32 len) { int i; - md5_state_t ms; /*Hint to ignore some bytes at the start of the frame for the digest calculation(-I option) */ guint32 offset = ignored_bytes; @@ -606,9 +605,7 @@ is_duplicate(guint8* fd, guint32 len) { cur_dup_entry = 0; /* Calculate our digest */ - md5_init(&ms); - md5_append(&ms, new_fd, new_len); - md5_finish(&ms, fd_hash[cur_dup_entry].digest); + gcry_md_hash_buffer(GCRY_MD_MD5, fd_hash[cur_dup_entry].digest, new_fd, new_len); fd_hash[cur_dup_entry].len = len; @@ -629,7 +626,6 @@ is_duplicate(guint8* fd, guint32 len) { static gboolean is_duplicate_rel_time(guint8* fd, guint32 len, const nstime_t *current) { int i; - md5_state_t ms; /*Hint to ignore some bytes at the start of the frame for the digest calculation(-I option) */ guint32 offset = ignored_bytes; @@ -648,9 +644,7 @@ is_duplicate_rel_time(guint8* fd, guint32 len, const nstime_t *current) { cur_dup_entry = 0; /* Calculate our digest */ - md5_init(&ms); - md5_append(&ms, new_fd, new_len); - md5_finish(&ms, fd_hash[cur_dup_entry].digest); + gcry_md_hash_buffer(GCRY_MD_MD5, fd_hash[cur_dup_entry].digest, new_fd, new_len); fd_hash[cur_dup_entry].len = len; fd_hash[cur_dup_entry].frame_time.secs = current->secs; |