Browse code

tls_wolfssl: wolfSSL — update to v5.4.0-stable

- the upstream commit also fixes GCC warnings so
we don't have to workaround with -Wno-xxxxxx

S-P Chan authored on 14/07/2022 01:11:30
Showing 1 changed files
... ...
@@ -23,7 +23,7 @@ $(WOLFSSL_PREFIX)/include/wolfssl/options.h $(WOLFSSL_PREFIX)/lib/libwolfssl.a:
23 23
 		./autogen.sh; \
24 24
 	fi; \
25 25
 	if [ ! -f "Makefile" ]; then \
26
-		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC -Wno-error=array-bounds -Wno-error=stringop-overflow" ./configure \
26
+		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC" ./configure \
27 27
 		--enable-all --enable-pkcs11 --enable-static --enable-aligndata=no \
28 28
 		--disable-shared --disable-examples \
29 29
 		--prefix=$(CURDIR)/$(WOLFSSL_PREFIX) \
Browse code

tls_wolfssl: move git submodule to misc/external/wolfssl

- GH #3164

S-P Chan authored on 04/07/2022 11:28:54
Showing 1 changed files
... ...
@@ -8,15 +8,17 @@ include ../../Makefile.defs
8 8
 auto_gen=
9 9
 NAME=tls_wolfssl.so
10 10
 
11
-LIBS += lib/lib/libwolfssl.a
12
-INCLUDES += -I./lib/include/
11
+WOLFSSL_PREFIX = ../../../misc/external/wolfssl/build
12
+WOLFSSL_SRC = ../../../misc/external/wolfssl/wolfssl
13 13
 
14
+LIBS += $(WOLFSSL_PREFIX)/lib/libwolfssl.a
15
+INCLUDES += -I$(WOLFSSL_PREFIX)/include/
14 16
 
15 17
 include ../../Makefile.modules
16
-$(objs): lib/include/wolfssl/options.h
18
+$(objs): $(WOLFSSL_PREFIX)/include/wolfssl/options.h
17 19
 
18
-lib/include/wolfssl/options.h lib/lib/libwolfssl.a:
19
-	@cd ./lib/wolfssl; \
20
+$(WOLFSSL_PREFIX)/include/wolfssl/options.h $(WOLFSSL_PREFIX)/lib/libwolfssl.a:
21
+	@cd $(WOLFSSL_SRC); \
20 22
 	if [ ! -f "configure" ]; then \
21 23
 		./autogen.sh; \
22 24
 	fi; \
... ...
@@ -24,16 +26,16 @@ lib/include/wolfssl/options.h lib/lib/libwolfssl.a:
24 26
 		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC -Wno-error=array-bounds -Wno-error=stringop-overflow" ./configure \
25 27
 		--enable-all --enable-pkcs11 --enable-static --enable-aligndata=no \
26 28
 		--disable-shared --disable-examples \
27
-		--prefix=$(CURDIR)/lib \
28
-		--exec-prefix=$(CURDIR)/lib; \
29
+		--prefix=$(CURDIR)/$(WOLFSSL_PREFIX) \
30
+		--exec-prefix=$(CURDIR)/$(WOLFSSL_PREFIX); \
29 31
 	fi;
30
-	@$(MAKE) -C ./lib/wolfssl install
32
+	@$(MAKE) -C $(WOLFSSL_SRC) install
31 33
 
32
-$(NAME): lib/lib/libwolfssl.a
34
+$(NAME): $(WOLFSSL_PREFIX)/lib/libwolfssl.a
33 35
 
34 36
 clean-wolfssl:
35
-	@rm -rf ./lib/{bin,include,share,lib}; \
36
-	(cd ./lib/wolfssl; make distclean) || /bin/true
37
+	@rm -rf $(WOLFSSL_PREFIX)/{bin,include,share,lib}; \
38
+	(cd $(WOLFSSL_SRC); make distclean) || /bin/true
37 39
 
38 40
 clean-module:
39 41
 	@rm -f *.o *.so
Browse code

tls_wolfssl: make - use kamailio make infra vars

S-P Chan authored on 24/06/2022 07:58:14
Showing 1 changed files
... ...
@@ -9,17 +9,13 @@ auto_gen=
9 9
 NAME=tls_wolfssl.so
10 10
 
11 11
 LIBS += lib/lib/libwolfssl.a
12
-DEFS += -I./lib/include/
12
+INCLUDES += -I./lib/include/
13 13
 
14 14
 
15 15
 include ../../Makefile.modules
16
-SOURCES := $(shell ls *.c)
17
-OBJECTS = $(SOURCES:.c=.o)
18
-MOD_DIR := $(shell pwd)
16
+$(objs): lib/include/wolfssl/options.h
19 17
 
