diff options
Diffstat (limited to 'package/tor')
| -rw-r--r-- | package/tor/Makefile | 39 | ||||
| -rw-r--r-- | package/tor/files/tor.init | 9 | ||||
| -rw-r--r-- | package/tor/files/tor.postinst | 4 | ||||
| -rw-r--r-- | package/tor/files/torrc | 3 | ||||
| -rw-r--r-- | package/tor/patches/patch-contrib_suse_tor_sh | 11 | ||||
| -rw-r--r-- | package/tor/patches/patch-contrib_tor_sh | 11 | ||||
| -rw-r--r-- | package/tor/patches/patch-contrib_torctl | 27 | ||||
| -rw-r--r-- | package/tor/patches/patch-src_common_util_h | 23 | ||||
| -rw-r--r-- | package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_c | 14 | ||||
| -rw-r--r-- | package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_h | 14 | ||||
| -rw-r--r-- | package/tor/patches/patch-src_or_eventdns_c | 18 | ||||
| -rw-r--r-- | package/tor/patches/patch-tor_spec | 11 |
12 files changed, 63 insertions, 121 deletions
diff --git a/package/tor/Makefile b/package/tor/Makefile index 8bbdad072..39735dcd5 100644 --- a/package/tor/Makefile +++ b/package/tor/Makefile @@ -1,23 +1,28 @@ # This file is part of the OpenADK project. OpenADK is copyrighted # material, please see the LICENCE file in the top-level directory. -include ${TOPDIR}/rules.mk +include ${ADK_TOPDIR}/rules.mk PKG_NAME:= tor -PKG_VERSION:= 0.2.1.27 +PKG_VERSION:= 0.4.8.16 PKG_RELEASE:= 1 -PKG_MD5SUM:= 1719642b3f25a23c3b3843ee99be18fb -PKG_DESCR:= An anonymous Internet communication system -PKG_SECTION:= proxy -PKG_DEPENDS:= libevent libopenssl zlib libpthread -PKG_BUILDDEP:= libevent openssl zlib -PKG_URL:= http://tor.eff.org/ -PKG_SITES:= http://tor.eff.org/dist/ +PKG_HASH:= 6540dd377a120fb8e7d27530aa3b7ff72a0fa5b4f670fe1d64c987c1cfd390cb +PKG_DESCR:= anonymous internet communication system +PKG_SECTION:= net/proxy +PKG_DEPENDS:= libevent zlib libopenssl +PKG_BUILDDEP:= libevent zlib openssl +PKG_NEEDS:= threads +PKG_URL:= https://www.torproject.org/ +PKG_SITES:= https://www.torproject.org/dist/ -include ${TOPDIR}/mk/package.mk +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz -$(eval $(call PKG_template,TOR,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +include ${ADK_TOPDIR}/mk/package.mk +$(eval $(call PKG_template,TOR,tor,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +# -DNDEBUG not supported +TARGET_CPPFLAGS:= CONFIGURE_ENV+= ac_cv_libevent_normal=yes \ ac_cv_libevent_linker_option="" \ ac_cv_libevent_dir="${STAGING_TARGET_DIR}/usr" \ @@ -27,9 +32,17 @@ CONFIGURE_ENV+= ac_cv_libevent_normal=yes \ tor_cv_null_is_zero=yes \ tor_cv_unaligned_ok=yes -post-install: +CONFIGURE_ARGS+= --disable-tool-name-check + +ifeq ($(ADK_TARGET_USE_SSP),y) +CONFIGURE_ARGS+= --enable-gcc-hardening +else +CONFIGURE_ARGS+= --disable-gcc-hardening +endif + +tor-install: ${INSTALL_DIR} ${IDIR_TOR}/usr/bin ${IDIR_TOR}/etc/tor ${INSTALL_DATA} ./files/torrc ${IDIR_TOR}/etc/tor/ ${CP} ${WRKINST}/usr/bin/tor ${IDIR_TOR}/usr/bin/ -include ${TOPDIR}/mk/pkg-bottom.mk +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/tor/files/tor.init b/package/tor/files/tor.init index 58a8d4759..ed228d250 100644 --- a/package/tor/files/tor.init +++ b/package/tor/files/tor.init @@ -7,16 +7,17 @@ case $1 in autostop) ;; autostart) test x"${tor:-NO}" = x"NO" && exit 0 + test x"$tor" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start exec sh $0 start ;; start) [ -d /var/run/tor ] || mkdir -p /var/run/tor - [ -d /tmp/.tor ] || mkdir -p /tmp/.tor - chown tor:tor /tmp/.tor /var/run/tor - su - tor -c /usr/bin/tor + [ -d /etc/tor ] || mkdir -p /etc/tor + chown tor:tor /etc/tor /var/run/tor + /usr/bin/tor ;; stop) - kill $(pgrep -f /usr/bin/tor) + kill -15 $(pgrep -f /usr/bin/tor) ;; restart) sh $0 stop diff --git a/package/tor/files/tor.postinst b/package/tor/files/tor.postinst index b3bb981a1..42f8c920d 100644 --- a/package/tor/files/tor.postinst +++ b/package/tor/files/tor.postinst @@ -1,6 +1,6 @@ #!/bin/sh . $IPKG_INSTROOT/etc/functions.sh -add_rcconf tor tor NO +add_rcconf tor NO gid=$(get_next_gid) add_group tor $gid -add_user tor $(get_next_uid) $gid /tmp/.tor +add_user tor $(get_next_uid) $gid /etc/tor diff --git a/package/tor/files/torrc b/package/tor/files/torrc index b533ce04c..e29fc1c50 100644 --- a/package/tor/files/torrc +++ b/package/tor/files/torrc @@ -51,7 +51,7 @@ RunAsDaemon 1 ## The directory for keeping all the keys/etc. By default, we store ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows. -#DataDirectory /var/lib/tor +DataDirectory /etc/tor ## The port on which Tor will listen for local connections from Tor controller ## applications, as documented in control-spec.txt. NB: this feature is @@ -124,3 +124,4 @@ RunAsDaemon 1 #ExitPolicy reject *:* # middleman only -- no exits allowed PidFile /var/run/tor/tor.pid +User tor diff --git a/package/tor/patches/patch-contrib_suse_tor_sh b/package/tor/patches/patch-contrib_suse_tor_sh deleted file mode 100644 index 2bc55db33..000000000 --- a/package/tor/patches/patch-contrib_suse_tor_sh +++ /dev/null @@ -1,11 +0,0 @@ ---- tor-0.2.1.20.orig/contrib/suse/tor.sh 2009-10-15 18:16:23.000000000 +0200 -+++ tor-0.2.1.20/contrib/suse/tor.sh 2009-12-03 23:45:45.000000000 +0100 -@@ -43,7 +43,7 @@ rc_reset - # Increase open file descriptors a reasonable amount - ulimit -n 8192 - --TORCTL=/usr/local/bin/torctl -+TORCTL=/usr/bin/torctl - - # torctl will use these environment variables - TORUSER=_tor diff --git a/package/tor/patches/patch-contrib_tor_sh b/package/tor/patches/patch-contrib_tor_sh deleted file mode 100644 index 4f953b0fd..000000000 --- a/package/tor/patches/patch-contrib_tor_sh +++ /dev/null @@ -1,11 +0,0 @@ ---- tor-0.2.1.20.orig/contrib/tor.sh 2009-10-15 18:16:22.000000000 +0200 -+++ tor-0.2.1.20/contrib/tor.sh 2009-12-03 23:45:44.000000000 +0100 -@@ -26,7 +26,7 @@ fi - # Increase open file descriptors a reasonable amount - ulimit -n 8192 - --TORCTL=/usr/local/bin/torctl -+TORCTL=/usr/bin/torctl - - # torctl will use these environment variables - TORUSER=_tor diff --git a/package/tor/patches/patch-contrib_torctl b/package/tor/patches/patch-contrib_torctl deleted file mode 100644 index b531711db..000000000 --- a/package/tor/patches/patch-contrib_torctl +++ /dev/null @@ -1,27 +0,0 @@ ---- tor-0.2.1.20.orig/contrib/torctl 2009-10-15 18:16:22.000000000 +0200 -+++ tor-0.2.1.20/contrib/torctl 2009-12-03 23:45:44.000000000 +0100 -@@ -24,19 +24,19 @@ - EXEC=tor - # - # the path to your binary, including options if necessary --TORBIN="/usr/local/bin/$EXEC" -+TORBIN="/usr/bin/$EXEC" - # - # the path to the configuration file --TORCONF="/usr/local/etc/tor/torrc" -+TORCONF="/etc/tor/torrc" - # - # the path to your PID file --PIDFILE="/usr/local/var/run/tor/tor.pid" -+PIDFILE="/var/run/tor/tor.pid" - # - # The path to the log file --LOGFILE="/usr/local/var/log/tor/tor.log" -+LOGFILE="/var/log/tor/tor.log" - # - # The path to the datadirectory --TORDATA="/usr/local/var/lib/tor" -+TORDATA="/var/lib/tor" - # - TORARGS="--pidfile $PIDFILE --log \"notice file $LOGFILE\" --runasdaemon 1" - TORARGS="$TORARGS --datadirectory $TORDATA" diff --git a/package/tor/patches/patch-src_common_util_h b/package/tor/patches/patch-src_common_util_h deleted file mode 100644 index f6607ffc1..000000000 --- a/package/tor/patches/patch-src_common_util_h +++ /dev/null @@ -1,23 +0,0 @@ ---- tor-0.2.1.20.orig/src/common/util.h 2009-06-19 08:13:53.000000000 +0200 -+++ tor-0.2.1.20/src/common/util.h 2009-12-03 23:47:21.000000000 +0100 -@@ -24,20 +24,6 @@ - #define O_TEXT 0 - #endif - --/* Replace assert() with a variant that sends failures to the log before -- * calling assert() normally. -- */ --#ifdef NDEBUG --/* Nobody should ever want to build with NDEBUG set. 99% of our asserts will -- * be outside the critical path anyway, so it's silly to disable bug-checking -- * throughout the entire program just because a few asserts are slowing you -- * down. Profile, optimize the critical path, and keep debugging on. -- * -- * And I'm not just saying that because some of our asserts check -- * security-critical properties. -- */ --#error "Sorry; we don't support building with NDEBUG." --#endif - - /** Like assert(3), but send assertion failures to the log as well as to - * stderr. */ diff --git a/package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_c b/package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_c new file mode 100644 index 000000000..e15990084 --- /dev/null +++ b/package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_c @@ -0,0 +1,14 @@ +--- tor-0.4.8.10.orig/src/lib/crypt_ops/crypto_openssl_mgt.c 2023-12-08 19:49:19.000000000 +0100 ++++ tor-0.4.8.10/src/lib/crypt_ops/crypto_openssl_mgt.c 2024-04-07 11:39:44.453246186 +0200 +@@ -40,6 +40,11 @@ ENABLE_GCC_WARNING("-Wredundant-decls") + + #include <string.h> + ++#ifdef OPENSSL_NO_ENGINE ++/* Android's OpenSSL seems to have removed all of its Engine support. */ ++#define DISABLE_ENGINES ++#endif ++ + #ifndef NEW_THREAD_API + /** A number of preallocated mutexes for use by OpenSSL. */ + static tor_mutex_t **openssl_mutexes_ = NULL; diff --git a/package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_h b/package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_h new file mode 100644 index 000000000..49f6d2314 --- /dev/null +++ b/package/tor/patches/patch-src_lib_crypt_ops_crypto_openssl_mgt_h @@ -0,0 +1,14 @@ +--- tor-0.4.8.10.orig/src/lib/crypt_ops/crypto_openssl_mgt.h 2023-12-08 19:49:19.000000000 +0100 ++++ tor-0.4.8.10/src/lib/crypt_ops/crypto_openssl_mgt.h 2024-04-07 11:39:44.453246186 +0200 +@@ -49,11 +49,6 @@ + #define OPENSSL_V_SERIES(a,b,c) \ + OPENSSL_VER((a),(b),(c),0,0) + +-#ifdef OPENSSL_NO_ENGINE +-/* Android's OpenSSL seems to have removed all of its Engine support. */ +-#define DISABLE_ENGINES +-#endif +- + #if OPENSSL_VERSION_NUMBER >= OPENSSL_VER(1,1,0,0,5) + /* OpenSSL as of 1.1.0pre4 has an "new" thread API, which doesn't require + * setting up various callbacks. diff --git a/package/tor/patches/patch-src_or_eventdns_c b/package/tor/patches/patch-src_or_eventdns_c deleted file mode 100644 index 138469f09..000000000 --- a/package/tor/patches/patch-src_or_eventdns_c +++ /dev/null @@ -1,18 +0,0 @@ ---- tor-0.2.1.20.orig/src/or/eventdns.c 2009-09-17 08:02:18.000000000 +0200 -+++ tor-0.2.1.20/src/or/eventdns.c 2009-12-03 23:49:27.000000000 +0100 -@@ -375,7 +375,6 @@ error_is_eagain(int err) - #define TOLOWER(c) TOR_TOLOWER(c) - #define TOUPPER(c) TOR_TOUPPER(c) - --#ifndef NDEBUG - static const char * - debug_ntoa(u32 address) - { -@@ -404,7 +403,6 @@ debug_ntop(const struct sockaddr *sa) - } - return "<unknown>"; - } --#endif - - static evdns_debug_log_fn_type evdns_log_fn = NULL; - diff --git a/package/tor/patches/patch-tor_spec b/package/tor/patches/patch-tor_spec deleted file mode 100644 index a4bc4adaa..000000000 --- a/package/tor/patches/patch-tor_spec +++ /dev/null @@ -1,11 +0,0 @@ ---- tor-0.2.1.20.orig/tor.spec 2009-10-15 18:16:22.000000000 +0200 -+++ tor-0.2.1.20/tor.spec 2009-12-03 23:45:44.000000000 +0100 -@@ -101,7 +101,7 @@ - %endif - - %if %{!?_localstatedir:1}%{?_localstatedir:0} --%define _localstatedir /usr/local/var -+%define _localstatedir /var - %endif - - ## Package information |
