This means wsutil now links against libcrypt.
Protect a bunch of the crypt header files from multiple inclusion.
svn path=/trunk/; revision=51100
)
set(editcap_FILES
editcap.c
- epan/crypt/md5.c
${WTAP_PLUGIN_SOURCES}
)
add_executable(editcap ${editcap_FILES})
# editcap specifics
editcap_SOURCES = \
editcap.c \
- epan/crypt/md5.c \
$(WTAP_PLUGIN_SOURCES)
# reordercap specifics
#include "config.h"
#include <glib.h>
+
+#include <wsutil/eax.h>
+
#include <epan/conversation.h>
#include <epan/expert.h>
#include <epan/packet.h>
#include <epan/dissectors/packet-ber.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/uat.h>
-#include <epan/crypt/eax.h>
#include <stdio.h>
#include <string.h>
*offset += 2;
*length -= 2;
tblsize -= 2;
- }
+ }
proto_tree_add_item(tree, hf_c1222_write_data, tvb, *offset, tblsize, ENC_NA);
*offset += tblsize;
*length -= tblsize;
#include "config.h"
#include <glib.h>
+
+#include <wsutil/sha1.h>
+#include <wsutil/md5.h>
+
#include <epan/packet.h>
#include <epan/oids.h>
#include <epan/asn1.h>
#include "packet-x509sat.h"
#include "packet-pkcs12.h"
-#include <epan/crypt/sha1.h>
-#include <epan/crypt/md5.h>
-
#define PNAME "Cryptographic Message Syntax"
#define PSNAME "CMS"
#define PFNAME "cms"
#include <nettle/des.h>
#include <nettle/cbc.h>
#endif
-#include <epan/crypt/md5.h>
+#include <wsutil/md5.h>
#include <sys/stat.h> /* For keyfile manipulation */
#endif
#include <glib.h>
+#include <wsutil/sha1.h>
+#include <wsutil/md5.h>
+
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/conversation.h>
#include <epan/asn1.h>
#include "packet-ipx.h"
#include "packet-hpext.h"
-
+#include <epan/expert.h>
+#include <epan/oids.h>
#include "packet-ber.h"
#include "packet-snmp.h"
-#include <epan/crypt/sha1.h>
-#include <epan/crypt/md5.h>
-#include <epan/expert.h>
-#include <epan/oids.h>
-
-
#ifdef HAVE_LIBGCRYPT
#include <wsutil/wsgcrypt.h>
#endif
#include "config.h"
#include <glib.h>
+
+#include <wsutil/rc4.h>
+
#include <epan/packet.h>
#include <epan/asn1.h>
#include "packet-dcerpc.h"
#include "packet-gssapi.h"
#include "packet-kerberos.h"
-#include <epan/crypt/rc4.h>
#include <epan/conversation.h>
#include <epan/wmem/wmem.h>
#include <epan/asn1.h>
#include <wsutil/privileges.h>
#include <wsutil/report_err.h>
#include <wsutil/strnatcmp.h>
+#include <wsutil/md5.h>
/*
* The symbols declared in the below are exported from libwireshark,
*/
#define WS_BUILD_DLL
#define RESET_SYMBOL_EXPORT /* wsutil/wsgetopt.h set export behavior above. */
-#include "epan/crypt/md5.h"
#include "epan/plugins.h"
#include "epan/filesystem.h"
#undef WS_BUILD_DLL
crypt/airpdcap_debug.c
crypt/airpdcap_rijndael.c
crypt/airpdcap_tkip.c
- crypt/aes.c
- crypt/des.c
- crypt/eax.c
- crypt/md4.c
- crypt/md5.c
- crypt/rc4.c
- crypt/sha1.c
)
set(DFILTER_FILES
packet.h \
packet_info.h \
params.h \
- pint.h \
plugins.h \
ppptypes.h \
print.h \
#include "to_str.h"
#include "value_string.h"
#include "addr_resolv.h"
-#include "pint.h"
+#include "wsutil/pint.h"
#include "atalk-utils.h"
#include "sna-utils.h"
#include "osi-utils.h"
best.base = -1;
/* Is this address an encapsulated IPv4? */
- /* XXX,
+ /* XXX,
* Orginal code dated 1996 uses ::/96 as a valid IPv4-compatible addresses
* but since Feb 2006 ::/96 is deprecated one.
* Quoting wikipedia [0]:
- * > The 96-bit zero-value prefix ::/96, originally known as IPv4-compatible
- * > addresses, was mentioned in 1995[35] but first described in 1998.[41]
- * > This class of addresses was used to represent IPv4 addresses within
- * > an IPv6 transition technology. Such an IPv6 address has its first
- * > (most significant) 96 bits set to zero, while its last 32 bits are the
- * > IPv4 address that is represented.
- * > In February 2006 the Internet Engineering Task Force (IETF) has deprecated
- * > the use of IPv4-compatible addresses.[1] The only remaining use of this address
- * > format is to represent an IPv4 address in a table or database with fixed size
+ * > The 96-bit zero-value prefix ::/96, originally known as IPv4-compatible
+ * > addresses, was mentioned in 1995[35] but first described in 1998.[41]
+ * > This class of addresses was used to represent IPv4 addresses within
+ * > an IPv6 transition technology. Such an IPv6 address has its first
+ * > (most significant) 96 bits set to zero, while its last 32 bits are the
+ * > IPv4 address that is represented.
+ * > In February 2006 the Internet Engineering Task Force (IETF) has deprecated
+ * > the use of IPv4-compatible addresses.[1] The only remaining use of this address
+ * > format is to represent an IPv4 address in a table or database with fixed size
* > members that must also be able to store an IPv6 address.
*
* If needed it can be fixed by changing next line:
/* Copy and convert the address to network byte order. */
*(guint64 *)(void *)(p_eui64) = pntoh64(&(ad));
- g_snprintf(buf, EUI64_STR_LEN, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
+ g_snprintf(buf, EUI64_STR_LEN, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
p_eui64[0], p_eui64[1], p_eui64[2], p_eui64[3],
p_eui64[4], p_eui64[5], p_eui64[6], p_eui64[7] );
return buf;
#define PREAMBLE_STR_LEN ((int)(sizeof("GID: ") - 1))
g_snprintf(buf,buf_len,"GID: ");
if (buf_len < PREAMBLE_STR_LEN ||
- inet_ntop(AF_INET6, addr->data, buf + PREAMBLE_STR_LEN,
+ inet_ntop(AF_INET6, addr->data, buf + PREAMBLE_STR_LEN,
buf_len - PREAMBLE_STR_LEN) == NULL ) /* Returns NULL if no space and does not touch buf */
g_snprintf ( buf, buf_len, BUF_TOO_SMALL_ERR ); /* Let the unexpected value alert user */
} else { /* this is a LID (16 bits) */
guint16 lid_number;
-
+
memcpy((void *)&lid_number, addr->data, sizeof lid_number);
g_snprintf(buf,buf_len,"LID: %u",lid_number);
}
g_snprintf(buf, buf_len, "Broadcast");
else
g_snprintf(buf, buf_len, "0x%04x", ieee_802_15_4_short_addr);
- break;
+ break;
default:
g_assert_not_reached();
}
#include "atalk-utils.h"
#include "to_str.h"
#include "packet_info.h"
-#include "pint.h"
+#include "wsutil/pint.h"
#include "addr_resolv.h"
#include "ipv6-utils.h"
#include "osi-utils.h"
AM_CPPFLAGS = \
-I$(top_srcdir)
- $(LIBGCRYPT_CFLAGS)
noinst_LTLIBRARIES = libairpdcap.la
include Custom.common
LIBAIRPDCAP_SRC = \
- aes.c \
airpdcap.c \
airpdcap_ccmp.c \
airpdcap_debug.c \
airpdcap_rijndael.c \
airpdcap_tkip.c \
- des.c \
- eax.c \
- md4.c \
- md5.c \
- rc4.c \
- sha1.c \
$(CUSTOM_CRYPTO_SRC)
LIBAIRPDCAP_INCLUDES = \
- aes.h \
airpdcap_debug.h \
airpdcap_interop.h \
airpdcap_int.h \
airpdcap_system.h \
airpdcap_user.h \
airpdcap_ws.h \
- des.h \
kasumi.h \
- md4.h \
- md5.h \
- rc4.h \
- sha1.h \
- eax.h \
wep-wpadefs.h
#include "config.h"
-#include <epan/tvbuff.h>
+#include <glib.h>
+
#include <wsutil/crc32.h>
+#include <wsutil/rc4.h>
+#include <wsutil/sha1.h>
+#include <wsutil/md5.h>
+#include <wsutil/pint.h>
+
+#include <epan/tvbuff.h>
#include <epan/strutil.h>
#include <epan/emem.h>
-#include <epan/pint.h>
-#include <epan/crypt/rc4.h>
#include <epan/crypt/airpdcap_rijndael.h>
#include "airpdcap_system.h"
#include "airpdcap_int.h"
-#include "sha1.h"
-#include "md5.h"
-
#include "airpdcap_debug.h"
#include "wep-wpadefs.h"
#include "airpdcap_debug.h"
#include <glib.h>
-#include "aes.h"
+#include <wsutil/aes.h>
/****************************************************************************/
/* Internal definitions */
#include "airpdcap_debug.h"
#include <glib.h>
-#include "aes.h"
+#include <wsutil/aes.h>
/* Based on RFC 3394 and NIST AES Key Wrap Specification pseudo-code.
/******************************************************************************/
/* File includes */
/* */
-#include <epan/pint.h>
+#include <wsutil/pint.h>
#include <wsutil/crc32.h>
#include "airpdcap_system.h"
#include "airpdcap_int.h"
}
#if 0
-#include <epan/crypt/md5.h>
+#include <wsutil/md5.h>
static gboolean
verify_password(tvbuff_t *tvb, const char *password)
#include "config.h"
#include <glib.h>
+
+#include <wsutil/eax.h>
+
#include <epan/conversation.h>
#include <epan/expert.h>
#include <epan/packet.h>
#include <epan/dissectors/packet-ber.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/uat.h>
-#include <epan/crypt/eax.h>
#include <stdio.h>
#include <string.h>
static int hf_c1222_c1221_auth_response = -1; /* OCTET_STRING_SIZE_CONSTR002 */
/*--- End of included file: packet-c1222-hf.c ---*/
-#line 91 "../../asn1/c1222/packet-c1222-template.c"
+#line 93 "../../asn1/c1222/packet-c1222-template.c"
/* These are the EPSEM pieces */
/* first, the flag components */
static int hf_c1222_epsem_flags = -1;
static gint ett_c1222_Calling_authentication_value_c1221_U = -1;
/*--- End of included file: packet-c1222-ett.c ---*/
-#line 184 "../../asn1/c1222/packet-c1222-template.c"
+#line 186 "../../asn1/c1222/packet-c1222-template.c"
static expert_field ei_c1222_command_truncated = EI_INIT;
static expert_field ei_c1222_bad_checksum = EI_INIT;
*offset += 2;
*length -= 2;
tblsize -= 2;
- }
+ }
proto_tree_add_item(tree, hf_c1222_write_data, tvb, *offset, tblsize, ENC_NA);
*offset += tblsize;
*length -= tblsize;
proto_item *tf = NULL;
proto_tree *epsem_tree = NULL;
FILL_START;
-
+
/* get Tag and Length */
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &end_device_class, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
/*--- End of included file: packet-c1222-fn.c ---*/
-#line 1017 "../../asn1/c1222/packet-c1222-template.c"
+#line 1019 "../../asn1/c1222/packet-c1222-template.c"
/**
* Dissects a a full (reassembled) C12.22 message.
"OCTET_STRING_SIZE_CONSTR002", HFILL }},
/*--- End of included file: packet-c1222-hfarr.c ---*/
-#line 1299 "../../asn1/c1222/packet-c1222-template.c"
+#line 1301 "../../asn1/c1222/packet-c1222-template.c"
};
/* List of subtrees */
&ett_c1222_Calling_authentication_value_c1221_U,
/*--- End of included file: packet-c1222-ettarr.c ---*/
-#line 1309 "../../asn1/c1222/packet-c1222-template.c"
+#line 1311 "../../asn1/c1222/packet-c1222-template.c"
};
static ei_register_info ei[] = {
#include "config.h"
#include <glib.h>
+
+#include <wsutil/sha1.h>
+#include <wsutil/md5.h>
+
#include <epan/packet.h>
#include <epan/oids.h>
#include <epan/asn1.h>
#include "packet-x509sat.h"
#include "packet-pkcs12.h"
-#include <epan/crypt/sha1.h>
-#include <epan/crypt/md5.h>
-
#define PNAME "Cryptographic Message Syntax"
#define PSNAME "CMS"
#define PFNAME "cms"
static int hf_cms_extensions = -1; /* Extensions */
/*--- End of included file: packet-cms-hf.c ---*/
-#line 55 "../../asn1/cms/packet-cms-template.c"
+#line 56 "../../asn1/cms/packet-cms-template.c"
/* Initialize the subtree pointers */
static gint ett_cms_SEQUENCE_OF_Attribute = -1;
/*--- End of included file: packet-cms-ett.c ---*/
-#line 58 "../../asn1/cms/packet-cms-template.c"
+#line 59 "../../asn1/cms/packet-cms-template.c"
static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
-
+
pi = actx->created_item;
/* move past TLV */
/*--- End of included file: packet-cms-fn.c ---*/
-#line 136 "../../asn1/cms/packet-cms-template.c"
+#line 137 "../../asn1/cms/packet-cms-template.c"
/*--- proto_register_cms ----------------------------------------------*/
void proto_register_cms(void) {
NULL, HFILL }},
/*--- End of included file: packet-cms-hfarr.c ---*/
-#line 147 "../../asn1/cms/packet-cms-template.c"
+#line 148 "../../asn1/cms/packet-cms-template.c"
};
/* List of subtrees */
&ett_cms_SEQUENCE_OF_Attribute,
/*--- End of included file: packet-cms-ettarr.c ---*/
-#line 152 "../../asn1/cms/packet-cms-template.c"
+#line 153 "../../asn1/cms/packet-cms-template.c"
};
/* Register protocol */
/*--- End of included file: packet-cms-dis-tab.c ---*/
-#line 174 "../../asn1/cms/packet-cms-template.c"
+#line 175 "../../asn1/cms/packet-cms-template.c"
oid_add_from_string("id-data","1.2.840.113549.1.7.1");
oid_add_from_string("id-alg-des-ede3-cbc","1.2.840.113549.3.7");
#include "config.h"
+#include <glib.h>
+
+#include <wsutil/md5.h>
+
#include <epan/packet.h>
#include <epan/prefs.h>
-#include <epan/crypt/md5.h>
#include "packet-data.h"
/* proto_data cannot be static because it's referenced in the
#include <glib.h>
#include <string.h>
+
+#include <wsutil/rc4.h>
+#include <wsutil/md4.h>
+#include <wsutil/md5.h>
+#include <wsutil/des.h>
+
#include <epan/packet.h>
/* for dissect_mscldap_string */
#include "packet-ldap.h"
#include <epan/asn1.h>
#include "packet-kerberos.h"
/* for decoding */
-#include <epan/crypt/rc4.h>
-#include <epan/crypt/md4.h>
-#include <epan/crypt/md5.h>
-#include <epan/crypt/des.h>
extern const char *gbl_nt_password;
#ifdef DEBUG_NETLOGON
#endif
#include <glib.h>
+
+#include <wsutil/md5.h>
+
#include <epan/packet.h>
#include <epan/show_exception.h>
#include <epan/timestamp.h>
#include <epan/prefs.h>
#include <epan/tap.h>
#include <epan/expert.h>
-#include <epan/crypt/md5.h>
#include "packet-frame.h"
static int hf_frame_pack_symbol_error = -1;
static int hf_frame_wtap_encap = -1;
static int hf_comments_text = -1;
-static int hf_frame_num_p_prot_data = -1;
+static int hf_frame_num_p_prot_data = -1;
static gint ett_frame = -1;
static gint ett_flags = -1;
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
};
-
+
static hf_register_info hf_encap =
{ &hf_frame_wtap_encap,
{ "Encapsulation type", "frame.encap_type",
FT_INT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }};
-
+
static gint *ett[] = {
&ett_frame,
&ett_flags,
int encap_count = wtap_get_num_encap_types();
value_string *arr;
int i;
-
- hf_encap.hfinfo.strings = arr = g_new(value_string, encap_count+1);
-
+
+ hf_encap.hfinfo.strings = arr = g_new(value_string, encap_count+1);
+
for (i = 0; i < encap_count; i++) {
arr[i].value = i;
arr[i].strptr = wtap_encap_string(i);
#include <stddef.h>
#include <errno.h>
#include <glib.h>
-#include "pint.h"
+#include <wsutil/pint.h>
#define le16_to_cpu GINT16_FROM_LE
#define le32_to_cpu GINT32_FROM_LE
#include <nettle/des.h>
#include <nettle/cbc.h>
#endif
-#include <epan/crypt/md5.h>
+#include <wsutil/md5.h>
#include <sys/stat.h> /* For keyfile manipulation */
#endif
#include <glib.h>
+#include <wsutil/md5.h>
+#include <wsutil/sha1.h>
+
#include <epan/packet.h>
#include <epan/addr_resolv.h>
#include <epan/ipproto.h>
#include <epan/sminmpec.h>
#include <epan/prefs.h>
#include <epan/conversation.h>
-#include <epan/crypt/md5.h>
-#include <epan/crypt/sha1.h>
#include <epan/expert.h>
#include <epan/proto.h>
#include <ctype.h>
#include <glib.h>
+
+#include <wsutil/rc4.h>
+#include <wsutil/md4.h>
+#include <wsutil/md5.h>
+#include <wsutil/des.h>
+#include <wsutil/crc32.h>
+
#include <epan/packet.h>
#include <epan/asn1.h>
#include <epan/prefs.h>
#include <epan/tap.h>
#include <epan/expert.h>
#include <epan/show_exception.h>
-#include <epan/crypt/rc4.h>
-#include <epan/crypt/md4.h>
-#include <epan/crypt/md5.h>
-#include <epan/crypt/des.h>
#include "packet-windows-common.h"
#include "packet-smb-common.h"
#include "packet-kerberos.h"
#include "packet-dcerpc.h"
#include "packet-gssapi.h"
-#include <wsutil/crc32.h>
#include "packet-ntlmssp.h"
#include <glib.h>
#include <wsutil/report_err.h>
+#include <wsutil/md5.h>
#include <epan/packet.h>
#include <epan/prefs.h>
-#include <epan/crypt/md5.h>
#include <epan/sminmpec.h>
#include <epan/filesystem.h>
#include <epan/conversation.h>
#include <glib.h>
+#include <wsutil/sha1.h>
+#include <wsutil/md5.h>
+
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/conversation.h>
#include <epan/asn1.h>
#include "packet-ipx.h"
#include "packet-hpext.h"
-
+#include <epan/expert.h>
+#include <epan/oids.h>
#include "packet-ber.h"
#include "packet-snmp.h"
-#include <epan/crypt/sha1.h>
-#include <epan/crypt/md5.h>
-#include <epan/expert.h>
-#include <epan/oids.h>
-
-
#ifdef HAVE_LIBGCRYPT
#include <wsutil/wsgcrypt.h>
#endif
static int hf_snmp_operation = -1; /* T_operation */
/*--- End of included file: packet-snmp-hf.c ---*/
-#line 238 "../../asn1/snmp/packet-snmp-template.c"
+#line 235 "../../asn1/snmp/packet-snmp-template.c"
static int hf_smux_version = -1;
static int hf_smux_pdutype = -1;
static gint ett_snmp_RReqPDU_U = -1;
/*--- End of included file: packet-snmp-ett.c ---*/
-#line 257 "../../asn1/snmp/packet-snmp-template.c"
+#line 254 "../../asn1/snmp/packet-snmp-template.c"
static expert_field ei_snmp_failed_decrypted_data_pdu = EI_INIT;
static expert_field ei_snmp_decrypted_data_bad_formatted = EI_INIT;
/*--- End of included file: packet-snmp-fn.c ---*/
-#line 1768 "../../asn1/snmp/packet-snmp-template.c"
+#line 1765 "../../asn1/snmp/packet-snmp-template.c"
guint
NULL, HFILL }},
/*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 2429 "../../asn1/snmp/packet-snmp-template.c"
+#line 2426 "../../asn1/snmp/packet-snmp-template.c"
};
/* List of subtrees */
&ett_snmp_RReqPDU_U,
/*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 2445 "../../asn1/snmp/packet-snmp-template.c"
+#line 2442 "../../asn1/snmp/packet-snmp-template.c"
};
static ei_register_info ei[] = {
{ &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }},
#include "config.h"
#include <glib.h>
+
+#include <wsutil/rc4.h>
+
#include <epan/packet.h>
#include <epan/asn1.h>
#include "packet-dcerpc.h"
#include "packet-gssapi.h"
#include "packet-kerberos.h"
-#include <epan/crypt/rc4.h>
#include <epan/conversation.h>
#include <epan/wmem/wmem.h>
#include <epan/asn1.h>
static int hf_spnego_ContextFlags_integFlag = -1;
/*--- End of included file: packet-spnego-hf.c ---*/
-#line 80 "../../asn1/spnego/packet-spnego-template.c"
+#line 82 "../../asn1/spnego/packet-spnego-template.c"
/* Global variables */
static const char *MechType_oid;
static gint ett_spnego_InitialContextToken_U = -1;
/*--- End of included file: packet-spnego-ett.c ---*/
-#line 94 "../../asn1/spnego/packet-spnego-template.c"
+#line 96 "../../asn1/spnego/packet-spnego-template.c"
/*
* Unfortunately, we have to have a forward declaration of this,
/*--- End of included file: packet-spnego-fn.c ---*/
-#line 105 "../../asn1/spnego/packet-spnego-template.c"
+#line 107 "../../asn1/spnego/packet-spnego-template.c"
/*
* This is the SPNEGO KRB5 dissector. It is not true KRB5, but some ASN.1
* wrapped blob with an OID, USHORT token ID, and a Ticket, that is also
NULL, HFILL }},
/*--- End of included file: packet-spnego-hfarr.c ---*/
-#line 1391 "../../asn1/spnego/packet-spnego-template.c"
+#line 1393 "../../asn1/spnego/packet-spnego-template.c"
};
/* List of subtrees */
&ett_spnego_InitialContextToken_U,
/*--- End of included file: packet-spnego-ettarr.c ---*/
-#line 1401 "../../asn1/spnego/packet-spnego-template.c"
+#line 1403 "../../asn1/spnego/packet-spnego-template.c"
};
/* Register protocol */
#endif
#include <glib.h>
-#include <epan/packet.h>
+#include <wsutil/md5.h>
+
+#include <epan/packet.h>
#include <epan/prefs.h>
-#include <epan/crypt/md5.h>
#include <epan/emem.h>
#include <epan/expert.h>
#include "packet-tacacs.h"
#include "wiretap/wtap.h"
#include "proto.h"
#include "tvbuff.h"
-#include "pint.h"
+#include "wsutil/pint.h"
#include "to_str.h"
#include "value_string.h"
#include "column_info.h"
#include <string.h>
#include <glib.h>
+#include <wsutil/sha1.h>
+#include <wsutil/crc16.h>
+
#include "packet.h"
#include "strutil.h"
#include "sigcomp-udvm.h"
#include "sigcomp_state_hdlr.h"
-#include "crypt/sha1.h"
-#include "wsutil/crc16.h"
#include "except.h"
#define SIGCOMP_INSTR_DECOMPRESSION_FAILURE 0
guint8 temp_data;
guint16 temp_data16;
guint16 memmory_addr = 0;
-
+
*value = 0;
bytecode = buff[operand_address];
#include <string.h>
#include "packet_info.h"
-#include "pint.h"
+#include "wsutil/pint.h"
#include "sna-utils.h"
#include "emem.h"
#include <string.h>
#include "tvbuff.h"
-#include "pint.h"
+#include "wsutil/pint.h"
gboolean failed = FALSE;
#include <zlib.h>
#endif
-#include "pint.h"
+#include "wsutil/pint.h"
#include "tvbuff.h"
#include "tvbuff-int.h"
#include "strutil.h"
tvb_free_internal(tvbuff_t *tvb)
{
gsize size;
-
+
DISSECTOR_ASSERT(tvb);
if (tvb->ops->tvb_free)
guint *offset_ptr, guint *length_ptr)
{
int exception;
-
+
exception = check_offset_length_no_exception(tvb, offset, length_val, offset_ptr, length_ptr);
if (exception)
THROW(exception);
{
if (tvb->ops->tvb_clone) {
tvbuff_t *cloned_tvb;
-
+
cloned_tvb = tvb->ops->tvb_clone(tvb, offset, len);
if (cloned_tvb)
return cloned_tvb;
#ifdef HAVE_GEOIP
#include <GeoIP.h>
#include <epan/geoip_db.h>
-#include <epan/pint.h>
+#include <wsutil/pint.h>
#include <epan/filesystem.h>
#endif
#include <wsutil/file_util.h>
#include <wsutil/g711.h>
#include <wsutil/tempfile.h>
+#include <wsutil/pint.h>
#include <epan/epan_dissect.h>
#include <epan/filesystem.h>
-#include <epan/pint.h>
#include <epan/tap.h>
#include <epan/tap-voip.h>
#include <epan/dissectors/packet-iax2.h>
#include <wsutil/file_util.h>
#include <wsutil/tempfile.h>
#include <wsutil/g711.h>
+#include <wsutil/pint.h>
#include <epan/epan_dissect.h>
#include <epan/filesystem.h>
-#include <epan/pint.h>
#include <epan/tap.h>
#include <epan/dissectors/packet-rtp.h>
#include <epan/rtp_pt.h>
# @INET_PTON_LO@ # inet_pton.c
# @STRNCASECMP_LO@ # strncasecmp.c
# @STRPTIME_LO@ # strptime.c
+ aes.c
airpdcap_wep.c
crash_info.c
crc10.c
crc8.c
crc11.c
crcdrm.c
+ des.c
+ eax.c
g711.c
+ md4.c
+ md5.c
mpeg-audio.c
nstime.c
privileges.c
+ sha1.c
strnatcmp.c
str_util.c
+ rc4.c
report_err.c
tempfile.c
type_util.c
set(wsutil_LIBS
${GLIB2_LIBRARIES}
+ ${GCRYPT_LIBRARIES}
)
set(CLEAN_FILES
if NEED_GETOPT_LO
wsutil_optional_objects += @GETOPT_LO@
endif
-
+
if NEED_INET_ATON_LO
wsutil_optional_objects += @INET_ATON_LO@
endif
-
+
if NEED_INET_NTOP_LO
wsutil_optional_objects += @INET_NTOP_LO@
endif
-
+
if NEED_INET_PTON_LO
wsutil_optional_objects += @INET_PTON_LO@
endif
libwsutil_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
AM_CPPFLAGS = -I$(srcdir)/..
+ $(LIBGCRYPT_CFLAGS)
libwsutil_la_SOURCES = \
$(LIBWSUTIL_SRC) \
libwsutil_la_LIBADD = \
@GLIB_LIBS@ \
+ @LIBGCRYPT_LIBS@ \
$(wsutil_optional_objects)
EXTRA_DIST = \
# generated from YACC or Lex files (as Automake doesn't want them in
# _SOURCES variables).
LIBWSUTIL_SRC = \
+ aes.c \
airpdcap_wep.c \
crash_info.c \
crc6.c \
crc16-plain.c \
crc32.c \
crcdrm.c \
+ des.c \
+ eax.c \
g711.c \
+ md4.c \
+ md5.c \
mpeg-audio.c \
nstime.c \
privileges.c \
+ sha1.c \
strnatcmp.c \
str_util.c \
+ rc4.c \
report_err.c \
tempfile.c \
type_util.c \
# Header files that are not generated from other files
LIBWSUTIL_INCLUDES = \
+ aes.h \
crash_info.h \
crc6.h \
crc7.h \
crc16-plain.h \
crc32.h \
crcdrm.h \
+ des.h \
+ eax.h \
g711.h \
+ md4.h \
+ md5.h \
mpeg-audio.h \
nstime.h \
privileges.h \
+ sha1.h \
strnatcmp.h \
str_util.h \
+ rc4.h \
report_err.h \
tempfile.h \
type_util.h \
#ifndef _AES
#define _AES
+#include "ws_symbol_export.h"
+
#define RIJNDAEL_MAXKC (256/32)
#define RIJNDAEL_MAXKB (256/8)
#define RIJNDAEL_MAXNR 14
} rijndael_ctx;
+WS_DLL_PUBLIC
void rijndael_set_key(
rijndael_ctx *ctx,
const guchar *key,
gint bits);
+WS_DLL_PUBLIC
void rijndael_encrypt(
const rijndael_ctx *ctx,
const guchar *src,
guchar *dst);
+WS_DLL_PUBLIC
void rijndael_decrypt(
const rijndael_ctx *ctx,
const guchar *src,
#include "config.h"
#include <glib.h>
-#include <epan/crypt/des.h>
+#include "des.h"
/* NOTES:
-/*
+/*
Unix SMB/CIFS implementation.
- a partial implementation of DES designed for use in the
+ a partial implementation of DES designed for use in the
SMB authentication protocol
Copyright (C) Andrew Tridgell 1998
$Id$
-
+
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 _DES_H
+#define _DES_H
+
+#include "ws_symbol_export.h"
+
+WS_DLL_PUBLIC
void crypt_des_ecb(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw);
+
+#endif
static eax_s instance;
/* these are defined as macros so they'll be easy to redo in assembly if desired */
-#define BLK_CPY(dst, src) { memcpy(dst, src, EAX_SIZEOF_KEY); }
+#define BLK_CPY(dst, src) { memcpy(dst, src, EAX_SIZEOF_KEY); }
#define BLK_XOR(dst, src) { int z; for (z=0; z < EAX_SIZEOF_KEY; z++) dst[z] ^= src[z]; }
static void Dbl(guint8 *out, const guint8 *in);
static void CTR(const guint8 *ws, guint8 *pK, guint8 *pN, guint16 SizeN);
@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] 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
+ @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,
+gboolean Eax_Decrypt(guint8 *pN, guint8 *pK, guint8 *pC,
+ guint32 SizeN, guint32 SizeK, guint32 SizeC, MAC_T *pMac,
guint8 Mode)
{
guint8 wsn[EAX_SIZEOF_KEY];
guint8 wsc[EAX_SIZEOF_KEY];
int i;
-
+
/* key size must match this implementation */
if (SizeK != EAX_SIZEOF_KEY)
return FALSE;
} else {
CMAC(pK, wsn, pN, SizeN);
}
- /*
- * In authentication mode the inputs are: pN, pK (and associated sizes),
+ /*
+ * In authentication mode the inputs are: pN, pK (and associated sizes),
* the result is the 4 byte MAC.
*/
if (Mode == EAX_MODE_CLEARTEXT_AUTH)
{
return (memcmp(pMac, &wsn[EAX_SIZEOF_KEY-sizeof(*pMac)], sizeof(*pMac)) ? FALSE : TRUE);
-
+
}
- /*
- * In cipher mode the inputs are: pN, pK, pP (and associated sizes),
+ /*
+ * In cipher mode the inputs are: pN, pK, pP (and associated sizes),
* the results are pC (and its size) along with the 4 byte MAC.
*/
else if (Mode == EAX_MODE_CIPHERTEXT_AUTH)
if (pC != NULL) {
memcpy(&work[SizeN], pC, SizeC);
}
- /*
+ /*
* pad the data if necessary, and XOR Q or D, depending on
- * whether data was padded or not
+ * whether data was padded or not
*/
if (worksize != SizeT) {
work[SizeT] = 0x80;
return;
}
-static void CTR(const guint8 *ws, guint8 *pK, guint8 *pN, guint16 SizeN)
+static void CTR(const guint8 *ws, guint8 *pK, guint8 *pN, guint16 SizeN)
{
gcry_cipher_hd_t cipher_hd;
guint8 ctr[EAX_SIZEOF_KEY];
return;
}
-void AesEncrypt(unsigned char msg[EAX_SIZEOF_KEY], unsigned char key[EAX_SIZEOF_KEY])
+void AesEncrypt(unsigned char msg[EAX_SIZEOF_KEY], unsigned char key[EAX_SIZEOF_KEY])
{
gcry_cipher_hd_t cipher_hd;
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "config.h"
+
+#ifndef _EAX_H
+#define _EAX_H
#include <glib.h>
+#include "ws_symbol_export.h"
+
typedef struct tagMAC_T
{
guint8 Mac[4];
@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] 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
+ @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,
+WS_DLL_PUBLIC
+gboolean Eax_Decrypt(guint8 *pN, guint8 *pK, guint8 *pC,
+ guint32 SizeN, guint32 SizeK, guint32 SizeC, MAC_T *pMac,
guint8 Mode);
+#endif
#include <glib.h>
#include <string.h>
-#include <epan/crypt/md4.h>
+#include "md4.h"
/* NOTE: This code makes no attempt to be fast!
-/*
+/*
Unix SMB/CIFS implementation.
a implementation of MD4 designed for use in the SMB authentication protocol
Copyright (C) Andrew Tridgell 1997-1998.
$Id$
-
+
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 _MD4_H
+#define _MD4_H
+
+#include "ws_symbol_export.h"
+
+WS_DLL_PUBLIC
void crypt_md4(unsigned char *out, const unsigned char *in, size_t n);
+
+#endif
* 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
- *
+ *
* 2012-08-21 - C Elston - Split md5_hmac function to allow incremental usage.
*
*/
#include <glib.h>
#include <string.h>
-#include <epan/pint.h>
-#include <epan/crypt/md5.h>
+#include "pint.h"
+#include "md5.h"
/*
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
/* $Id$ */
-/*
+/*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org>
* Copyright (C) 2012 C Elston, Katalix Systems Ltd <celston@katalix.com>
*
*
* 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
- *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
* 2012-08-21 - C Elston - Split md5_hmac function to allow incremental usage.
*
*/
guint32 in[16];
} md5_state_t;
-/** Initialize the algorithm.
+/** Initialize the algorithm.
* @param pms MD5 context.
*/
WS_DLL_PUBLIC
void md5_init(md5_state_t *pms);
-/** Append a string to the message.
+/** Append a string to the message.
* @param pms MD5 context.
* @param data Data.
* @param nbytes Length of data.
*/
WS_DLL_PUBLIC
-void md5_append( md5_state_t *pms,
+void md5_append( md5_state_t *pms,
const guint8 *data, size_t nbytes);
-/** Finish the message and return the digest.
+/** Finish the message and return the digest.
* @param pms MD5 context.
* @param digest 16 byte digest.
*/
guint8 k_opad[65];
} md5_hmac_state_t;
+WS_DLL_PUBLIC
void md5_hmac_init(md5_hmac_state_t *hctx,
const guint8* key, size_t key_len);
+WS_DLL_PUBLIC
void md5_hmac_append(md5_hmac_state_t *hctx,
const guint8* text, size_t text_len);
+WS_DLL_PUBLIC
void md5_hmac_finish(md5_hmac_state_t *hctx, guint8 digest[16]);
WS_DLL_PUBLIC
#include <glib.h>
#include <string.h>
-#include <epan/crypt/rc4.h>
+#include "rc4.h"
/* Perform RC4 on a block of data using specified key. "data" is a pointer
to the block to be processed. Output is written to same memory as input,
-/*
+/*
Unix SMB/CIFS implementation.
- a partial implementation of RC4 designed for use in the
+ a partial implementation of RC4 designed for use in the
SMB authentication protocol
Copyright (C) Andrew Tridgell 1998
$Id$
-
+
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 __RC4_H__
+#define __RC4_H__
+
+#include "ws_symbol_export.h"
+
typedef struct _rc4_state_struct {
unsigned char s_box[256];
unsigned char index_i;
unsigned char index_j;
} rc4_state_struct;
-void crypt_rc4_init(rc4_state_struct *rc4_state,
+WS_DLL_PUBLIC
+void crypt_rc4_init(rc4_state_struct *rc4_state,
const unsigned char *key, int key_len);
+WS_DLL_PUBLIC
void crypt_rc4(rc4_state_struct *rc4_state, unsigned char *data, int data_len);
+#endif
* 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.
*/
#include <string.h>
#include <glib.h>
-#include <epan/crypt/sha1.h>
+#include "sha1.h"
#define GET_UINT32(n,b,i) \
{ \
* 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"
+
typedef struct
{
guint32 total[2];
}
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[20] );
typedef struct {
}
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[20] );
+WS_DLL_PUBLIC
void sha1_hmac( const guint8 *key, guint32 keylen, const guint8 *buf, guint32 buflen,
guint8 digest[20] );