mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
stunnel: Bring it back at v5.10
From: Michael Haas <haas@computerlinguist.org> * init script no longer creates certificates (consider client mode as use case) * patches/010_fix_getnameinfo.patch: Fix getnameinfo signature * patches/011_disable_ssp_linking.patch: Disable -fstack-protector as it is not always available in OpenWRT * old patches (in oldpackages) no longer necessary * remove libwrap dependency * remove libpthread dependency * respect CONFIG_IPV6 * init script uses procd * sample stunnel.conf runs in client mode - prevents start failure, does not require cert Possible enhancement: automatically generate certificate as done in uhttpd. However, as client mode is a possible use case, I'd rather not. Additionally, stunnel may use several certs with user-defined locations and we can't easily set a cert location via command-line args. The package is based on https://sites.google.com/site/twisteroidambassador/openwrt/stunnel Signed-off-by: Michael Haas <haas@computerlinguist.org>
This commit is contained in:
committed by
Michael Haas
parent
b59def2299
commit
f6927350e4
@@ -0,0 +1,25 @@
|
||||
--- a/src/prototypes.h
|
||||
+++ b/src/prototypes.h
|
||||
@@ -559,7 +559,7 @@ extern GETNAMEINFO s_getnameinfo;
|
||||
|
||||
#endif /* USE_WIN32 */
|
||||
|
||||
-int getnameinfo(const struct sockaddr *, int, char *, int, char *, int, int);
|
||||
+int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, unsigned int);
|
||||
|
||||
#endif /* !defined HAVE_GETNAMEINFO */
|
||||
|
||||
--- a/src/resolver.c
|
||||
+++ b/src/resolver.c
|
||||
@@ -535,8 +535,9 @@ const char *s_gai_strerror(int err) {
|
||||
/* implementation is limited to functionality needed by stunnel */
|
||||
|
||||
#ifndef HAVE_GETNAMEINFO
|
||||
-int getnameinfo(const struct sockaddr *sa, int salen,
|
||||
- char *host, int hostlen, char *serv, int servlen, int flags) {
|
||||
+int getnameinfo(const struct sockaddr *sa, socklen_t salen,
|
||||
+ char *host, socklen_t hostlen, char *serv, socklen_t servlen,
|
||||
+ unsigned int flags) {
|
||||
|
||||
#if defined(USE_WIN32) && !defined(_WIN32_WCE)
|
||||
if(s_getnameinfo)
|
||||
@@ -0,0 +1,140 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5646,66 +5646,66 @@ done
|
||||
|
||||
|
||||
|
||||
-for flag in -fstack-protector; do
|
||||
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
|
||||
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
|
||||
-if eval \${$as_CACHEVAR+:} false; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
-
|
||||
- ax_check_save_flags=$CFLAGS
|
||||
- CFLAGS="$CFLAGS $flag"
|
||||
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
-/* end confdefs.h. */
|
||||
-
|
||||
-int
|
||||
-main ()
|
||||
-{
|
||||
-
|
||||
- ;
|
||||
- return 0;
|
||||
-}
|
||||
-_ACEOF
|
||||
-if ac_fn_c_try_compile "$LINENO"; then :
|
||||
- eval "$as_CACHEVAR=yes"
|
||||
-else
|
||||
- eval "$as_CACHEVAR=no"
|
||||
-fi
|
||||
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
- CFLAGS=$ax_check_save_flags
|
||||
-fi
|
||||
-eval ac_res=\$$as_CACHEVAR
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
-$as_echo "$ac_res" >&6; }
|
||||
-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
|
||||
- if ${CFLAGS+:} false; then :
|
||||
- case " $CFLAGS " in
|
||||
- *" $flag "*)
|
||||
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5
|
||||
- (: CFLAGS already contains $flag) 2>&5
|
||||
- ac_status=$?
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
- test $ac_status = 0; }
|
||||
- ;;
|
||||
- *)
|
||||
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5
|
||||
- (: CFLAGS="$CFLAGS $flag") 2>&5
|
||||
- ac_status=$?
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
- test $ac_status = 0; }
|
||||
- CFLAGS="$CFLAGS $flag"
|
||||
- ;;
|
||||
- esac
|
||||
-else
|
||||
- CFLAGS="$flag"
|
||||
-fi
|
||||
-
|
||||
-else
|
||||
- :
|
||||
-fi
|
||||
-
|
||||
-done
|
||||
+#for flag in -fstack-protector; do
|
||||
+# as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
|
||||
+#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
|
||||
+#$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
|
||||
+#if eval \${$as_CACHEVAR+:} false; then :
|
||||
+# $as_echo_n "(cached) " >&6
|
||||
+#else
|
||||
+#
|
||||
+# ax_check_save_flags=$CFLAGS
|
||||
+# CFLAGS="$CFLAGS $flag"
|
||||
+# cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+#/* end confdefs.h. */
|
||||
+
|
||||
+#int
|
||||
+#main ()
|
||||
+#{
|
||||
+#
|
||||
+# ;
|
||||
+# return 0;
|
||||
+#}
|
||||
+#_ACEOF
|
||||
+#if ac_fn_c_try_compile "$LINENO"; then :
|
||||
+# eval "$as_CACHEVAR=yes"
|
||||
+#else
|
||||
+# eval "$as_CACHEVAR=no"
|
||||
+#fi
|
||||
+#rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
+# CFLAGS=$ax_check_save_flags
|
||||
+#fi
|
||||
+#eval ac_res=\$$as_CACHEVAR
|
||||
+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
+#$as_echo "$ac_res" >&6; }
|
||||
+#if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
|
||||
+# if ${CFLAGS+:} false; then :
|
||||
+# case " $CFLAGS " in
|
||||
+# *" $flag "*)
|
||||
+# { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5
|
||||
+# (: CFLAGS already contains $flag) 2>&5
|
||||
+# ac_status=$?
|
||||
+# $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
+# test $ac_status = 0; }
|
||||
+# ;;
|
||||
+# *)
|
||||
+# { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5
|
||||
+# (: CFLAGS="$CFLAGS $flag") 2>&5
|
||||
+# ac_status=$?
|
||||
+# $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
+# test $ac_status = 0; }
|
||||
+# CFLAGS="$CFLAGS $flag"
|
||||
+# ;;
|
||||
+# esac
|
||||
+#else
|
||||
+# CFLAGS="$flag"
|
||||
+#fi
|
||||
+#
|
||||
+#else
|
||||
+# :
|
||||
+#fi
|
||||
+#
|
||||
+#done
|
||||
|
||||
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -71,7 +71,7 @@ AX_APPEND_COMPILE_FLAGS([-Wformat=2])
|
||||
AX_APPEND_COMPILE_FLAGS([-Wconversion])
|
||||
AX_APPEND_COMPILE_FLAGS([-Wno-long-long])
|
||||
AX_APPEND_COMPILE_FLAGS([-Wno-deprecated-declarations])
|
||||
-AX_APPEND_COMPILE_FLAGS([-fstack-protector])
|
||||
+#AX_APPEND_COMPILE_FLAGS([-fstack-protector])
|
||||
AX_APPEND_COMPILE_FLAGS([-fPIE])
|
||||
AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2])
|
||||
AX_APPEND_LINK_FLAGS([-fPIE -pie])
|
||||
Reference in New Issue
Block a user