Skip to content

Commit

Permalink
curl: update to version 8.7.1
Browse files Browse the repository at this point in the history
This commits updates the contrib sources to version 8.7.1.

This version requires more random entropy as it queries OpenSSL
about the current random state and will bail if it is not sufficient.
Doubling the content of the '<inline>' VFS plugin as used in static
configurations seems satisfactory.

Furthermore DNS resolving needs a configured '<pipe>' plugin to work
properly.

Fixes genodelabs#5184.
  • Loading branch information
cnuke committed Apr 15, 2024
1 parent 7d2e605 commit 5957f64
Show file tree
Hide file tree
Showing 15 changed files with 640 additions and 1,230 deletions.
6 changes: 5 additions & 1 deletion repos/dde_linux/recipes/raw/test-wg_reconnect/dynamic.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<start name="fetchurl" caps="200">
<resource name="RAM" quantum="10M"/>
<config>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"
pipe="/pipe"/>
<vfs>
<dir name="dev">
<log/>
Expand All @@ -40,6 +41,9 @@
<dir name="socket">
<lwip dhcp="yes"/>
</dir>
<dir name="pipe">
<pipe/>
</dir>
<dir name="out">
<ram/>
</dir>
Expand Down
1 change: 1 addition & 0 deletions repos/dde_linux/run/wg_reconnect.run
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ lappend depot_archives [depot_user]/src/[rtc_drv_binary_name]
lappend depot_archives [depot_user]/src/vfs
lappend depot_archives [depot_user]/src/vfs_jitterentropy
lappend depot_archives [depot_user]/src/vfs_lwip
lappend depot_archives [depot_user]/src/vfs_pipe
lappend depot_archives [depot_user]/src/wireguard
lappend depot_archives [depot_user]/src/zlib

