termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.29k stars 3.06k forks source link

[Bug]: Transmission-cli crashes after openssl upgrade #10814

Closed deveee closed 2 years ago

deveee commented 2 years ago

Problem description

Transmission console application crashes frequently with following error:

[2022-05-25 22:00:09.277] tr_crypto_utils: OpenSSL error: error:0308010C:digital envelope routines::unsupported                           
Segmentation fault

What steps will reproduce the bug?

Try download any torrent with transmission-cli and wait.

What is the expected behavior?

No response

System information

termux-info:

Termux Variables:                             
TERMUX_API_VERSION=0.50.1                     
TERMUX_APK_RELEASE=F_DROID                    
TERMUX_APP_PID=10312                          
TERMUX_IS_DEBUGGABLE_BUILD=0                  
TERMUX_MAIN_PACKAGE_FORMAT=debian   
TERMUX_VERSION=0.118.0                        
Packages CPU architecture:                    
aarch64                                       
Subscribed repositories:                      
# sources.list                                
deb https://grimler.se/termux-packages-24/ stable main                                      
# root-repo (sources.list.d/root.list)        
deb https://packages.termux.org/apt/termux-root root stable                                 
# x11-repo (sources.list.d/x11.list)          
deb https://packages.termux.org/apt/termux-x11 x11 main                                     
Updatable packages:                           
apt/stable 2.5.0 aarch64 [upgradable from: 2.4.5]                                  
gtk-update-icon-cache/x11 3.24.34 aarch64 [upgradable from: 3.24.33-1]                      
gtk3/x11 3.24.34 aarch64 [upgradable from: 3.24.33-1]                                       
harfbuzz/stable 4.3.0 aarch64 [upgradable from: 4.2.1]                                      
librsvg/stable 2.54.3 aarch64 [upgradable from: 2.54.1]                                     
mesa/x11 22.1.0 aarch64 [upgradable from: 22.0.3]                                           
ncurses-ui-libs/stable 6.3-1 aarch64 [upgradable from: 6.3]                                 
ncurses/stable 6.3-1 aarch64 [upgradable from: 6.3]                                         
openjdk-17/stable 17.0-22 aarch64 [upgradable from: 17.0-21]                                
termux-tools/stable,stable 0.181 all [upgradable from: 0.177]                               
tor/stable 0.4.6.10-4 aarch64 [upgradable from: 0.4.6.10-3]                                 
Android version:                              
9                                             
Kernel build information:                     
Linux localhost 4.4.223-lineageOS+ #9 SMP PREEMPT Fri Nov 6 10:04:07 CET 2020 armv8l 
AndroidDevice manufacturer:                          
asus                                          
Device model:                                 
ASUS_X01BD
2096779623 commented 2 years ago

Please provide termux-info output.

Try: pkg upgr -y.

deveee commented 2 years ago

Packages were mostly updated but now I checked after pkg upgr and the crash happens too.

And termux-info output was in previous comment, it was just copied without newlines from termux. I added these newlines for better readability.

And you can try it on some real files, for example transmission-cli https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/debian-11.3.0-amd64-netinst.iso.torrent

