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 /wsutil/sha1.h | |
parent | 4bd3c4d44ddcdf8e98fdf08a425e3a68e9b18395 (diff) | |
download | wireshark-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 'wsutil/sha1.h')
-rw-r--r-- | wsutil/sha1.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/wsutil/sha1.h b/wsutil/sha1.h deleted file mode 100644 index 52a9842d57..0000000000 --- a/wsutil/sha1.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * FIPS-180-1 compliant SHA-1 implementation - * - * Copyright (C) 2001-2003 Christophe Devine - * Copyright (C) 2012 Chris Elston, Katalix Systems Ltd <celston@katalix.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Changed to use guint instead of uint 2004 by Anders Broman - * Original code found at http://www.cr0.net:8040/code/crypto/sha1/ - * References: http://www.ietf.org/rfc/rfc3174.txt?number=3174 - * - * 2012-08-21 - C Elston - Split sha1_hmac function to allow incremental usage. - */ - -#ifndef _SHA1_H -#define _SHA1_H - -#include "ws_symbol_export.h" - -/* - * Length of a SHA-1 digest, in bytes. 160 bits = 20 bytes. - */ -#define SHA1_DIGEST_LEN 20 - -typedef struct -{ - guint32 total[2]; - guint32 state[5]; - guint8 buffer[64]; -} -sha1_context; - -WS_DLL_PUBLIC -void sha1_starts( sha1_context *ctx ); -WS_DLL_PUBLIC -void sha1_update( sha1_context *ctx, const guint8 *input, guint32 length ); -WS_DLL_PUBLIC -void sha1_finish( sha1_context *ctx, guint8 digest[SHA1_DIGEST_LEN] ); - -typedef struct { - sha1_context ctx; - guint8 k_opad[64]; -} -sha1_hmac_context; - -WS_DLL_PUBLIC -void sha1_hmac_starts( sha1_hmac_context *hctx, const guint8 *key, guint32 keylen ); -WS_DLL_PUBLIC -void sha1_hmac_update( sha1_hmac_context *hctx, const guint8 *buf, guint32 buflen ); -WS_DLL_PUBLIC -void sha1_hmac_finish( sha1_hmac_context *hctx, guint8 digest[SHA1_DIGEST_LEN] ); -WS_DLL_PUBLIC -void sha1_hmac( const guint8 *key, guint32 keylen, const guint8 *buf, guint32 buflen, - guint8 digest[SHA1_DIGEST_LEN] ); - -#endif /* sha1.h */ |