Expand Down
1 change: 1 addition & 0 deletions repos/gems/run/depot_download.run
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/fs_rom \
[depot_user]/src/vfs \
[depot_user]/src/vfs_lxip \
[depot_user]/src/vfs_pipe \
[depot_user]/src/fetchurl \
[depot_user]/src/libc \
[depot_user]/src/libssh \
Expand Down
9 changes: 8 additions & 1 deletion repos/gems/src/app/depot_download_manager/gen_fetchurl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void Depot_download_manager::gen_fetchurl_start_content(Xml_generator &xml,
xml.attribute("stdout", "/dev/log");
xml.attribute("stderr", "/dev/log");
xml.attribute("rtc", "/dev/rtc");
xml.attribute("pipe", "/pipe");
xml.attribute("socket", "/socket");
});
xml.node("report", [&] {
Expand All @@ -53,10 +54,15 @@ void Depot_download_manager::gen_fetchurl_start_content(Xml_generator &xml,
});
xml.node("inline", [&] {
xml.attribute("name", "random");
String<64> entropy("01234567890123456789");
String<64> entropy("01234567890123456789"
"01234567890123456789");
xml.append(entropy.string());
});
});
xml.node("dir", [&] {
xml.attribute("name", "pipe");
xml.node("pipe", [&] { });
});
xml.node("fs", [&] {
xml.attribute("label", "tcpip"); });
});
Expand Down Expand Up @@ -106,6 +112,7 @@ void Depot_download_manager::gen_fetchurl_start_content(Xml_generator &xml,
gen_parent_rom_route(xml, "libssl.lib.so");
gen_parent_rom_route(xml, "libcrypto.lib.so");
gen_parent_rom_route(xml, "vfs.lib.so");
gen_parent_rom_route(xml, "vfs_pipe.lib.so");
gen_parent_rom_route(xml, "zlib.lib.so");
gen_parent_route<Cpu_session> (xml);
gen_parent_route<Pd_session> (xml);
Expand Down
1 change: 1 addition & 0 deletions repos/gems/src/app/sculpt_manager/runtime/update.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void Sculpt::gen_update_start_content(Xml_generator &xml)
gen_parent_rom_route(xml, "vfs");
gen_parent_rom_route(xml, "lxip.lib.so");
gen_parent_rom_route(xml, "vfs_lxip.lib.so");
gen_parent_rom_route(xml, "vfs_pipe.lib.so");
gen_parent_rom_route(xml, "posix.lib.so");
gen_parent_rom_route(xml, "libssh.lib.so");
gen_parent_rom_route(xml, "libssl.lib.so");
Expand Down
49 changes: 26 additions & 23 deletions repos/libports/lib/mk/curl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ LIB_SRC_DIR := $(CURL_PORT_DIR)/src/lib/curl/lib

SRC_C = \
altsvc.c \
amigaos.c \
asyn-ares.c \
asyn-thread.c \
base64.c \
bufq.c \
bufref.c \
cf-h1-proxy.c \
cf-h2-proxy.c \
cf-haproxy.c \
cf-https-connect.c \
cf-socket.c \
cfilters.c \
conncache.c \
connect.c \
content_encoding.c \
cookie.c \
curl_addrinfo.c \
curl_ctype.c \
curl_des.c \
curl_endian.c \
curl_fnmatch.c \
Expand All @@ -27,11 +32,15 @@ SRC_C = \
curl_range.c \
curl_rtmp.c \
curl_sasl.c \
curl_sha512_256.c \
curl_sspi.c \
curl_threads.c \
curl_trc.c \
cw-out.c \
dict.c \
doh.c \
dotdot.c \
dynbuf.c \
dynhds.c \
easy.c \
escape.c \
file.c \
Expand All @@ -43,21 +52,23 @@ SRC_C = \
getinfo.c \
gopher.c \
hash.c \
headers.c \
hmac.c \
hostasyn.c \
hostcheck.c \
hostip.c \
hostip4.c \
hostip6.c \
hostsyn.c \
hsts.c \
http.c \
http1.c \
http2.c \
http_chunks.c \
http_digest.c \
http_negotiate.c \
http_ntlm.c \
http_proxy.c \
idn_win32.c \
idn.c \
if2ip.c \
imap.c \
inet_ntop.c \
Expand All @@ -73,8 +84,8 @@ SRC_C = \
mqtt.c \
multi.c \
netrc.c \
non-ascii.c \
nonblock.c \
noproxy.c \
openldap.c \
parsedate.c \
pingpong.c \
Expand All @@ -83,8 +94,8 @@ SRC_C = \
psl.c \
rand.c \
rename.c \
request.c \
rtsp.c \
security.c \
select.c \
sendf.c \
setopt.c \
Expand All @@ -107,11 +118,11 @@ SRC_C = \
system_win32.c \
telnet.c \
tftp.c \
timediff.c \
timeval.c \
transfer.c \
url.c \
urlapi.c \
vauth/cleartext.c \
vauth/cram.c \
vauth/digest.c \
vauth/digest_sspi.c \
Expand All @@ -124,27 +135,19 @@ SRC_C = \
vauth/spnego_sspi.c \
vauth/vauth.c \
version.c \
vquic/ngtcp2.c \
vquic/quiche.c \
vquic/curl_ngtcp2.c \
vquic/curl_quiche.c \
vssh/libssh.c \
vssh/libssh2.c \
vssh/wolfssh.c \
vtls/bearssl.c \
vtls/gskit.c \
vtls/gtls.c \
vtls/mbedtls.c \
vtls/mbedtls_threadlock.c \
vtls/mesalink.c \
vtls/nss.c \
vtls/hostcheck.c \
vtls/keylog.c \
vtls/openssl.c \
vtls/schannel.c \
vtls/schannel_verify.c \
vtls/sectransp.c \
vtls/vtls.c \
vtls/wolfssl.c \
warnless.c \
wildcard.c \
x509asn1.c \
vtls/x509asn1.c \
warnless.c
# end of SRC_C

CC_OPT += -DHAVE_CONFIG_H -DBUILDING_LIBCURL=1
Expand Down
5 changes: 5 additions & 0 deletions repos/libports/lib/symbols/curl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ curl_easy_cleanup T
curl_easy_duphandle T
curl_easy_escape T
curl_easy_getinfo T
curl_easy_header T
curl_easy_init T
curl_easy_nextheader T
curl_easy_pause T
curl_easy_perform T
curl_easy_recv T
Expand All @@ -23,6 +25,7 @@ curl_global_cleanup T
curl_global_init T
curl_global_init_mem T
curl_global_sslset T
curl_global_trace T
curl_maprintf T
curl_mfprintf T
curl_mime_addpart T
Expand All @@ -44,6 +47,7 @@ curl_multi_add_handle T
curl_multi_assign T
curl_multi_cleanup T
curl_multi_fdset T
curl_multi_get_handles T
curl_multi_info_read T
curl_multi_init T
curl_multi_perform T
Expand Down Expand Up @@ -78,5 +82,6 @@ curl_url_cleanup T
curl_url_dup T
curl_url_get T
curl_url_set T
curl_url_strerror T
curl_version T
curl_version_info T
2 changes: 1 addition & 1 deletion repos/libports/ports/curl.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b2103a900cd655abca670fc02d1574be4785585a
1394305484ec022e78dfe5c85c87f5bfd8ab2980
8 changes: 4 additions & 4 deletions repos/libports/ports/curl.port
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
LICENSE := MIT
DOWNLOADS := curl.archive
VERSION := 7.70.0
VERSION := 8.7.1

URL(curl) := http://curl.haxx.se/download/curl-$(VERSION).tar.gz
SHA(curl) := ca2feeb8ef13368ce5d5e5849a5fd5e2dd4755fecf7d8f0cc94000a4206fb8e7
URL(curl) := https://curl.se/download/curl-$(VERSION).tar.gz
SHA(curl) := f91249c87f68ea00cf27c44fdfa5a78423e41e71b7d408e5901a9896d905c495
SIG(curl) := ${URL(curl)}.asc
KEY(curl) := daniel@haxx.se
DIR(curl) := src/lib/curl

PATCHES := $(addprefix src/lib/curl/,no_socketpair.patch max_write_size.patch)
PATCHES := $(addprefix src/lib/curl/,curl_setup.patch max_write_size.patch)

DIRS := include
DIR_CONTENT(include) = src/lib/curl/include/curl
Expand Down
7 changes: 5 additions & 2 deletions repos/libports/run/fetchurl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/report_rom \
[depot_user]/src/vfs \
[depot_user]/src/vfs_[ip_stack] \
[depot_user]/src/vfs_jitterentropy \
[depot_user]/src/vfs_pipe \
[depot_user]/src/zlib

install_config {
Expand Down Expand Up @@ -135,12 +137,13 @@ install_config {
<vfs>
<dir name="dev">
<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
<inline name="random">01234567890123456789</inline>
<inline name="random">0123456789012345678901234567890123456789</inline>
</dir>
<dir name="pipe"> <pipe/> </dir>
<dir name="socket"> } [socket_fs_plugin] { </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"
rng="/dev/random" socket="/socket"/>
rng="/dev/random" socket="/socket" pipe="/pipe"/>
<fetch url="https://genode.org/about/LICENSE" path="/dev/log" retry="3"/>
</config>
</start>
Expand Down
18 changes: 10 additions & 8 deletions repos/libports/src/app/fetchurl/component.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static size_t write_callback(char *ptr,
void *userdata);

static int progress_callback(void *userdata,
double dltotal, double dlnow,
double ultotal, double ulnow);
curl_off_t dltotal, curl_off_t dlnow,
curl_off_t ultotal, curl_off_t ulnow);


class Fetchurl::Fetch : Genode::List<Fetch>::Element
Expand Down Expand Up @@ -262,6 +262,8 @@ struct Fetchurl::Main
}
_fetch.fd = fd;

curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L);

