wireshark/epan/dissectors/packet-ipsec.h
Martin Mathieson 266e0a9275 Add an API for programmatically adding ESP SAs (most likely from a private
dissector).

Also, speed up ESP decryption in several ways:
- store gcrypt_cipher_hd in the SA struct, rather than continually
open, setkey and close for each PDU
- don't convert the key string from ascii to hex each time - do it upon
during update callback and keep
- do the decryption in-place, avoiding the need to allocate, memcpy and
free a separate buffer for encrypted data
- when matching addresses, avoid doing a strlen until after we check
whether or not we're matching against "*"

Change-Id: Ibb66663ec21326351abc761be78a0d57f7797fa5
Reviewed-on: https://code.wireshark.org/review/1421
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-30 05:01:12 +00:00

37 lines
1.6 KiB
C

/* packet-ipsec.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
*
* 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.
*/
#ifndef __PACKET_IPSEC_H__
#define __PACKET_IPSEC_H__
/* Configure a new SA (programmatically, most likely from a private dissector).
The arugments here are deliberately in the same string formats as the UAT fields
in order to keep code paths common.
Note that an attempt to match with these entries will be made *before* entries
added through the UAT entry interface/file. */
WS_DLL_PUBLIC void esp_sa_record_add_from_dissector(guint8 protocol, const gchar *srcIP, const char *dstIP,
gchar *spi,
guint8 encryption_algo, const gchar *encryption_key,
guint8 authentication_algo, const gchar *authentication_key);
#endif