20
-$(OBJECTS): lib/lib/libwolfssl.a
21
-
22
-lib/lib/libwolfssl.a:
18
+lib/include/wolfssl/options.h lib/lib/libwolfssl.a:
23 19
 	@cd ./lib/wolfssl; \
24 20
 	if [ ! -f "configure" ]; then \
25 21
 		./autogen.sh; \
... ...
@@ -28,9 +24,8 @@ lib/lib/libwolfssl.a:
28 24
 		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC -Wno-error=array-bounds -Wno-error=stringop-overflow" ./configure \
29 25
 		--enable-all --enable-pkcs11 --enable-static --enable-aligndata=no \
30 26
 		--disable-shared --disable-examples \
31
-		--prefix=$(MOD_DIR)/lib \
32
-		--exec-prefix=$(MOD_DIR)/lib; \
33
-		sed -i s/-Werror// Makefile; \
27
+		--prefix=$(CURDIR)/lib \
28
+		--exec-prefix=$(CURDIR)/lib; \
34 29
 	fi;
35 30
 	@$(MAKE) -C ./lib/wolfssl install
36 31
 
... ...
@@ -38,7 +33,7 @@ $(NAME): lib/lib/libwolfssl.a
38 33
 
39 34
 clean-wolfssl:
40 35
 	@rm -rf ./lib/{bin,include,share,lib}; \
41
-	cd ./lib/wolfssl; make clean || /bin/true
36
+	(cd ./lib/wolfssl; make distclean) || /bin/true
42 37
 
43 38
 clean-module:
44 39
 	@rm -f *.o *.so
... ...
@@ -46,3 +41,6 @@ clean-module:
46 41
 clean-all: clean-wolfssl clean-module
47 42
 
48 43
 .PHONY: clean-wolfssl clean-module clean-all
44
+
45
+# debugging for dependency on lib/wolfssl
46
+$(warning sources = $(sources), auto_gen = $(auto_gen), objs = $(objs))
Browse code

tls_wolfssl: less verbose during build

S-P Chan authored on 24/06/2022 03:08:11
Showing 1 changed files
... ...
@@ -25,9 +25,9 @@ lib/lib/libwolfssl.a:
25 25
 		./autogen.sh; \
26 26
 	fi; \
27 27
 	if [ ! -f "Makefile" ]; then \
28
-		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC" ./configure \
28
+		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC -Wno-error=array-bounds -Wno-error=stringop-overflow" ./configure \
29 29
 		--enable-all --enable-pkcs11 --enable-static --enable-aligndata=no \
30
-		--disable-shared --disable-silent-rules --disable-examples \
30
+		--disable-shared --disable-examples \
31 31
 		--prefix=$(MOD_DIR)/lib \
32 32
 		--exec-prefix=$(MOD_DIR)/lib; \
33 33
 		sed -i s/-Werror// Makefile; \
... ...
@@ -44,5 +44,5 @@ clean-module:
44 44
 	@rm -f *.o *.so
45 45
 
46 46
 clean-all: clean-wolfssl clean-module
47
-  
47
+
48 48
 .PHONY: clean-wolfssl clean-module clean-all
Browse code

tls_wolfssl: add wolfssl@e722c15be8 as a submodule

S-P Chan authored on 23/06/2022 07:15:11
Showing 1 changed files
... ...
@@ -8,74 +8,41 @@ include ../../Makefile.defs
8 8
 auto_gen=
9 9
 NAME=tls_wolfssl.so
10 10
 
11
-# set to yes when wanting to link with static libraries
12
-LIBSSL_STATIC ?= no
13
-# set to yes when wanting to link with static libraries compiled from source
14
-LIBSSL_STATIC_SRCLIB ?= no
15
-# set to the path of the folder with static libraries compiled from source
16
-LIBSSL_STATIC_SRCPATH ?= /usr/local/src/openssl
11
+LIBS += lib/lib/libwolfssl.a
12
+DEFS += -I./lib/include/
17 13
 