curl_easy_setopt(_curl, CURLOPT_URL, _fetch.url.string());
curl_easy_setopt(_curl, CURLOPT_FOLLOWLOCATION, true);

Expand All @@ -272,7 +274,7 @@ struct Fetchurl::Main
curl_easy_setopt(_curl, CURLOPT_WRITEDATA, &_fetch);

curl_easy_setopt(_curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, progress_callback);
User_data ud {
.timer = _timer,
.last_ms = _timer.curr_time().trunc_to_plain_ms(),
Expand Down Expand Up @@ -354,8 +356,8 @@ static size_t write_callback(char *ptr,


static int progress_callback(void *userdata,
double dltotal, double dlnow,
double ultotal, double ulnow)
curl_off_t dltotal, curl_off_t dlnow,
curl_off_t ultotal, curl_off_t ulnow)
{
(void)ultotal;
(void)ulnow;
Expand All @@ -377,16 +379,16 @@ static int progress_callback(void *userdata,
* the max timeout value, we will abort the download attempt.
*/

if (dlnow == fetch.dlnow) {
if ((double)dlnow == fetch.dlnow) {
ud.curr_timeout.value += diff.value;
}
else {
ud.curr_timeout.value = 0;
}
bool const timeout = ud.curr_timeout.value >= ud.max_timeout.value;

fetch.dltotal = dltotal;
fetch.dlnow = dlnow;
fetch.dltotal = (double)dltotal;
fetch.dlnow = (double)dlnow;
fetch.timeout = timeout;
fetch.main._schedule_report();

Expand Down
9 changes: 0 additions & 9 deletions repos/libports/src/lib/curl/no_socketpair.patch

This file was deleted.

0 comments on commit 5957f64

Please sign in to comment.