kernelkit / infix

Linux :yellow_heart: NETCONF = Infix
https://kernelkit.org
GNU General Public License v2.0
48 stars 12 forks source link

rauc: fix scp/sftp upgrades (pw handling) #523

Open troglobit opened 3 months ago

troglobit commented 3 months ago

RAUC limits the capabilities of libcurl, which it uses internally, to only recognize HTTP/HTTPS/SFTP/FTP as "remote" protocols. This means that protocols like SCP and TFTP are not accepted by RAUC, though supported by libcurl.

Culprit: https://github.com/rauc/rauc/blob/2666da0ce1fcb0206b4beaf5f1e8e883434f8f51/src/bundle.c#L1314

We should patch this.

troglobit commented 3 months ago

TFTP support added in https://github.com/kernelkit/infix/pull/223

troglobit commented 3 months ago

Found the root cause for the scp problems, libcurl use libssh2 for SSH (SCP/SFTP) access. Not to be confused with libssh, which libnetconf2 uses.

root@infix-00-00-00:~# curl -V
curl 8.1.2 (x86_64-buildroot-linux-gnu) libcurl/8.1.2 OpenSSL/1.1.1u zlib/1.2.13 libssh2/1.10.0
Release-Date: 2023-05-30
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Largefile libz SSL threadsafe TLS-SRP UnixSockets

Only thing blocking this issue is adding a -u user[:pass] option to rauc, because from what I can tell, libcurl/curl does not support scp://user@address URIs.

troglobit commented 3 months ago

scp/sftp support added to curl in https://github.com/kernelkit/infix/pull/300