18
-ifeq ($(CROSS_COMPILE),)
19
-WOLFSSL_BUILDER=$(shell \
20
-	if pkg-config --exists wolfssl; then \
21
-		echo 'pkg-config wolfssl'; \
22
-	fi)
23
-endif
24
-
25
-ifneq ($(WOLFSSL_BUILDER),)
26
-
27
-ifneq ($(WOLFSSL_STATIC),yes)
28
-	DEFS += $(shell $(WOLFSSL_BUILDER) --cflags)
29
-	LIBS += $(shell $(WOLFSSL_BUILDER) --libs)
30
-
31
-else # $(WOLFSSL_STATIC),yes)
32
-
33
-	DEFS += -DKSR_WOLFSSL_STATIC
34
-
35
-ifneq ($(WOLFSSL_STATIC_SRCLIB),yes)
36
-	## when static libs (*.a) from packages are compiled with -fPIC
37
-	DEFS += $(shell $(WOLFSSL_BUILDER) --cflags)
38
-	LIBS += $(shell $(WOLFSSL_BUILDER) --libs-only-L)
39
-	# TODO: explore use of LIBS += -Wl,-Bstatic $(shell $(SSL_BUILDER) --libs-only-l)
40
-	LIBS += -l:libwolfssl.a -l:libz.a -l:libdl.a
41
-else
42
-	## when linking against static libs compiled from sources
43
-	DEFS += -I$(WOLFSSL_STATIC_SRCPATH)/include
44
-	LIBS += $(WOLFSSL_STATIC_SRCPATH)/libwolfssl.a
45
-endif # ifneq ($(WOLFSSL_STATIC_SRCLIB),yes)
46
-
47
-endif # ifneq ($(WOLFSSL_STATIC),yes)
48
-
49
-else # ifneq ($(SSL_BUILDER),)
50
-
51
-	DEFS += -I$(LOCALBASE)/wolfssl/include
52
-	LIBS += -L$(LOCALBASE)/lib \
53
-			-L$(LOCALBASE)/lib64  \
54
-			-lwolfssl
55
-endif # ifneq ($(SSL_BUILDER),)
56
-
57
-LIBS+= $(TLS_EXTRA_LIBS)
58
-
59
-# dcm: tls.cfg installed via local 'install-cfg' to update paths
60
-#MOD_INSTALL_CFGS=tls.cfg
61 14
 
62 15
 include ../../Makefile.modules
63
-
64
-install-tls-cert: $(cfg_prefix)/$(cfg_dir)
65
-	MAIN_NAME=$(MAIN_NAME) ./tls_cert.sh -d $(cfg_prefix)/$(cfg_dir)
66
-
67
-install-cfg:
68
-	@if ! [ -d $(cfg_prefix)/$(cfg_dir) ]; then \
69
-		mkdir -p "$(cfg_prefix)/$(cfg_dir)" ; \
70
-	fi
71
-	@$(call try_err, $(INSTALL_TOUCH) \
72
-			"$(cfg_prefix)/$(cfg_dir)tls.cfg.sample" )
73
-	@sed -e "s#\/usr/local/etc/kamailio/#$(cfg_target)#g" \
74
-			-e "s#kamailio-selfsigned#$(MAIN_NAME)-selfsigned#g" \
75
-				< ./tls.cfg > "$(cfg_prefix)/$(cfg_dir)tls.cfg.sample"
76
-	@if [ -z "${skip_cfg_install}" -a \
77
-			! -f "$(cfg_prefix)/$(cfg_dir)tls.cfg" ]; then \
78
-		mv -f "$(cfg_prefix)/$(cfg_dir)tls.cfg.sample" \
79
-						"$(cfg_prefix)/$(cfg_dir)tls.cfg" ; \
80
-	fi
81
-
16
+SOURCES := $(shell ls *.c)
17
+OBJECTS = $(SOURCES:.c=.o)
18
+MOD_DIR := $(shell pwd)
19
+
20
+$(OBJECTS): lib/lib/libwolfssl.a
21
+
22
+lib/lib/libwolfssl.a:
23
+	@cd ./lib/wolfssl; \
24
+	if [ ! -f "configure" ]; then \
25
+		./autogen.sh; \
26
+	fi; \
27
+	if [ ! -f "Makefile" ]; then \
28
+		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC" ./configure \
29
+		--enable-all --enable-pkcs11 --enable-static --enable-aligndata=no \
30
+		--disable-shared --disable-silent-rules --disable-examples \
31
+		--prefix=$(MOD_DIR)/lib \
32
+		--exec-prefix=$(MOD_DIR)/lib; \
33
+		sed -i s/-Werror// Makefile; \
34
+	fi;
35
+	@$(MAKE) -C ./lib/wolfssl install
36
+
37
+$(NAME): lib/lib/libwolfssl.a
38
+
39
+clean-wolfssl:
40
+	@rm -rf ./lib/{bin,include,share,lib}; \
41
+	cd ./lib/wolfssl; make clean || /bin/true
42
+
43
+clean-module:
44
+	@rm -f *.o *.so
45
+
46
+clean-all: clean-wolfssl clean-module
47
+  
48
+.PHONY: clean-wolfssl clean-module clean-all
Browse code

