diff options
author | Alexander M Pickering <alex@cogarr.net> | 2024-11-14 11:42:39 -0600 |
---|---|---|
committer | Alexander M Pickering <alex@cogarr.net> | 2024-11-14 11:42:39 -0600 |
commit | 30c54e0c755f0acfc3f590340839e1267b1a457a (patch) | |
tree | c24162ca908971828607627c718439576695bfb0 | |
parent | 2daca2d138e550c90190ea50ef19b7274a3cbca8 (diff) | |
download | busybox-w32-packaging-30c54e0c755f0acfc3f590340839e1267b1a457a.tar.gz busybox-w32-packaging-30c54e0c755f0acfc3f590340839e1267b1a457a.tar.bz2 busybox-w32-packaging-30c54e0c755f0acfc3f590340839e1267b1a457a.zip |
more debugging where does this line come from?
-rw-r--r-- | libressl.patch | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/libressl.patch b/libressl.patch index 2a8879f..f5b4a42 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 | { |
137 | diff --git a/networking/wget.c b/networking/wget.c | 137 | diff --git a/networking/wget.c b/networking/wget.c |
138 | index 6a64836fb..48e0ea3b6 100644 | 138 | index 6a64836fb..d841bdb8f 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 @@ |
@@ -191,7 +191,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
191 | /* IPv6 knows scoped address types i.e. link and site local addresses. Link | 191 | /* IPv6 knows scoped address types i.e. link and site local addresses. Link |
192 | * local addresses can have a scope identifier to specify the | 192 | * local addresses can have a scope identifier to specify the |
193 | * interface/link an address is valid on (e.g. fe80::1%eth0). This scope | 193 | * interface/link an address is valid on (e.g. fe80::1%eth0). This scope |
194 | @@ -482,32 +519,58 @@ static char* sanitize_string(char *s) | 194 | @@ -482,32 +519,59 @@ static char* sanitize_string(char *s) |
195 | return s; | 195 | return s; |
196 | } | 196 | } |
197 | 197 | ||
@@ -203,7 +203,8 @@ index 6a64836fb..48e0ea3b6 100644 | |||
203 | + ssize_t len = tls_read(ctx,G.wget_buf, sizeof(G.wget_buf)); | 203 | + ssize_t len = tls_read(ctx,G.wget_buf, sizeof(G.wget_buf)); |
204 | + if(len == -1) | 204 | + if(len == -1) |
205 | + bb_error_msg_and_die("tls read error: %s", tls_error(ctx)); | 205 | + bb_error_msg_and_die("tls read error: %s", tls_error(ctx)); |
206 | + printf("Read %llu bytes\n", len); | 206 | + printf("Read %zd bytes\n", len); |
207 | + printf("Data Read: %s\n",G.wget_buf); | ||
207 | + buf_ptr = strchrnul(G.wget_buf, '\n'); | 208 | + buf_ptr = strchrnul(G.wget_buf, '\n'); |
208 | + c = *buf_ptr; | 209 | + c = *buf_ptr; |
209 | + sanitize_string(G.wget_buf); | 210 | + sanitize_string(G.wget_buf); |
@@ -252,7 +253,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
252 | 253 | ||
253 | return c; | 254 | return c; |
254 | } | 255 | } |
255 | @@ -636,6 +699,32 @@ static void parse_url(const char *src_url, struct host_info *h) | 256 | @@ -636,6 +700,32 @@ static void parse_url(const char *src_url, struct host_info *h) |
256 | */ | 257 | */ |
257 | } | 258 | } |
258 | 259 | ||
@@ -265,7 +266,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
265 | + c = tlsgets_trim_sanitize(ctx, " %s\n"); | 266 | + c = tlsgets_trim_sanitize(ctx, " %s\n"); |
266 | + if(G.wget_buf[0] == '\0') | 267 | + if(G.wget_buf[0] == '\0') |
267 | + return NULL; | 268 | + return NULL; |
268 | + printf("While getting header, buf was: %s", G.wget_buf); | 269 | + printf("While getting header, buf was: %s\n", G.wget_buf); |
269 | + for(s = G.wget_buf; isalnum(*s) || *s == '-' || *s == '.' || *s == '_'; ++s) | 270 | + for(s = G.wget_buf; isalnum(*s) || *s == '-' || *s == '.' || *s == '_'; ++s) |
270 | + *s |= 0x20; | 271 | + *s |= 0x20; |
271 | + if(*s != ':') | 272 | + if(*s != ':') |
@@ -285,7 +286,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
285 | static char *get_sanitized_hdr(FILE *fp) | 286 | static char *get_sanitized_hdr(FILE *fp) |
286 | { | 287 | { |
287 | char *s, *hdrval; | 288 | char *s, *hdrval; |
288 | @@ -689,6 +778,7 @@ static void reset_beg_range_to_zero(void) | 289 | @@ -689,6 +779,7 @@ static void reset_beg_range_to_zero(void) |
289 | } | 290 | } |
290 | 291 | ||
291 | #if ENABLE_FEATURE_WGET_OPENSSL | 292 | #if ENABLE_FEATURE_WGET_OPENSSL |
@@ -293,7 +294,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
293 | static int spawn_https_helper_openssl(const char *host, unsigned port) | 294 | static int spawn_https_helper_openssl(const char *host, unsigned port) |
294 | { | 295 | { |
295 | char *allocated = NULL; | 296 | char *allocated = NULL; |
296 | @@ -777,6 +867,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 297 | @@ -777,6 +868,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
297 | # endif | 298 | # endif |
298 | return sp[0]; | 299 | return sp[0]; |
299 | } | 300 | } |
@@ -332,7 +333,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
332 | #endif | 333 | #endif |
333 | 334 | ||
334 | #if ENABLE_FEATURE_WGET_HTTPS | 335 | #if ENABLE_FEATURE_WGET_HTTPS |
335 | @@ -1151,6 +1273,7 @@ static void download_one_url(const char *url) | 336 | @@ -1151,6 +1274,7 @@ static void download_one_url(const char *url) |
336 | server.user = NULL; | 337 | server.user = NULL; |
337 | target.user = NULL; | 338 | target.user = NULL; |
338 | 339 | ||
@@ -340,7 +341,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
340 | parse_url(url, &target); | 341 | parse_url(url, &target); |
341 | 342 | ||
342 | /* Use the proxy if necessary */ | 343 | /* Use the proxy if necessary */ |
343 | @@ -1172,6 +1295,7 @@ static void download_one_url(const char *url) | 344 | @@ -1172,6 +1296,7 @@ static void download_one_url(const char *url) |
344 | server.host = target.host; | 345 | server.host = target.host; |
345 | } | 346 | } |
346 | } | 347 | } |
@@ -348,7 +349,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
348 | 349 | ||
349 | if (ENABLE_FEATURE_IPV6) | 350 | if (ENABLE_FEATURE_IPV6) |
350 | strip_ipv6_scope_id(target.host); | 351 | strip_ipv6_scope_id(target.host); |
351 | @@ -1191,6 +1315,7 @@ static void download_one_url(const char *url) | 352 | @@ -1191,6 +1316,7 @@ static void download_one_url(const char *url) |
352 | G.fname_out = fname_out_alloc = xstrdup(G.fname_out); | 353 | G.fname_out = fname_out_alloc = xstrdup(G.fname_out); |
353 | } | 354 | } |
354 | } | 355 | } |
@@ -356,7 +357,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
356 | #if ENABLE_FEATURE_WGET_STATUSBAR | 357 | #if ENABLE_FEATURE_WGET_STATUSBAR |
357 | G.curfile = bb_get_last_path_component_nostrip(G.fname_out); | 358 | G.curfile = bb_get_last_path_component_nostrip(G.fname_out); |
358 | #endif | 359 | #endif |
359 | @@ -1206,15 +1331,19 @@ static void download_one_url(const char *url) | 360 | @@ -1206,15 +1332,19 @@ static void download_one_url(const char *url) |
360 | * We are not sure it exists on remote side */ | 361 | * We are not sure it exists on remote side */ |
361 | } | 362 | } |
362 | 363 | ||
@@ -376,7 +377,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
376 | /*G.content_len = 0; - redundant, got_clen = 0 is enough */ | 377 | /*G.content_len = 0; - redundant, got_clen = 0 is enough */ |
377 | G.got_clen = 0; | 378 | G.got_clen = 0; |
378 | G.chunked = 0; | 379 | G.chunked = 0; |
379 | @@ -1229,37 +1358,64 @@ static void download_one_url(const char *url) | 380 | @@ -1229,37 +1359,64 @@ static void download_one_url(const char *url) |
380 | 381 | ||
381 | /* Open socket to http(s) server */ | 382 | /* Open socket to http(s) server */ |
382 | #if ENABLE_FEATURE_WGET_OPENSSL | 383 | #if ENABLE_FEATURE_WGET_OPENSSL |
@@ -454,7 +455,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
454 | /* Send HTTP request */ | 455 | /* Send HTTP request */ |
455 | if (use_proxy) { | 456 | if (use_proxy) { |
456 | SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", | 457 | SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", |
457 | @@ -1270,6 +1426,7 @@ static void download_one_url(const char *url) | 458 | @@ -1270,6 +1427,7 @@ static void download_one_url(const char *url) |
458 | (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", | 459 | (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", |
459 | target.path); | 460 | target.path); |
460 | } | 461 | } |
@@ -462,7 +463,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
462 | if (!USR_HEADER_HOST) | 463 | if (!USR_HEADER_HOST) |
463 | SENDFMT(sfp, "Host: %s\r\n", target.host); | 464 | SENDFMT(sfp, "Host: %s\r\n", target.host); |
464 | if (!USR_HEADER_USER_AGENT) | 465 | if (!USR_HEADER_USER_AGENT) |
465 | @@ -1280,6 +1437,7 @@ static void download_one_url(const char *url) | 466 | @@ -1280,6 +1438,7 @@ static void download_one_url(const char *url) |
466 | */ | 467 | */ |
467 | SENDFMT(sfp, "Connection: close\r\n"); | 468 | SENDFMT(sfp, "Connection: close\r\n"); |
468 | 469 | ||
@@ -470,7 +471,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
470 | #if ENABLE_FEATURE_WGET_AUTHENTICATION | 471 | #if ENABLE_FEATURE_WGET_AUTHENTICATION |
471 | if (target.user && !USR_HEADER_AUTH) { | 472 | if (target.user && !USR_HEADER_AUTH) { |
472 | SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, | 473 | SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, |
473 | @@ -1291,6 +1449,7 @@ static void download_one_url(const char *url) | 474 | @@ -1291,6 +1450,7 @@ static void download_one_url(const char *url) |
474 | } | 475 | } |
475 | #endif | 476 | #endif |
476 | 477 | ||
@@ -478,7 +479,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
478 | if (G.beg_range != 0 && !USR_HEADER_RANGE) | 479 | if (G.beg_range != 0 && !USR_HEADER_RANGE) |
479 | SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); | 480 | SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); |
480 | 481 | ||
481 | @@ -1300,6 +1459,7 @@ static void download_one_url(const char *url) | 482 | @@ -1300,6 +1460,7 @@ static void download_one_url(const char *url) |
482 | fputs(G.extra_headers, sfp); | 483 | fputs(G.extra_headers, sfp); |
483 | } | 484 | } |
484 | 485 | ||
@@ -486,7 +487,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
486 | if (option_mask32 & WGET_OPT_POST_FILE) { | 487 | if (option_mask32 & WGET_OPT_POST_FILE) { |
487 | int fd = xopen_stdin(G.post_file); | 488 | int fd = xopen_stdin(G.post_file); |
488 | G.post_data = xmalloc_read(fd, NULL); | 489 | G.post_data = xmalloc_read(fd, NULL); |
489 | @@ -1314,15 +1474,18 @@ static void download_one_url(const char *url) | 490 | @@ -1314,15 +1475,18 @@ static void download_one_url(const char *url) |
490 | ); | 491 | ); |
491 | } | 492 | } |
492 | # if ENABLE_PLATFORM_MINGW32 | 493 | # if ENABLE_PLATFORM_MINGW32 |
@@ -505,7 +506,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
505 | } else | 506 | } else |
506 | # else | 507 | # else |
507 | SENDFMT(sfp, | 508 | SENDFMT(sfp, |
508 | @@ -1338,6 +1501,7 @@ static void download_one_url(const char *url) | 509 | @@ -1338,6 +1502,7 @@ static void download_one_url(const char *url) |
509 | SENDFMT(sfp, "\r\n"); | 510 | SENDFMT(sfp, "\r\n"); |
510 | } | 511 | } |
511 | 512 | ||
@@ -513,7 +514,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
513 | fflush(sfp); | 514 | fflush(sfp); |
514 | 515 | ||
515 | /* Tried doing this unconditionally. | 516 | /* Tried doing this unconditionally. |
516 | @@ -1345,31 +1509,60 @@ static void download_one_url(const char *url) | 517 | @@ -1345,31 +1510,60 @@ static void download_one_url(const char *url) |
517 | */ | 518 | */ |
518 | #if SSL_SUPPORTED | 519 | #if SSL_SUPPORTED |
519 | if (target.protocol == P_HTTPS) { | 520 | if (target.protocol == P_HTTPS) { |
@@ -577,7 +578,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
577 | /* eat all remaining headers */; | 578 | /* eat all remaining headers */; |
578 | goto read_response; | 579 | goto read_response; |
579 | 580 | ||
580 | @@ -1441,7 +1634,8 @@ However, in real world it was observed that some web servers | 581 | @@ -1441,7 +1635,8 @@ However, in real world it was observed that some web servers |
581 | /* | 582 | /* |
582 | * Retrieve HTTP headers. | 583 | * Retrieve HTTP headers. |
583 | */ | 584 | */ |
@@ -587,7 +588,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
587 | static const char keywords[] ALIGN1 = | 588 | static const char keywords[] ALIGN1 = |
588 | "content-length\0""transfer-encoding\0""location\0"; | 589 | "content-length\0""transfer-encoding\0""location\0"; |
589 | enum { | 590 | enum { |
590 | @@ -1497,6 +1691,7 @@ However, in real world it was observed that some web servers | 591 | @@ -1497,6 +1692,7 @@ However, in real world it was observed that some web servers |
591 | goto establish_session; | 592 | goto establish_session; |
592 | } | 593 | } |
593 | } | 594 | } |
@@ -595,7 +596,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
595 | // if (status >= 300) | 596 | // if (status >= 300) |
596 | // bb_error_msg_and_die("bad redirection (no Location: header from server)"); | 597 | // bb_error_msg_and_die("bad redirection (no Location: header from server)"); |
597 | 598 | ||
598 | @@ -1514,6 +1709,7 @@ However, in real world it was observed that some web servers | 599 | @@ -1514,6 +1710,7 @@ However, in real world it was observed that some web servers |
599 | 600 | ||
600 | free(lsa); | 601 | free(lsa); |
601 | 602 | ||
@@ -603,7 +604,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
603 | if (!(option_mask32 & WGET_OPT_SPIDER)) { | 604 | if (!(option_mask32 & WGET_OPT_SPIDER)) { |
604 | if (G.output_fd < 0) | 605 | if (G.output_fd < 0) |
605 | G.output_fd = xopen(G.fname_out, G.o_flags); | 606 | G.output_fd = xopen(G.fname_out, G.o_flags); |
606 | @@ -1536,6 +1732,7 @@ However, in real world it was observed that some web servers | 607 | @@ -1536,6 +1733,7 @@ However, in real world it was observed that some web servers |
607 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ | 608 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ |
608 | } | 609 | } |
609 | #endif | 610 | #endif |
@@ -611,7 +612,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
611 | fclose(sfp); | 612 | fclose(sfp); |
612 | 613 | ||
613 | free(server.allocated); | 614 | free(server.allocated); |
614 | @@ -1544,11 +1741,13 @@ However, in real world it was observed that some web servers | 615 | @@ -1544,11 +1742,13 @@ However, in real world it was observed that some web servers |
615 | free(target.user); | 616 | free(target.user); |
616 | free(fname_out_alloc); | 617 | free(fname_out_alloc); |
617 | free(redirected_path); | 618 | free(redirected_path); |
@@ -625,7 +626,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
625 | #if ENABLE_FEATURE_WGET_LONG_OPTIONS | 626 | #if ENABLE_FEATURE_WGET_LONG_OPTIONS |
626 | static const char wget_longopts[] ALIGN1 = | 627 | static const char wget_longopts[] ALIGN1 = |
627 | /* name, has_arg, val */ | 628 | /* name, has_arg, val */ |
628 | @@ -1590,6 +1789,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 629 | @@ -1590,6 +1790,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
629 | #endif | 630 | #endif |
630 | 631 | ||
631 | INIT_G(); | 632 | INIT_G(); |
@@ -633,7 +634,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
633 | 634 | ||
634 | #if ENABLE_FEATURE_WGET_TIMEOUT | 635 | #if ENABLE_FEATURE_WGET_TIMEOUT |
635 | G.timeout_seconds = 900; | 636 | G.timeout_seconds = 900; |
636 | @@ -1626,6 +1826,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 637 | @@ -1626,6 +1827,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
637 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) | 638 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) |
638 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) | 639 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) |
639 | ); | 640 | ); |
@@ -642,7 +643,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
642 | #if 0 /* option bits debug */ | 643 | #if 0 /* option bits debug */ |
643 | if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); | 644 | if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); |
644 | if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); | 645 | if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); |
645 | @@ -1670,6 +1872,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 646 | @@ -1670,6 +1873,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
646 | } | 647 | } |
647 | #endif | 648 | #endif |
648 | 649 | ||
@@ -650,7 +651,7 @@ index 6a64836fb..48e0ea3b6 100644 | |||
650 | G.output_fd = -1; | 651 | G.output_fd = -1; |
651 | G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; | 652 | G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; |
652 | if (G.fname_out) { /* -O FILE ? */ | 653 | if (G.fname_out) { /* -O FILE ? */ |
653 | @@ -1691,8 +1894,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 654 | @@ -1691,8 +1895,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
654 | } | 655 | } |
655 | } | 656 | } |
656 | 657 | ||