diff options
author | Alexander M Pickering <alex@cogarr.net> | 2024-11-21 12:30:55 -0600 |
---|---|---|
committer | Alexander M Pickering <alex@cogarr.net> | 2024-11-21 12:30:55 -0600 |
commit | fa9d3193045dac3cd2931241243f6c36ffd6dd38 (patch) | |
tree | 68f570bff6b2eb378d9623577ea9f5a6bb9222d4 | |
parent | 1764d1061bd0500cd3466d4e2c3678a855f0739b (diff) | |
download | busybox-w32-packaging-fa9d3193045dac3cd2931241243f6c36ffd6dd38.tar.gz busybox-w32-packaging-fa9d3193045dac3cd2931241243f6c36ffd6dd38.tar.bz2 busybox-w32-packaging-fa9d3193045dac3cd2931241243f6c36ffd6dd38.zip |
bugfixes
-rw-r--r-- | libressl.patch | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/libressl.patch b/libressl.patch index 19a6b74..d86d449 100644 --- a/libressl.patch +++ b/libressl.patch | |||
@@ -102,7 +102,7 @@ index 9f1dd67ec..60e1afe99 100644 | |||
102 | static void tls_xwrite(tls_state_t *tls, int len) | 102 | static void tls_xwrite(tls_state_t *tls, int len) |
103 | { | 103 | { |
104 | diff --git a/networking/wget.c b/networking/wget.c | 104 | diff --git a/networking/wget.c b/networking/wget.c |
105 | index 6a64836fb..b714d68b5 100644 | 105 | index 6a64836fb..7c68435c0 100644 |
106 | --- a/networking/wget.c | 106 | --- a/networking/wget.c |
107 | +++ b/networking/wget.c | 107 | +++ b/networking/wget.c |
108 | @@ -1,4 +1,3 @@ | 108 | @@ -1,4 +1,3 @@ |
@@ -268,12 +268,17 @@ index 6a64836fb..b714d68b5 100644 | |||
268 | #endif | 268 | #endif |
269 | 269 | ||
270 | #if ENABLE_FEATURE_WGET_HTTPS | 270 | #if ENABLE_FEATURE_WGET_HTTPS |
271 | @@ -1230,26 +1287,45 @@ static void download_one_url(const char *url) | 271 | @@ -1151,6 +1208,9 @@ static void download_one_url(const char *url) |
272 | /* Open socket to http(s) server */ | 272 | server.user = NULL; |
273 | #if ENABLE_FEATURE_WGET_OPENSSL | 273 | target.user = NULL; |
274 | /* openssl (and maybe internal TLS) support is configured */ | 274 | |
275 | + struct tls *ctx; | 275 | + struct tls *ctx; |
276 | if (server.protocol == P_HTTPS) { | 276 | + ctx = NULL; |
277 | + | ||
278 | parse_url(url, &target); | ||
279 | |||
280 | /* Use the proxy if necessary */ | ||
281 | @@ -1234,22 +1294,39 @@ static void download_one_url(const char *url) | ||
277 | /* openssl-based helper | 282 | /* openssl-based helper |
278 | * Inconvenient API since we can't give it an open fd | 283 | * Inconvenient API since we can't give it an open fd |
279 | */ | 284 | */ |
@@ -286,7 +291,6 @@ index 6a64836fb..b714d68b5 100644 | |||
286 | - goto socket_opened; | 291 | - goto socket_opened; |
287 | - } | 292 | - } |
288 | + char *allocated, *servername, *host, *pemmem; | 293 | + char *allocated, *servername, *host, *pemmem; |
289 | + struct tls_config *config; | ||
290 | + if(!strchr(server.host, ':')) | 294 | + if(!strchr(server.host, ':')) |
291 | + host = allocated = xasprintf("%s:%u", server.host, server.port); | 295 | + host = allocated = xasprintf("%s:%u", server.host, server.port); |
292 | + servername = xstrdup(host); | 296 | + servername = xstrdup(host); |
@@ -324,7 +328,7 @@ index 6a64836fb..b714d68b5 100644 | |||
324 | socket_opened: | 328 | socket_opened: |
325 | #elif ENABLE_FEATURE_WGET_HTTPS | 329 | #elif ENABLE_FEATURE_WGET_HTTPS |
326 | /* Only internal TLS support is configured */ | 330 | /* Only internal TLS support is configured */ |
327 | @@ -1353,7 +1429,39 @@ static void download_one_url(const char *url) | 331 | @@ -1353,7 +1430,39 @@ static void download_one_url(const char *url) |
328 | shutdown(fileno(sfp), SHUT_WR); | 332 | shutdown(fileno(sfp), SHUT_WR); |
329 | } | 333 | } |
330 | #endif | 334 | #endif |
@@ -365,7 +369,7 @@ index 6a64836fb..b714d68b5 100644 | |||
365 | /* | 369 | /* |
366 | * Retrieve HTTP response line and check for "200" status code. | 370 | * Retrieve HTTP response line and check for "200" status code. |
367 | */ | 371 | */ |
368 | @@ -1536,6 +1644,8 @@ However, in real world it was observed that some web servers | 372 | @@ -1536,6 +1645,8 @@ However, in real world it was observed that some web servers |
369 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ | 373 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ |
370 | } | 374 | } |
371 | #endif | 375 | #endif |
@@ -374,12 +378,12 @@ index 6a64836fb..b714d68b5 100644 | |||
374 | fclose(sfp); | 378 | fclose(sfp); |
375 | 379 | ||
376 | free(server.allocated); | 380 | free(server.allocated); |
377 | @@ -1691,9 +1801,17 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 381 | @@ -1691,9 +1802,17 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
378 | } | 382 | } |
379 | } | 383 | } |
380 | 384 | ||
381 | + G.tlscfg = tls_config_new(); | 385 | + G.tlscfg = tls_config_new(); |
382 | + if(config == NULL) | 386 | + if(G.tlscfg == NULL) |
383 | + bb_error_msg_and_die("Out of memory 2"); | 387 | + bb_error_msg_and_die("Out of memory 2"); |
384 | + char *pemmem = gather_certificates(G.tlscfg); | 388 | + char *pemmem = gather_certificates(G.tlscfg); |
385 | + | 389 | + |