Move a bunch of the crypt modules and pint.h into wsutil.
authorJeff Morriss <jeff.morriss.ws@gmail.com>
Thu, 1 Aug 2013 23:34:47 +0000 (23:34 -0000)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Thu, 1 Aug 2013 23:34:47 +0000 (23:34 -0000)
This means wsutil now links against libcrypt.

Protect a bunch of the crypt header files from multiple inclusion.

svn path=/trunk/; revision=51100

58 files changed:
CMakeLists.txt
Makefile.common
asn1/c1222/packet-c1222-template.c
asn1/cms/packet-cms-template.c
asn1/kerberos/packet-kerberos-template.c
asn1/snmp/packet-snmp-template.c
asn1/spnego/packet-spnego-template.c
editcap.c
epan/CMakeLists.txt
epan/Makefile.common
epan/address_to_str.c
epan/column-utils.c
epan/crypt/Makefile.am
epan/crypt/Makefile.common
epan/crypt/airpdcap.c
epan/crypt/airpdcap_ccmp.c
epan/crypt/airpdcap_rijndael.c
epan/crypt/airpdcap_tkip.c
epan/dissectors/packet-3com-njack.c
epan/dissectors/packet-c1222.c
epan/dissectors/packet-cms.c
epan/dissectors/packet-data.c
epan/dissectors/packet-dcerpc-netlogon.c
epan/dissectors/packet-frame.c
epan/dissectors/packet-ieee80211-radiotap-iter.c
epan/dissectors/packet-kerberos.c
epan/dissectors/packet-l2tp.c
epan/dissectors/packet-ntlmssp.c
epan/dissectors/packet-radius.c
epan/dissectors/packet-snmp.c
epan/dissectors/packet-spnego.c
epan/dissectors/packet-tacacs.c
epan/packet.h
epan/sigcomp-udvm.c
epan/sna-utils.c
epan/tvbtest.c
epan/tvbuff.c
ui/gtk/hostlist_table.c
ui/gtk/iax2_analysis.c
ui/gtk/rtp_analysis.c
wsutil/CMakeLists.txt
wsutil/Makefile.am
wsutil/Makefile.common
wsutil/aes.c [moved from epan/crypt/aes.c with 100% similarity]
wsutil/aes.h [moved from epan/crypt/aes.h with 96% similarity]
wsutil/des.c [moved from epan/crypt/des.c with 99% similarity]
wsutil/des.h [moved from epan/crypt/des.h with 86% similarity]
wsutil/eax.c [moved from epan/crypt/eax.c with 94% similarity]
wsutil/eax.h [moved from epan/crypt/eax.h with 87% similarity]
wsutil/md4.c [moved from epan/crypt/md4.c with 99% similarity]
wsutil/md4.h [moved from epan/crypt/md4.h with 91% similarity]
wsutil/md5.c [moved from epan/crypt/md5.c with 99% similarity]
wsutil/md5.h [moved from epan/crypt/md5.h with 91% similarity]
wsutil/pint.h [moved from epan/pint.h with 100% similarity]
wsutil/rc4.c [moved from epan/crypt/rc4.c with 98% similarity]
wsutil/rc4.h [moved from epan/crypt/rc4.h with 83% similarity]
wsutil/sha1.c [moved from epan/crypt/sha1.c with 99% similarity]
wsutil/sha1.h [moved from epan/crypt/sha1.h with 93% similarity]

index 50ade08fb74b5df21c2ec40cf9f083fdc40d1bf3..bbd4c78a68e85994c0b153138476fc56593180a9 100644 (file)
@@ -998,7 +998,6 @@ if(BUILD_editcap)
        )
        set(editcap_FILES
                editcap.c
-               epan/crypt/md5.c
                ${WTAP_PLUGIN_SOURCES}
        )
        add_executable(editcap ${editcap_FILES})
