wireshark/epan/crypt/eax.h
Jörg Mayer 6197143d6c Ed Beroset <beroset@mindspring.com> via bug 5531
The ANSI C12.22 protocol is a smart grid protocol for utility meters, including
gas, water and electric.  The dissector implemented in the patch file includes
full support for all EPSEM (Extended Protocol Specification for Electricity
Metering) services and includes a full implementation of the C12.22 security
modes.

[...]

To decrypt the attached sample file, you need to set up the key table in the
preferences to include key 0 with a value of 6624C7E23034E4036FE5CB3A8B5DAB44.

Me: Fixes for:

[ 64%] Building C object epan/CMakeFiles/epan.dir/dissectors/packet-c1222.c.o            
../../asn1/c1222/packet-c1222-template.c: In function ‘dissect_epsem’:                   
../../asn1/c1222/packet-c1222-template.c:860:15: error: variable ‘ft’ set but not used [-Werror=unused-but-set-variable]

[  5%] Building C object epan/CMakeFiles/epan.dir/dissectors/packet-c1222.c.o
../../asn1/c1222/packet-c1222-template.c:103:19: error: ‘c1222_flags’ defined but not used [-Werror=unused-variable]



svn path=/trunk/; revision=40500
2012-01-14 15:22:10 +00:00

58 lines
2 KiB
C

/* eax.h
* Encryption and decryption routines implementing the EAX' encryption mode
* Copyright 2010, Edward J. Beroset, edward.j.beroset@us.elster.com
*
* $Id$
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib.h>
typedef struct tagMAC_T
{
guint8 Mac[4];
} MAC_T;
#define EAX_MODE_CLEARTEXT_AUTH 1
#define EAX_MODE_CIPHERTEXT_AUTH 2
#define EAX_SIZEOF_KEY 16
/*!
Decrypts cleartext data using EAX' mode (see ANSI Standard C12.22-2008).
@param[in] pN pointer to cleartext (canonified form)
@param[in] pK pointer to secret key
@param[in,out] pC pointer to ciphertext
@param[in] SizeN byte length of cleartext (pN) buffer
@param[in] SizeK byte length of secret key (pK)
@param[in] SizeC byte length of ciphertext (pC) buffer
@param[in] pMac four-byte Message Authentication Code
@param[in] Mode EAX_MODE_CLEARTEXT_AUTH or EAX_MODE_CIPHERTEXT_AUTH
@return TRUE if message has been authenticated; FALSE if not
authenticated, invalid Mode or error
*/
gboolean Eax_Decrypt(guint8 *pN, guint8 *pK, guint8 *pC,
guint32 SizeN, guint32 SizeK, guint32 SizeC, MAC_T *pMac,
guint8 Mode);