aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2006-02-06 09:09:06 +0000
committerGuy Harris <guy@alum.mit.edu>2006-02-06 09:09:06 +0000
commitad3cb359b6a87ec58008551b25427734c5c64f93 (patch)
treed106fd919a112b7e947e2de4205b1c3907aa8c86
parent86309dc6b83a4598e7cc4bab16713546d8837646 (diff)
From Paolo Abeni:
Set up to build on Windows if we have GNU TLS. Define "ssl_data_set()" regardless of whether we have GNU TLS or not, as it's used in either case. Get rid of an extra #include of epan/gnuc_format_check.h. svn path=/trunk/; revision=17177
-rw-r--r--Makefile.nmake12
-rw-r--r--config.nmake19
-rw-r--r--epan/Makefile.nmake3
-rw-r--r--epan/dissectors/Makefile.nmake2
-rw-r--r--epan/dissectors/packet-ssl-utils.c14
-rw-r--r--epan/dissectors/packet-ssl-utils.h1
6 files changed, 37 insertions, 14 deletions
diff --git a/Makefile.nmake b/Makefile.nmake
index 8921968935..e5006d1367 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -16,7 +16,7 @@ LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
$(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
/I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
- $(ADNS_CFLAGS) $(PCRE_CFLAGS) -D_U_="" -D_NEED_VAR_IMPORT_
+ $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) -D_U_="" -D_NEED_VAR_IMPORT_
CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
@@ -56,7 +56,8 @@ ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
$(ADNS_LIBS) \
$(PCRE_LIBS) \
- $(ZLIB_LIBS)
+ $(ZLIB_LIBS) \
+ $(GNUTLS_LIBS)
!ENDIF
# $(PCAP_DIR)\lib\wpcap.lib
@@ -72,7 +73,8 @@ tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
$(ADNS_LIBS) \
$(PCRE_LIBS) \
- $(ZLIB_LIBS)
+ $(ZLIB_LIBS) \
+ $(GNUTLS_LIBS)
!ENDIF
capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
@@ -103,7 +105,8 @@ dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
$(ADNS_LIBS) \
$(PCRE_LIBS) \
- $(ZLIB_LIBS)
+ $(ZLIB_LIBS) \
+ $(GNUTLS_LIBS)
!ENDIF
randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
@@ -224,6 +227,7 @@ config.h : config.h.win32 config.nmake
-e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
-e "s/@HAVE_LIBETHEREALDLL@/$(LIBETHEREAL_CONFIG)/" \
-e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
+ -e "s/@HAVE_GNUTLS@/$(GNUTLS_CONFIG)/" \
< config.h.win32 > $@
ps.c : rdps.exe print.ps
diff --git a/config.nmake b/config.nmake
index d54e96c66a..a540034ee7 100644
--- a/config.nmake
+++ b/config.nmake
@@ -73,6 +73,12 @@ GLIB_DIR=$(ETHEREAL_LIBS)\glib
GTK1_DIR=$(ETHEREAL_LIBS)\gtk+
GTK2_DIR=$(ETHEREAL_LIBS)\gtk2
+#
+# If you have gnutls set this to the pathname where the lib and include files
+# are stored.
+# This enable ssl decryption
+#GNUTLS_DIR=$(ETHEREAL_LIBS)\gnutls-win32-msvc\gnutls
+
# Declare the version of your gtk2 and pango. (MAJOR + MINOR Version number
# but without MICRO version number)
# These macros are used by the nsis installer script and by the setup target.
@@ -401,5 +407,18 @@ LIBETHEREAL_CONFIG=^#define HAVE_LIBETHEREALDLL 1
LIBETHEREAL_CONFIG=
!ENDIF
+!IFDEF GNUTLS_DIR
+GNUTLS_PATH=$(GNUTLS_DIR)
+GNUTLS_CFLAGS=/I$(GNUTLS_DIR)
+GNUTLS_LIBS=$(GNUTLS_DIR)\gnutls.lib
+# Nmake uses carets to escape special characters
+GNUTLS_CONFIG=^#define HAVE_GNUTLS 1
+!else
+GNUTLS_CFLAGS=
+GNUTLS_LIBS=
+GNUTLS_CONFIG=
+!ENDIF
+
+
# Construct the path
PATH=$(PATH);$(CYGWIN_PATH);$(DLL_PATH);$(ZLIB_PATH);$(ADNS_PATH)
diff --git a/epan/Makefile.nmake b/epan/Makefile.nmake
index 480e6af33c..9c323b48b0 100644
--- a/epan/Makefile.nmake
+++ b/epan/Makefile.nmake
@@ -11,7 +11,7 @@ include Makefile.common
############### no need to modify below this line #########
CFLAGS=-DHAVE_CONFIG_H /I. /I.. /I../wiretap $(GLIB_CFLAGS) \
- $(ZLIB_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) /I$(PCAP_DIR)\include \
+ $(ZLIB_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) /I$(PCAP_DIR)\include \
-D_U_="" $(LOCAL_CFLAGS)
CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
@@ -23,6 +23,7 @@ libethereal_LIBS = \
$(PCRE_LIBS) \
$(NETTLE_LIBS) \
$(ZLIB_LIBS) \
+ $(GNUTLS_LIBS) \
$(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
$(ICONV_DIR)\lib\iconv.lib \
ftypes\ftypes.lib \
diff --git a/epan/dissectors/Makefile.nmake b/epan/dissectors/Makefile.nmake
index d606401ad9..72facf28da 100644
--- a/epan/dissectors/Makefile.nmake
+++ b/epan/dissectors/Makefile.nmake
@@ -11,7 +11,7 @@ include Makefile.common
CFLAGS=-DHAVE_CONFIG_H /I. /I.. /I../.. $(GLIB_CFLAGS) \
/I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
- $(PCRE_CFLAGS) $(NETTLE_CFLAGS) \
+ $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(NETTLE_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index 7bb1f25761..0fa3149912 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -29,6 +29,13 @@
#include <string.h>
#include "packet-ssl-utils.h"
+void
+ssl_data_set(StringInfo* str, unsigned char* data, unsigned int len)
+{
+ memcpy(str->data, data, len);
+ str->data_len = len;
+}
+
#ifdef HAVE_LIBGNUTLS
/* hmac abstraction layer */
@@ -315,13 +322,6 @@ ssl_data_alloc(StringInfo* str, unsigned int len)
return 0;
}
-void
-ssl_data_set(StringInfo* str, unsigned char* data, unsigned int len)
-{
- memcpy(str->data, data, len);
- str->data_len = len;
-}
-
#define PRF(ssl,secret,usage,rnd1,rnd2,out) ((ssl->version_netorder==SSLV3_VERSION)? \
ssl3_prf(secret,usage,rnd1,rnd2,out): \
tls_prf(secret,usage,rnd1,rnd2,out))
diff --git a/epan/dissectors/packet-ssl-utils.h b/epan/dissectors/packet-ssl-utils.h
index 74ec8595a0..9b6cb3c9ee 100644
--- a/epan/dissectors/packet-ssl-utils.h
+++ b/epan/dissectors/packet-ssl-utils.h
@@ -36,7 +36,6 @@
#include <gcrypt.h>
#include <gnutls/x509.h>
#include <gnutls/openssl.h>
-#include <epan/gnuc_format_check.h>
/* #define SSL_FAST 1 */
#define SSL_DECRYPT_DEBUG