index b4dab9ae883c7bfa5acd7fe9ef95976eac3da07b..5e2f255071ab97b2fac03cf6d548a7bc195871cb 100644 (file)
@@ -148,7 +148,6 @@ mergecap_SOURCES = \
 # editcap specifics
 editcap_SOURCES = \
        editcap.c       \
-       epan/crypt/md5.c \
        $(WTAP_PLUGIN_SOURCES)
 
 # reordercap specifics
index 8633a21afd7762461a1821f66d87010ebe721045..d63c23d3e8cddc794470260e4b37b7fcedc7326b 100644 (file)
@@ -26,6 +26,9 @@
 #include "config.h"
 
 #include <glib.h>
+
+#include <wsutil/eax.h>
+
 #include <epan/conversation.h>
 #include <epan/expert.h>
 #include <epan/packet.h>
@@ -34,7 +37,6 @@
 #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>
@@ -485,7 +487,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
                    *offset += 2;
                    *length -= 2;
                    tblsize -= 2;
-               } 
+               }
                proto_tree_add_item(tree, hf_c1222_write_data, tvb, *offset, tblsize, ENC_NA);
                *offset += tblsize;
                *length -= tblsize;
index 01efb52f861bdf40253febec3cf78a69f463869f..e4e93d12ea3860cf0184fe6f29ef66fce77ba119 100644 (file)
 #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>
@@ -41,9 +45,6 @@
 #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"
index 69a9d8814886b461dd79d6f5b7b7cb42bb5d528c..cd47ab9b15612430e3441b6fdce381229b3dcaf3 100644 (file)
@@ -69,7 +69,7 @@
 #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
 
index 1653f8a4ec4ffc14ad219dcf3ca3769082285214..db18fb28b6db775c284e3657df72b14ef6992dd9 100644 (file)
@@ -53,6 +53,9 @@
 
 #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
index 4239c1e156c1eb30136dd8d2dc1718f9e370ce82..7960a71da7c5640e89f76879703a48fb6dd443ad 100644 (file)
 #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>
index 94b954f1064b92e9077a5c9c41a1bf9e9e7df87d..aeb0c2d7697296e250b3557937930df60e67fb83 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -78,6 +78,7 @@
 #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,
@@ -87,7 +88,6 @@
  */
 #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