2096779623 commented 2 years ago
~ $ transmission-cli https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/debian-11.3.0-amd64-netinst.iso.torrent
transmission-cli 3.00 (bb6b5a062e)
[2022-05-27 12:19:07.952] Transmission 3.00 (bb6b5a062e) started
[2022-05-27 12:19:07.954] RPC Server: Adding address to whitelist: 127.0.0.1
[2022-05-27 12:19:07.954] RPC Server: Adding address to whitelist: ::1
[2022-05-27 12:19:07.958] DHT: Generating new id
[2022-05-27 12:19:07.996] web: will verify tracker certs using envvar CURL_CA_BUNDLE: none
[2022-05-27 12:19:07.996] web: NB: this only works if you built against libcurl with openssl or gnutls, NOT nss
[2022-05-27 12:19:07.996] web: NB: invalid certs will show up as 'Could not connect to tracker' like many other errors
[2022-05-27 12:19:10.610] Port Forwarding: Not forwarded
[2022-05-27 12:19:11.036] Saved "/data/data/com.termux/files/home/.config/transmission/torrents/b111813ce60f42919734823df5ec20bd1e04e7f7.torrent"
[2022-05-27 12:19:11.036] debian-11.3.0-amd64-netinst.iso: Pausing
[2022-05-27 12:19:11.036] Changed open file limit from 32768 to 1024
[2022-05-27 12:19:11.044] Saved "/data/data/com.termux/files/home/.config/transmission/resume/b111813ce60f42919734823df5ec20bd1e04e7f7.resume"
[2022-05-27 12:19:11.045] debian-11.3.0-amd64-netinst.iso: Queued for verification
[2022-05-27 12:19:11.046] debian-11.3.0-amd64-netinst.iso: Verifying torrent
Progress: 0.0%, dl from 0 of 6 peers (0 kB/s), ul to 0 (0 kB/s) [None]            
Stopping torrent...
[2022-05-27 12:19:17.264] Saved "/data/data/com.termux/files/home/.config/transmission/settings.json"

[2022-05-27 12:19:17.266] debian-11.3.0-amd64-netinst.iso: Pausing
[2022-05-27 12:19:17.272] Saved "/data/data/com.termux/files/home/.config/transmission/resume/b111813ce60f42919734823df5ec20bd1e04e7f7.resume"
[2022-05-27 12:19:17.274] DHT: Not saving nodes, DHT not ready
[2022-05-27 12:19:17.274] Port Forwarding: Stopped
[2022-05-27 12:19:17.275] debian-11.3.0-amd64-netinst.iso: Removing torrent
[2022-05-27 12:19:17.275] debian-11.3.0-amd64-netinst.iso: Pausing
~ $ termux-info
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.ustc.edu.cn/termux/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.ustc.edu.cn/termux/apt/termux-x11 x11 main
# sources.list.d/its.list
deb https://its-pointless.github.io/files/24  termux extras
Updatable packages:
termux-tools/stable 0.182 all [upgradable from: 0.181]
termux-tools version:
0.181
Android version:
10
Kernel build information:
Linux localhost 4.9.206-perf #2 SMP PREEMPT Fri Jul 3 15:12:14 JST 2020 aarch64 Android
Device manufacturer:
SHARP
Device model:
SHV43
~ $ pkg list-installed|grep openssl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

openssl-1.1/stable,now 1.1.1o aarch64 [installed,automatic]
openssl/stable,now 3.0.3 aarch64 [installed]

~ $ pkg info transmission
Package: transmission
Version: 3.00-7
Maintainer: @termux
Installed-Size: 3490 kB
Depends: libcurl, libevent, miniupnpc, openssl
Homepage: https://transmissionbt.com/
Download-Size: 560 kB
APT-Sources: https://mirrors.ustc.edu.cn/termux/apt/termux-main stable/main aarch64 Packages
Description: Easy, lean and powerful BitTorrent client
alive4ever commented 2 years ago

transmission depends on RC4 algorithm which is moved to legacy provider on OpenSSL 3 and it is not loaded by default. There is a commit on the git master branch that transmission is switching to inbuilt RC4 implementation.

As a workaround, legacy_provider can be enabled via openssl.cnf so that RC4 algoriithm will be available for transmission.

--- /data/data/com.termux/files/usr/etc/tls/openssl.cnf.orig    2022-02-26 04:33:43.000000000 +0000
+++ /data/data/com.termux/files/usr/etc/tls/openssl.cnf 2022-06-16 06:44:41.584167322 +0000
@@ -57,4 +57,5 @@
 [provider_sect]
 default = default_sect
+legacy = legacy_provider
 # The fips section name should match the section name inside the
 # included fipsmodule.cnf.
@@ -70,5 +71,8 @@
 # problems including inability to remotely access the system.
 [default_sect]
-# activate = 1
+activate = 1
+
+[legacy_provider]
+activate=1
deveee commented 2 years ago

I just updated the package and I successfully downloaded that debian iso from my previous comment, so it seems that it's now fixed.