From 6d024bc0aca2995cb96251226f3e30bdd3b845a2 Mon Sep 17 00:00:00 2001 From: haarp <781030+haarp@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:46:49 +0200 Subject: [PATCH] Enable hardware acceleration in TOR On suitable hardware platforms, FreeBSD/OPNsense supports hardware acceleration for crypto. Verified with https://stackoverflow.com/a/28614159/5424487 TOR however is not set up to make use of this. This change should enable it. From https://www.freebsd.org/cgi/man.cgi?tor(1): ``` HardwareAccel 0|1 If non-zero, try to use built-in (static) crypto hardware acceleration when available. Can not be changed while tor is running. (Default: 0) ``` Because TOR (or rather OpenSSL) will fall back to software crypto when hardware crypto is not available (unless `AccelName` is also set), i see no need to make this flag configurable in the web UI, making this a very trivial PR :) --- security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc b/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc index 04ccca9de..2f8ab8a10 100644 --- a/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc +++ b/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc @@ -117,6 +117,8 @@ HidServAuth {{ service.onion_service }} {{ service.auth_cookie }} MaxMemInQueues {{ OPNsense.tor.general.max_memory_in_queues }} MB {% endif %} +HardwareAccel 1 + {% if helpers.exists('OPNsense.tor.hiddenservice') and helpers.exists('OPNsense.tor.hiddenserviceacl') and helpers.exists('OPNsense.tor.hiddenserviceacl.hiddenserviceacl') %} ############### This section is just for location-hidden services ###