index 4c5eba8e932d44c7efe466863e664c766e0116dd..a9bc586821edccb11b49fbeb8033987285af7ef1 100644 (file)
@@ -45,13 +45,6 @@ set(CRYPT_FILES
        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
index b587dc57ec88c5485f17272489424ad08f81edf8..26b0d37557644a3c963fa6f337480d4f0e5ea50e 100644 (file)
@@ -222,7 +222,6 @@ LIBWIRESHARK_INCLUDES =             \
        packet.h                \
        packet_info.h           \
        params.h                \
-       pint.h                  \
        plugins.h               \
        ppptypes.h              \
        print.h                 \
index 984e7aba7d09f6415c44c215fe26274fa6f2ffea..e8fe3509c63adf770b54706b45dd2db0ed846402 100644 (file)
@@ -54,7 +54,7 @@
 #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"
@@ -195,19 +195,19 @@ ip6_to_str_buf_len(const guchar* src, char *buf, size_t buf_len)
                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:
@@ -334,7 +334,7 @@ eui64_to_str(const guint64 ad) {
   /* 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;
@@ -389,12 +389,12 @@ ib_addr_to_str_buf( const address *addr, gchar *buf, int buf_len){
                #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);
        }
@@ -622,7 +622,7 @@ address_to_str_buf(const address *addr, gchar *buf, int buf_len)
       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();
   }
index 6546944bf861c65ef428e3910dab4c6ad2273197..ef0e75e6822f8d0a110760a49f8cbf4089ca4fb5 100644 (file)
@@ -33,7 +33,7 @@
 #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"
index dc1a5734e1445fa60181cf5b2518b47fac323b3a..82bb91e06b70a9ab2d3ad8ce46155f52a95a8782 100644 (file)
@@ -29,7 +29,6 @@ endif
 
 AM_CPPFLAGS = \
        -I$(top_srcdir)
-       $(LIBGCRYPT_CFLAGS)
 
 noinst_LTLIBRARIES = libairpdcap.la
 
index e55a5254ccdf7eb09b3a819402d95c011b3e86e4..8b4bda793906927a1db036fd802dc908d6872421 100644 (file)
 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          \
@@ -49,11 +41,5 @@ LIBAIRPDCAP_INCLUDES =       \
        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
index d79f80b35d6f446760fbbfd073e533837598952d..6201386e426a3494f10bbb928c52bcc00650c732 100644 (file)
 
 #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"
index b1bafbe769ef4c4b4c7367ec129d08a974f04f97..afd23aa8a1890315f9dc8453629b4b23767291ee 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "airpdcap_debug.h"
 #include <glib.h>
-#include "aes.h"
+#include <wsutil/aes.h>
 
 /****************************************************************************/
 /*     Internal definitions                                                    */
index 7732418adc89704c63d1ebe72197acf8ed67cb0d..1f70c45e06d0522175583a4c147a969f325ce24e 100644 (file)
@@ -33,7 +33,7 @@
 
 #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.
 
index 99204859688201a6581de9e55ffaeb419d52b484..0f0aaa781bad76286a4daa9d656436bead9014b7 100644 (file)
@@ -35,7 +35,7 @@
 /******************************************************************************/
 /*     File includes                                                                                                                                                                   */
 /*                                                                                                                                                                                                             */
-#include <epan/pint.h>
+#include <wsutil/pint.h>
 #include <wsutil/crc32.h>
 #include "airpdcap_system.h"
 #include "airpdcap_int.h"
index 9cc06bbb97a26fc613e2de8fce88da5bce0d607a..3525ca08c6dfd3e0687a399c963f0a23b5b592f0 100644 (file)
@@ -514,7 +514,7 @@ dissect_tlvs(tvbuff_t *tvb, proto_tree *njack_tree, guint32 offset)
 }
 
 #if 0
-#include <epan/crypt/md5.h>
+#include <wsutil/md5.h>
 
 static gboolean
 verify_password(tvbuff_t *tvb, const char *password)
index 98d5e4022d465c0d838ac79bdf227df38c8a9f01..1b31d86f36b02f5d20685ea337a2cb7297efab0f 100644 (file)
@@ -34,6 +34,9 @@
 #include "config.h"
 
 #include <glib.h>
+
+#include <wsutil/eax.h>
+
 #include <epan/conversation.h>
 #include <epan/expert.h>
 #include <epan/packet.h>
@@ -42,7 +45,6 @@
 #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>
@@ -123,7 +125,7 @@ static int hf_c1222_c1221_auth_request = -1;      /* OCTET_STRING_SIZE_1_255 */
 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;
@@ -228,7 +230,7 @@ static gint ett_c1222_Calling_authentication_value_c1222_U = -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;
@@ -533,7 +535,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
                    *offset += 2;
                    *length -= 2;
                    tblsize -= 2;
-               } 
+               }
                proto_tree_add_item(tree, hf_c1222_write_data, tvb, *offset, tblsize, ENC_NA);
                *offset += tblsize;
                *length -= tblsize;
@@ -1448,7 +1450,7 @@ dissect_c1222_User_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
   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);
@@ -1511,7 +1513,7 @@ static void dissect_MESSAGE_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
 
 
 /*--- 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.
@@ -1890,7 +1892,7 @@ void proto_register_c1222(void) {
         "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 */
