[sr-dev] git:master: modules/stun: removed dependency on OpenSSL

Peter Dunkley peter.dunkley at crocodile-rcs.com
Thu Sep 12 17:36:47 CEST 2013


Module: sip-router
Branch: master
Commit: 42722f3e70d3316b7c6881907b626b02303d58a6
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=42722f3e70d3316b7c6881907b626b02303d58a6

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Thu Sep 12 16:36:28 2013 +0100

modules/stun: removed dependency on OpenSSL

---

 modules/stun/Makefile   |   26 +-------------------------
 modules/stun/kam_stun.c |    1 -
 modules/stun/kam_stun.h |    6 ++++--
 3 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/modules/stun/Makefile b/modules/stun/Makefile
index 40a6ba6..beced1f 100644
--- a/modules/stun/Makefile
+++ b/modules/stun/Makefile
@@ -6,32 +6,8 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=stun.so
+LIBS=
 
-ifeq ($(CROSS_COMPILE),)
-SSL_BUILDER=$(shell \
-	if pkg-config --exists libssl; then \
-		echo 'pkg-config libssl'; \
-	fi)
-endif
-
-ifneq ($(SSL_BUILDER),)
-	DEFS += $(shell $(SSL_BUILDER) --cflags)
-	LIBS += $(shell $(SSL_BUILDER) --libs)
-else
-	DEFS += -I$(LOCALBASE)/ssl/include
-	LIBS += -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
-			-L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 \
-			-lssl -lcrypto
-	# NOTE: depending on the way in which libssl was compiled you might
-	#       have to add -lz -lkrb5   (zlib and kerberos5).
-	#       E.g.: make TLS_HOOKS=1 TLS_EXTRA_LIBS="-lz -lkrb5"
-endif
-
-LIBS+= $(TLS_EXTRA_LIBS)
-
-# Static linking, if you'd like to use TLS and STUN at the same time
-#
-#LIBS+= /usr/lib/libcurl.a /usr/lib/libssl.a /usr/lib/libcrypto.a -lkrb5 -lidn -lz -lgssapi_krb5 -lrt
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 include ../../Makefile.modules
diff --git a/modules/stun/kam_stun.c b/modules/stun/kam_stun.c
index 7a7a88e..c9c5dd3 100644
--- a/modules/stun/kam_stun.c
+++ b/modules/stun/kam_stun.c
@@ -24,7 +24,6 @@
  */
 
 #include <arpa/inet.h>
-#include <openssl/sha.h>
 #include "kam_stun.h"
 #include "../../forward.h"
 
diff --git a/modules/stun/kam_stun.h b/modules/stun/kam_stun.h
index 6ec30b6..a5a55c6 100644
--- a/modules/stun/kam_stun.h
+++ b/modules/stun/kam_stun.h
@@ -26,8 +26,6 @@
 #ifndef _kam_stun_h
 #define _kam_stun_h
 
-#include <openssl/sha.h>
-
 #include "../../str.h"
 #include "../../tcp_conn.h"
 #include "../../ip_addr.h"
@@ -106,6 +104,10 @@
 #define IP_ADDR			4
 #define XOR			1
 
+#ifndef SHA_DIGEST_LENGTH
+#define SHA_DIGEST_LENGTH	20
+#endif
+
 /** padd len to a multiple of sz.
  *  sz must be a power of the form 2^k (e.g. 2, 4, 8, 16 ...)
  */




More information about the sr-dev mailing list