summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2024-11-14 10:42:04 -0600
committerAlexander M Pickering <alex@cogarr.net>2024-11-14 10:42:04 -0600
commit2daca2d138e550c90190ea50ef19b7274a3cbca8 (patch)
tree363300413cd5e89b51882395b31c4bc0248b806b
parent80d885f2bc6c6c77d84f9d1c69a9bb20322f3022 (diff)
downloadbusybox-w32-packaging-2daca2d138e550c90190ea50ef19b7274a3cbca8.tar.gz
busybox-w32-packaging-2daca2d138e550c90190ea50ef19b7274a3cbca8.tar.bz2
busybox-w32-packaging-2daca2d138e550c90190ea50ef19b7274a3cbca8.zip
More debugging
-rw-r--r--libressl.patch51
1 files changed, 26 insertions, 25 deletions
diff --git a/libressl.patch b/libressl.patch
index 03cb0bb..2a8879f 100644
--- a/libressl.patch
+++ b/libressl.patch
@@ -135,7 +135,7 @@ index 9f1dd67ec..7e8da6df2 100644
135 static void tls_xwrite(tls_state_t *tls, int len) 135 static void tls_xwrite(tls_state_t *tls, int len)
136 { 136 {
137diff --git a/networking/wget.c b/networking/wget.c 137diff --git a/networking/wget.c b/networking/wget.c
138index 6a64836fb..b9a760149 100644 138index 6a64836fb..48e0ea3b6 100644
139--- a/networking/wget.c 139--- a/networking/wget.c
140+++ b/networking/wget.c 140+++ b/networking/wget.c
141@@ -169,7 +169,11 @@ 141@@ -169,7 +169,11 @@
@@ -252,13 +252,14 @@ index 6a64836fb..b9a760149 100644
252 252
253 return c; 253 return c;
254 } 254 }
255@@ -636,6 +699,31 @@ static void parse_url(const char *src_url, struct host_info *h) 255@@ -636,6 +699,32 @@ static void parse_url(const char *src_url, struct host_info *h)
256 */ 256 */
257 } 257 }
258 258
259+static char *tls_sanitized_hdr(struct tls *ctx) 259+static char *tls_sanitized_hdr(struct tls *ctx)
260+{ 260+{
261+ printf("wget tls_sanitized_hdr 1\n"); 261+ printf("wget tls_sanitized_hdr 1\n");
262+ printf("wget_buf was: %s\n",G.wget_buf);
262+ char *s, *hdrval; 263+ char *s, *hdrval;
263+ char c; 264+ char c;
264+ c = tlsgets_trim_sanitize(ctx, " %s\n"); 265+ c = tlsgets_trim_sanitize(ctx, " %s\n");
@@ -284,7 +285,7 @@ index 6a64836fb..b9a760149 100644
284 static char *get_sanitized_hdr(FILE *fp) 285 static char *get_sanitized_hdr(FILE *fp)
285 { 286 {
286 char *s, *hdrval; 287 char *s, *hdrval;
287@@ -689,6 +777,7 @@ static void reset_beg_range_to_zero(void) 288@@ -689,6 +778,7 @@ static void reset_beg_range_to_zero(void)
288 } 289 }
289 290
290 #if ENABLE_FEATURE_WGET_OPENSSL 291 #if ENABLE_FEATURE_WGET_OPENSSL
@@ -292,7 +293,7 @@ index 6a64836fb..b9a760149 100644
292 static int spawn_https_helper_openssl(const char *host, unsigned port) 293 static int spawn_https_helper_openssl(const char *host, unsigned port)
293 { 294 {
294 char *allocated = NULL; 295 char *allocated = NULL;
295@@ -777,6 +866,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) 296@@ -777,6 +867,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
296 # endif 297 # endif
297 return sp[0]; 298 return sp[0];
298 } 299 }
@@ -331,7 +332,7 @@ index 6a64836fb..b9a760149 100644
331 #endif 332 #endif
332 333
333 #if ENABLE_FEATURE_WGET_HTTPS 334 #if ENABLE_FEATURE_WGET_HTTPS
334@@ -1151,6 +1272,7 @@ static void download_one_url(const char *url) 335@@ -1151,6 +1273,7 @@ static void download_one_url(const char *url)
335 server.user = NULL; 336 server.user = NULL;
336 target.user = NULL; 337 target.user = NULL;
337 338
@@ -339,7 +340,7 @@ index 6a64836fb..b9a760149 100644
339 parse_url(url, &target); 340 parse_url(url, &target);
340 341
341 /* Use the proxy if necessary */ 342 /* Use the proxy if necessary */
342@@ -1172,6 +1294,7 @@ static void download_one_url(const char *url) 343@@ -1172,6 +1295,7 @@ static void download_one_url(const char *url)
343 server.host = target.host; 344 server.host = target.host;
344 } 345 }
345 } 346 }
@@ -347,7 +348,7 @@ index 6a64836fb..b9a760149 100644
347 348
348 if (ENABLE_FEATURE_IPV6) 349 if (ENABLE_FEATURE_IPV6)
349 strip_ipv6_scope_id(target.host); 350 strip_ipv6_scope_id(target.host);
350@@ -1191,6 +1314,7 @@ static void download_one_url(const char *url) 351@@ -1191,6 +1315,7 @@ static void download_one_url(const char *url)
351 G.fname_out = fname_out_alloc = xstrdup(G.fname_out); 352 G.fname_out = fname_out_alloc = xstrdup(G.fname_out);
352 } 353 }
353 } 354 }
@@ -355,7 +356,7 @@ index 6a64836fb..b9a760149 100644
355 #if ENABLE_FEATURE_WGET_STATUSBAR 356 #if ENABLE_FEATURE_WGET_STATUSBAR
356 G.curfile = bb_get_last_path_component_nostrip(G.fname_out); 357 G.curfile = bb_get_last_path_component_nostrip(G.fname_out);
357 #endif 358 #endif
358@@ -1206,15 +1330,19 @@ static void download_one_url(const char *url) 359@@ -1206,15 +1331,19 @@ static void download_one_url(const char *url)
359 * We are not sure it exists on remote side */ 360 * We are not sure it exists on remote side */
360 } 361 }
361 362
@@ -375,7 +376,7 @@ index 6a64836fb..b9a760149 100644
375 /*G.content_len = 0; - redundant, got_clen = 0 is enough */ 376 /*G.content_len = 0; - redundant, got_clen = 0 is enough */
376 G.got_clen = 0; 377 G.got_clen = 0;
377 G.chunked = 0; 378 G.chunked = 0;
378@@ -1229,37 +1357,64 @@ static void download_one_url(const char *url) 379@@ -1229,37 +1358,64 @@ static void download_one_url(const char *url)
379 380
380 /* Open socket to http(s) server */ 381 /* Open socket to http(s) server */
381 #if ENABLE_FEATURE_WGET_OPENSSL 382 #if ENABLE_FEATURE_WGET_OPENSSL
@@ -453,7 +454,7 @@ index 6a64836fb..b9a760149 100644
453 /* Send HTTP request */ 454 /* Send HTTP request */
454 if (use_proxy) { 455 if (use_proxy) {
455 SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", 456 SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n",
456@@ -1270,6 +1425,7 @@ static void download_one_url(const char *url) 457@@ -1270,6 +1426,7 @@ static void download_one_url(const char *url)
457 (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", 458 (option_mask32 & WGET_OPT_POST) ? "POST" : "GET",
458 target.path); 459 target.path);
459 } 460 }
@@ -461,7 +462,7 @@ index 6a64836fb..b9a760149 100644
461 if (!USR_HEADER_HOST) 462 if (!USR_HEADER_HOST)
462 SENDFMT(sfp, "Host: %s\r\n", target.host); 463 SENDFMT(sfp, "Host: %s\r\n", target.host);
463 if (!USR_HEADER_USER_AGENT) 464 if (!USR_HEADER_USER_AGENT)
464@@ -1280,6 +1436,7 @@ static void download_one_url(const char *url) 465@@ -1280,6 +1437,7 @@ static void download_one_url(const char *url)
465 */ 466 */
466 SENDFMT(sfp, "Connection: close\r\n"); 467 SENDFMT(sfp, "Connection: close\r\n");
467 468
@@ -469,7 +470,7 @@ index 6a64836fb..b9a760149 100644
469 #if ENABLE_FEATURE_WGET_AUTHENTICATION 470 #if ENABLE_FEATURE_WGET_AUTHENTICATION
470 if (target.user && !USR_HEADER_AUTH) { 471 if (target.user && !USR_HEADER_AUTH) {
471 SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, 472 SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6,
472@@ -1291,6 +1448,7 @@ static void download_one_url(const char *url) 473@@ -1291,6 +1449,7 @@ static void download_one_url(const char *url)
473 } 474 }
474 #endif 475 #endif
475 476
@@ -477,7 +478,7 @@ index 6a64836fb..b9a760149 100644
477 if (G.beg_range != 0 && !USR_HEADER_RANGE) 478 if (G.beg_range != 0 && !USR_HEADER_RANGE)
478 SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); 479 SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range);
479 480
480@@ -1300,6 +1458,7 @@ static void download_one_url(const char *url) 481@@ -1300,6 +1459,7 @@ static void download_one_url(const char *url)
481 fputs(G.extra_headers, sfp); 482 fputs(G.extra_headers, sfp);
482 } 483 }
483 484
@@ -485,7 +486,7 @@ index 6a64836fb..b9a760149 100644
485 if (option_mask32 & WGET_OPT_POST_FILE) { 486 if (option_mask32 & WGET_OPT_POST_FILE) {
486 int fd = xopen_stdin(G.post_file); 487 int fd = xopen_stdin(G.post_file);
487 G.post_data = xmalloc_read(fd, NULL); 488 G.post_data = xmalloc_read(fd, NULL);
488@@ -1314,15 +1473,18 @@ static void download_one_url(const char *url) 489@@ -1314,15 +1474,18 @@ static void download_one_url(const char *url)
489 ); 490 );
490 } 491 }
491 # if ENABLE_PLATFORM_MINGW32 492 # if ENABLE_PLATFORM_MINGW32
@@ -504,7 +505,7 @@ index 6a64836fb..b9a760149 100644
504 } else 505 } else
505 # else 506 # else
506 SENDFMT(sfp, 507 SENDFMT(sfp,
507@@ -1338,6 +1500,7 @@ static void download_one_url(const char *url) 508@@ -1338,6 +1501,7 @@ static void download_one_url(const char *url)
508 SENDFMT(sfp, "\r\n"); 509 SENDFMT(sfp, "\r\n");
509 } 510 }
510 511
@@ -512,7 +513,7 @@ index 6a64836fb..b9a760149 100644
512 fflush(sfp); 513 fflush(sfp);
513 514
514 /* Tried doing this unconditionally. 515 /* Tried doing this unconditionally.
515@@ -1345,31 +1508,60 @@ static void download_one_url(const char *url) 516@@ -1345,31 +1509,60 @@ static void download_one_url(const char *url)
516 */ 517 */
517 #if SSL_SUPPORTED 518 #if SSL_SUPPORTED
518 if (target.protocol == P_HTTPS) { 519 if (target.protocol == P_HTTPS) {
@@ -576,7 +577,7 @@ index 6a64836fb..b9a760149 100644
576 /* eat all remaining headers */; 577 /* eat all remaining headers */;
577 goto read_response; 578 goto read_response;
578 579
579@@ -1441,7 +1633,8 @@ However, in real world it was observed that some web servers 580@@ -1441,7 +1634,8 @@ However, in real world it was observed that some web servers
580 /* 581 /*
581 * Retrieve HTTP headers. 582 * Retrieve HTTP headers.
582 */ 583 */
@@ -586,7 +587,7 @@ index 6a64836fb..b9a760149 100644
586 static const char keywords[] ALIGN1 = 587 static const char keywords[] ALIGN1 =
587 "content-length\0""transfer-encoding\0""location\0"; 588 "content-length\0""transfer-encoding\0""location\0";
588 enum { 589 enum {
589@@ -1497,6 +1690,7 @@ However, in real world it was observed that some web servers 590@@ -1497,6 +1691,7 @@ However, in real world it was observed that some web servers
590 goto establish_session; 591 goto establish_session;
591 } 592 }
592 } 593 }
@@ -594,7 +595,7 @@ index 6a64836fb..b9a760149 100644
594 // if (status >= 300) 595 // if (status >= 300)
595 // bb_error_msg_and_die("bad redirection (no Location: header from server)"); 596 // bb_error_msg_and_die("bad redirection (no Location: header from server)");
596 597
597@@ -1514,6 +1708,7 @@ However, in real world it was observed that some web servers 598@@ -1514,6 +1709,7 @@ However, in real world it was observed that some web servers
598 599
599 free(lsa); 600 free(lsa);
600 601
@@ -602,7 +603,7 @@ index 6a64836fb..b9a760149 100644
602 if (!(option_mask32 & WGET_OPT_SPIDER)) { 603 if (!(option_mask32 & WGET_OPT_SPIDER)) {
603 if (G.output_fd < 0) 604 if (G.output_fd < 0)
604 G.output_fd = xopen(G.fname_out, G.o_flags); 605 G.output_fd = xopen(G.fname_out, G.o_flags);
605@@ -1536,6 +1731,7 @@ However, in real world it was observed that some web servers 606@@ -1536,6 +1732,7 @@ However, in real world it was observed that some web servers
606 /* ftpcmd("QUIT", NULL, sfp); - why bother? */ 607 /* ftpcmd("QUIT", NULL, sfp); - why bother? */
607 } 608 }
608 #endif 609 #endif
@@ -610,7 +611,7 @@ index 6a64836fb..b9a760149 100644
610 fclose(sfp); 611 fclose(sfp);
611 612
612 free(server.allocated); 613 free(server.allocated);
613@@ -1544,11 +1740,13 @@ However, in real world it was observed that some web servers 614@@ -1544,11 +1741,13 @@ However, in real world it was observed that some web servers
614 free(target.user); 615 free(target.user);
615 free(fname_out_alloc); 616 free(fname_out_alloc);
616 free(redirected_path); 617 free(redirected_path);
@@ -624,7 +625,7 @@ index 6a64836fb..b9a760149 100644
624 #if ENABLE_FEATURE_WGET_LONG_OPTIONS 625 #if ENABLE_FEATURE_WGET_LONG_OPTIONS
625 static const char wget_longopts[] ALIGN1 = 626 static const char wget_longopts[] ALIGN1 =
626 /* name, has_arg, val */ 627 /* name, has_arg, val */
627@@ -1590,6 +1788,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") 628@@ -1590,6 +1789,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0")
628 #endif 629 #endif
629 630
630 INIT_G(); 631 INIT_G();
@@ -632,7 +633,7 @@ index 6a64836fb..b9a760149 100644
632 633
633 #if ENABLE_FEATURE_WGET_TIMEOUT 634 #if ENABLE_FEATURE_WGET_TIMEOUT
634 G.timeout_seconds = 900; 635 G.timeout_seconds = 900;
635@@ -1626,6 +1825,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") 636@@ -1626,6 +1826,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0")
636 IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) 637 IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data)
637 IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) 638 IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file)
638 ); 639 );
@@ -641,7 +642,7 @@ index 6a64836fb..b9a760149 100644
641 #if 0 /* option bits debug */ 642 #if 0 /* option bits debug */
642 if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); 643 if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM");
643 if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); 644 if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething");
644@@ -1670,6 +1871,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") 645@@ -1670,6 +1872,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0")
645 } 646 }
646 #endif 647 #endif
647 648
@@ -649,7 +650,7 @@ index 6a64836fb..b9a760149 100644
649 G.output_fd = -1; 650 G.output_fd = -1;
650 G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; 651 G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL;
651 if (G.fname_out) { /* -O FILE ? */ 652 if (G.fname_out) { /* -O FILE ? */
652@@ -1691,8 +1893,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") 653@@ -1691,8 +1894,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0")
653 } 654 }
654 } 655 }
655 656