@@ -1912,7 +1914,7 @@ void proto_register_c1222(void) {
     &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[] = {
index f960e0365588174c2a3cc80ec584e90bd818d739..769ae7d22895cb1c8936497bc4054e75733ac417 100644 (file)
 #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>
@@ -49,9 +53,6 @@
 #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"
@@ -187,7 +188,7 @@ static int hf_cms_issuerUniqueID = -1;            /* UniqueIdentifier */
 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 */
 
@@ -249,7 +250,7 @@ static gint ett_cms_T_subject = -1;
 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 */
 
@@ -1518,7 +1519,7 @@ dissect_cms_MessageDigest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
     offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
                                        NULL);
 
+
   pi = actx->created_item;
 
   /* move past TLV */
@@ -1823,7 +1824,7 @@ static void dissect_RC2CBCParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _
 
 
 /*--- 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) {
@@ -2331,7 +2332,7 @@ 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 */
@@ -2395,7 +2396,7 @@ void proto_register_cms(void) {
     &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 */
@@ -2441,7 +2442,7 @@ void proto_reg_handoff_cms(void) {
 
 
 /*--- 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");
index 3b32ec15801af7acbd5618512e352c50f4ba9c5b..ba3388fd20cd0abacfeaf19cee6e0e81a5b9def0 100644 (file)
 
 #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
index 66b223d895c18da6f73e90fe67f444bc961e72b5..2a334029784e01fc3c24d2c44ea52bd3ab2f5274 100644 (file)
 
 #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
index 0eccdba794006d043a4ae7412da8fe14be400874..42f0694fd61b9f96772a3d42b4a174464c83743a 100644 (file)
 #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"
 
@@ -80,7 +82,7 @@ static int hf_frame_pack_preamble_error = -1;
 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;
@@ -765,13 +767,13 @@ proto_register_frame(void)
                    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,
@@ -790,9 +792,9 @@ proto_register_frame(void)
                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);
index c2f83b96837b7b89b8da422007fb15a5f2e17e9f..f6f0b94450ca742bbe56b0ef1904b95cf93f69a3 100644 (file)
@@ -21,7 +21,7 @@
 #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
index dd159a402a02173d786356930984a28913675662..70d4aff0f2a4be1392c4dd096b90a6d157d6d1d2 100644 (file)
@@ -75,7 +75,7 @@
 #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
 
index d9295c4ec0faa2e5064db64fe718147856f566b9..289dea91eb90e94eec520dd0d3236a9153565b02 100644 (file)
 
 #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>
 
index da8bd38467bece0ebe885d2ace59fdae6b920858..47d7168323f2843ba411d6d9f7ccd04253e27531 100644 (file)
 #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"
 
index 928969e02a0b141e10fc3957c28f345e47c79a3d..a61ba220092407bfc312cf5792df4be3787d38d9 100644 (file)
 #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>
index 2101fc8f5433ddd962b73a30cf1eb6b281d21cc5..e8ce3b156c8eca540e1c9f22847f6564c489a350 100644 (file)
@@ -61,6 +61,9 @@
 
 #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
@@ -311,7 +309,7 @@ static int hf_snmp_priority = -1;                 /* INTEGER_M1_2147483647 */
 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;
@@ -354,7 +352,7 @@ static gint ett_snmp_SimpleOpen_U = -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;
@@ -2978,7 +2976,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
 
 
 /*--- 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
@@ -3904,7 +3902,7 @@ void proto_register_snmp(void) {
         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 */
@@ -3944,7 +3942,7 @@ void proto_register_snmp(void) {
     &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 }},
index 869304517c2059a800ee0a00d5867263f60db806..b727fd833d2559de8475336c695d7d03ff2e0326 100644 (file)
 #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>
@@ -111,7 +113,7 @@ static int hf_spnego_ContextFlags_confFlag = -1;
 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;
@@ -137,7 +139,7 @@ static gint ett_spnego_NegTokenTarg = -1;
 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,
@@ -582,7 +584,7 @@ dissect_spnego_InitialContextToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
 
 
 /*--- 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
@@ -1957,7 +1959,7 @@ void proto_register_spnego(void) {
         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 */
@@ -1979,7 +1981,7 @@ void proto_register_spnego(void) {
     &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 */
index e53d1b0267b3e38a4352509fb042408235158831..bdf5b3c64aad24ccaa00067de78e8035896593b9 100644 (file)
 #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"
index 107eab3a5db043da59c7fab2306b15b44d3aceb8..8ad9c18587e7ae42683ed75ef532c48269cbd8eb 100644 (file)
@@ -28,7 +28,7 @@
 #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"
index 76c67f839e4e9bdb9009218a7f4ac50a07d277a7..cf876b44e87feb9b417199d0bdefe4ebee8c57d2 100644 (file)
 #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
@@ -2905,7 +2906,7 @@ decode_udvm_multitype_operand(guint8 *buff,guint operand_address, guint16 *value
        guint8 temp_data;
        guint16 temp_data16;
        guint16 memmory_addr = 0;
-       
+
 *value = 0;
 
        bytecode = buff[operand_address];
index 27ed1a70a85106f1d436bbb8a44b602000072009..91bbb5b8a7dbe5e693e837fa1bc35c1bbfa72688 100644 (file)
@@ -28,7 +28,7 @@
 #include <string.h>
 
 #include "packet_info.h"
-#include "pint.h"
+#include "wsutil/pint.h"
 #include "sna-utils.h"
 #include "emem.h"
 
index 2aa6b187f10c2ea01021453d20fce030c6385eb7..0ba1a33ef208ecdfa9c4025e25923e3c38d55287 100644 (file)
@@ -29,7 +29,7 @@
 #include <string.h>
 
 #include "tvbuff.h"
-#include "pint.h"
+#include "wsutil/pint.h"
 
 gboolean failed = FALSE;
 
index 3a54ae68b5c9ed37ead6a2e59749812c5039a55d..ccda1a4832670d00cba3405f56873f172c838cfa 100644 (file)
@@ -43,7 +43,7 @@
 #include <zlib.h>
 #endif
 
-#include "pint.h"
+#include "wsutil/pint.h"
 #include "tvbuff.h"
 #include "tvbuff-int.h"
 #include "strutil.h"
@@ -86,7 +86,7 @@ static void
 tvb_free_internal(tvbuff_t *tvb)
 {
        gsize     size;
-       
+
        DISSECTOR_ASSERT(tvb);
 
        if (tvb->ops->tvb_free)
@@ -288,7 +288,7 @@ check_offset_length(const tvbuff_t *tvb,
                    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);
@@ -397,7 +397,7 @@ tvb_clone_offset_len(tvbuff_t *tvb, guint offset, guint len)
 {
        if (tvb->ops->tvb_clone) {
                tvbuff_t *cloned_tvb;
-               
+
                cloned_tvb = tvb->ops->tvb_clone(tvb, offset, len);
                if (cloned_tvb)
                        return cloned_tvb;
index 350eeb57ff35739c5cf46c594f189f54b083ceb7..cdd939d1a45a9a52956d8ddc91b2af72782d22b4 100644 (file)
@@ -41,7 +41,7 @@
 #ifdef HAVE_GEOIP
 #include <GeoIP.h>
 #include <epan/geoip_db.h>
-#include <epan/pint.h>
+#include <wsutil/pint.h>
 #include <epan/filesystem.h>
 #endif
 
index 54aa27b4aa9aa4390b7862839e788b3cd6e0db86..2019fff30f1e7680e3c3ffc53aba4a4dfc518502 100644 (file)
 #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>
index b6e01ba4130884bf4d528b6ae7d371857271f10d..8f9295897d2fe67796490471606646bcd31b0261 100644 (file)
 #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>
index cce06d373f99bfb5d3756ee9b4d5d1aefb003f21..d40e2cc630ac217a2c67724fc5103a3f2b9c23f6 100644 (file)
@@ -35,6 +35,7 @@ set(WSUTIL_FILES
 #              @INET_PTON_LO@  # inet_pton.c
 #              @STRNCASECMP_LO@ # strncasecmp.c
 #              @STRPTIME_LO@   # strptime.c
+  aes.c
   airpdcap_wep.c
   crash_info.c
   crc10.c
@@ -46,12 +47,18 @@ set(WSUTIL_FILES
   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
@@ -61,6 +68,7 @@ set(WSUTIL_FILES
 
 set(wsutil_LIBS
   ${GLIB2_LIBRARIES}
+  ${GCRYPT_LIBRARIES}
 )
 
 set(CLEAN_FILES
index 828995c89fe194d08008579a846cd6c4f6f7d2ab..4b35e8484f561513f329e8181347cad88cb78ccf 100644 (file)
@@ -29,15 +29,15 @@ wsutil_optional_objects =
 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
@@ -65,6 +65,7 @@ lib_LTLIBRARIES = libwsutil.la
 libwsutil_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
 
 AM_CPPFLAGS = -I$(srcdir)/..
+       $(LIBGCRYPT_CFLAGS)
 
 libwsutil_la_SOURCES =         \
        $(LIBWSUTIL_SRC)        \
@@ -88,6 +89,7 @@ libwsutil_la_DEPENDENCIES=    \
 
 libwsutil_la_LIBADD =          \
        @GLIB_LIBS@             \
+       @LIBGCRYPT_LIBS@        \
        $(wsutil_optional_objects)
 
 EXTRA_DIST =           \
index 8e2903bef5b6a094a35de62b0b6c6ba4699d22a7..9261ea469eb5f10c69babc91cb60207e7f032510 100644 (file)
@@ -29,6 +29,7 @@
 # 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          \
@@ -40,12 +41,18 @@ LIBWSUTIL_SRC =     \
        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     \
@@ -53,6 +60,7 @@ LIBWSUTIL_SRC =       \
 
 # Header files that are not generated from other files
 LIBWSUTIL_INCLUDES =   \
+       aes.h           \
        crash_info.h    \
        crc6.h          \
        crc7.h          \
@@ -63,12 +71,18 @@ LIBWSUTIL_INCLUDES =        \
        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     \
similarity index 100%
rename from epan/crypt/aes.c
rename to wsutil/aes.c
similarity index 96%
rename from epan/crypt/aes.h
rename to wsutil/aes.h
index 54224ff6c15ba2e8e9c7c6d629f0ddf48061c94e..45079eaa0ee472890acb25d3af68baab5e445238 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef        _AES
 #define        _AES
 
+#include "ws_symbol_export.h"
+
 #define RIJNDAEL_MAXKC  (256/32)
 #define RIJNDAEL_MAXKB  (256/8)
 #define RIJNDAEL_MAXNR  14
@@ -44,16 +46,19 @@ typedef struct s_rijndael_ctx {
 } 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,
similarity index 99%
rename from epan/crypt/des.c
rename to wsutil/des.c
index e219385a621d0d4793d53549132b56066484961d..63990f4efdea656ff3a7e728ebcc9ddd63cadff4 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include <glib.h>
 
-#include <epan/crypt/des.h>
+#include "des.h"
 
 /* NOTES:
 
similarity index 86%
rename from epan/crypt/des.h
rename to wsutil/des.h
index 7a5fb442eae0820475c0f15d846f31a1d2eb994a..717d64f0a196539e68179c512dce796caacd86c3 100644 (file)
@@ -1,26 +1,34 @@
-/* 
+/*
    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
similarity index 94%
rename from epan/crypt/eax.c
rename to wsutil/eax.c
index 7e12fb71d080467e1420fe6e1d151d8450d9ef18..217c107909897b5198046eb18b22c01260c8b1cf 100644 (file)
@@ -39,7 +39,7 @@ typedef struct {
 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);
@@ -54,21 +54,21 @@ void AesEncrypt(unsigned char msg[EAX_SIZEOF_KEY], unsigned char key[EAX_SIZEOF_
  @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;
@@ -87,18 +87,18 @@ gboolean Eax_Decrypt(guint8 *pN, guint8 *pK, guint8 *pC,
     } 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)
@@ -161,9 +161,9 @@ static void dCMAC(guint8 *pK, guint8 *ws, const guint8 *pN, guint16 SizeN, const
     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;
@@ -202,7 +202,7 @@ static void dCMAC(guint8 *pK, guint8 *ws, const guint8 *pN, guint16 SizeN, const
     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];
@@ -230,7 +230,7 @@ static void CTR(const guint8 *ws, guint8 *pK, guint8 *pN, guint16 SizeN)
     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;
 
similarity index 87%
rename from epan/crypt/eax.h
rename to wsutil/eax.h
index 46554f6d947133bfa1c876582517dfac5665a122..f1f50e0f1635e54d90fffeacca004b02e574dfab 100644 (file)
  * 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];
@@ -42,14 +46,16 @@ typedef struct tagMAC_T
  @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
similarity index 99%
rename from epan/crypt/md4.c
rename to wsutil/md4.c
index 8eac4b276491f8fa57b8bdfba88225522a1345c7..310a1c37aa297331bf2a5192bf15ec97659da168 100644 (file)
@@ -25,7 +25,7 @@
 #include <glib.h>
 #include <string.h>
 
-#include <epan/crypt/md4.h>
+#include "md4.h"
 
 /* NOTE: This code makes no attempt to be fast!
 
similarity index 91%
rename from epan/crypt/md4.h
rename to wsutil/md4.h
index b3bdb87a08fd1942e4598cb5ec37c3d9d79a6029..204bd3899dd4ce385aae06502bd4efe9446cc215 100644 (file)
@@ -1,23 +1,31 @@
-/* 
+/*
    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
similarity index 99%
rename from epan/crypt/md5.c
rename to wsutil/md5.c
index aaf6107f4c396ec9b384e45ca79a08a6c00862bf..0aefa0f0d875a88116370d2aec0774f8881044c3 100644 (file)
@@ -20,7 +20,7 @@
  * 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.
  *
  */
@@ -31,8 +31,8 @@
 #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
similarity index 91%
rename from epan/crypt/md5.h
rename to wsutil/md5.h
index 8aadf0a72a9dd66d77bbbb4a4cf21717ca463432..c9a3592233aace5420d62bba2c8ccba807ccd3be 100644 (file)
@@ -1,5 +1,5 @@
 /* $Id$ */
-/* 
+/*
  * Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org>
  * Copyright (C) 2012      C Elston, Katalix Systems Ltd <celston@katalix.com>
  *
@@ -17,8 +17,8 @@
  *
  * 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.
  *
  */
@@ -48,22 +48,22 @@ typedef struct md5_state_s
        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.
  */
@@ -76,12 +76,15 @@ typedef struct md5_hmac_state_s
     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
similarity index 100%
rename from epan/pint.h
rename to wsutil/pint.h
similarity index 98%
rename from epan/crypt/rc4.c
rename to wsutil/rc4.c
index f2211de3148716429c068ed2592c82fe5f138f87..551ca8dc0fd58b2de3d45d14a2f84357ecc718fa 100644 (file)
@@ -28,7 +28,7 @@
 #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,
similarity index 83%
rename from epan/crypt/rc4.h
rename to wsutil/rc4.h
index 56259acd7e40e85ea0a2c4dcbefeab3cb98e88fa..e59f34d6c1e1ae511c0699ae973597a60288756b 100644 (file)
@@ -1,36 +1,44 @@
-/* 
+/*
    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
similarity index 99%
rename from epan/crypt/sha1.c
rename to wsutil/sha1.c
index 64fff3022651152ba0820f296796e893ba32484b..526a2ed5d4b6808cb210b69b5d133ceffa43f533 100644 (file)
  *  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)                       \
 {                                               \
similarity index 93%
rename from epan/crypt/sha1.h
rename to wsutil/sha1.h
index d8daefbe0aa9942a72f550cf3d01fa885bfdbae3..5a558c9f780b86eefb2ef00c48ee4ab472b69b3c 100644 (file)
  *  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];
@@ -38,8 +40,11 @@ typedef struct
 }
 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 {
@@ -48,9 +53,13 @@ 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] );