tls_wolfssl: new module TLS stack based on wolfSSL

Initial support. Use OpenSSL-compatiblity layer to achieve
compilation.

S-P Chan authored on 14/06/2022 06:47:32
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,81 @@
1
+#
2
+# TLS module makefile
3
+#
4
+#
5
+# WARNING: do not run this directly, it should be run by the main Makefile
6
+
7
+include ../../Makefile.defs
8
+auto_gen=
9
+NAME=tls_wolfssl.so
10
+
11
+# set to yes when wanting to link with static libraries
12
+LIBSSL_STATIC ?= no
13
+# set to yes when wanting to link with static libraries compiled from source
14
+LIBSSL_STATIC_SRCLIB ?= no
15
+# set to the path of the folder with static libraries compiled from source
16
+LIBSSL_STATIC_SRCPATH ?= /usr/local/src/openssl
17
+
18
+ifeq ($(CROSS_COMPILE),)
19
+WOLFSSL_BUILDER=$(shell \
20
+	if pkg-config --exists wolfssl; then \
21
+		echo 'pkg-config wolfssl'; \
22
+	fi)
23
+endif
24
+
25
+ifneq ($(WOLFSSL_BUILDER),)
26
+
27
+ifneq ($(WOLFSSL_STATIC),yes)
28
+	DEFS += $(shell $(WOLFSSL_BUILDER) --cflags)
29
+	LIBS += $(shell $(WOLFSSL_BUILDER) --libs)
30
+
31
+else # $(WOLFSSL_STATIC),yes)
32
+
33
+	DEFS += -DKSR_WOLFSSL_STATIC
34
+
35
+ifneq ($(WOLFSSL_STATIC_SRCLIB),yes)
36
+	## when static libs (*.a) from packages are compiled with -fPIC
37
+	DEFS += $(shell $(WOLFSSL_BUILDER) --cflags)
38
+	LIBS += $(shell $(WOLFSSL_BUILDER) --libs-only-L)
39
+	# TODO: explore use of LIBS += -Wl,-Bstatic $(shell $(SSL_BUILDER) --libs-only-l)
40
+	LIBS += -l:libwolfssl.a -l:libz.a -l:libdl.a
41
+else
42
+	## when linking against static libs compiled from sources
43
+	DEFS += -I$(WOLFSSL_STATIC_SRCPATH)/include
44
+	LIBS += $(WOLFSSL_STATIC_SRCPATH)/libwolfssl.a
45
+endif # ifneq ($(WOLFSSL_STATIC_SRCLIB),yes)
46
+
47
+endif # ifneq ($(WOLFSSL_STATIC),yes)
48
+
49
+else # ifneq ($(SSL_BUILDER),)
50
+
51
+	DEFS += -I$(LOCALBASE)/wolfssl/include
52
+	LIBS += -L$(LOCALBASE)/lib \
53
+			-L$(LOCALBASE)/lib64  \
54
+			-lwolfssl
55
+endif # ifneq ($(SSL_BUILDER),)
56
+
57
+LIBS+= $(TLS_EXTRA_LIBS)
58
+
59
+# dcm: tls.cfg installed via local 'install-cfg' to update paths
60
+#MOD_INSTALL_CFGS=tls.cfg
61
+
62
+include ../../Makefile.modules
63
+
64
+install-tls-cert: $(cfg_prefix)/$(cfg_dir)
65
+	MAIN_NAME=$(MAIN_NAME) ./tls_cert.sh -d $(cfg_prefix)/$(cfg_dir)
66
+
67
+install-cfg:
68
+	@if ! [ -d $(cfg_prefix)/$(cfg_dir) ]; then \
69
+		mkdir -p "$(cfg_prefix)/$(cfg_dir)" ; \
70
+	fi
71
+	@$(call try_err, $(INSTALL_TOUCH) \
72
+			"$(cfg_prefix)/$(cfg_dir)tls.cfg.sample" )
73
+	@sed -e "s#\/usr/local/etc/kamailio/#$(cfg_target)#g" \
74
+			-e "s#kamailio-selfsigned#$(MAIN_NAME)-selfsigned#g" \
75
+				< ./tls.cfg > "$(cfg_prefix)/$(cfg_dir)tls.cfg.sample"
76
+	@if [ -z "${skip_cfg_install}" -a \
77
+			! -f "$(cfg_prefix)/$(cfg_dir)tls.cfg" ]; then \
78
+		mv -f "$(cfg_prefix)/$(cfg_dir)tls.cfg.sample" \
79
+						"$(cfg_prefix)/$(cfg_dir)tls.cfg" ; \
80
+	fi
81
+