From e0397bd78f5d363576a460641eeec972170851d2 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Tue, 12 Nov 2024 09:05:08 -0600 Subject: More debug info --- libressl.patch | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/libressl.patch b/libressl.patch index 9778341..877a2a7 100644 --- a/libressl.patch +++ b/libressl.patch @@ -135,7 +135,7 @@ index 9f1dd67ec..7e8da6df2 100644 static void tls_xwrite(tls_state_t *tls, int len) { diff --git a/networking/wget.c b/networking/wget.c -index 6a64836fb..13474abe4 100644 +index 6a64836fb..55195baf3 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -169,7 +169,11 @@ @@ -320,7 +320,7 @@ index 6a64836fb..13474abe4 100644 /*G.content_len = 0; - redundant, got_clen = 0 is enough */ G.got_clen = 0; G.chunked = 0; -@@ -1229,37 +1315,61 @@ static void download_one_url(const char *url) +@@ -1229,37 +1315,62 @@ static void download_one_url(const char *url) /* Open socket to http(s) server */ #if ENABLE_FEATURE_WGET_OPENSSL @@ -356,6 +356,7 @@ index 6a64836fb..13474abe4 100644 + bb_error_msg_and_die("Failed to configure client"); + sfp = tmpfile(); + dfp = tmpfile(); ++ printf("TLS connection to %s", servername); + if(tls_connect_fds(ctx, dfp, sfp, servername) != 0) + bb_error_msg_and_die("Failed to connect: %s", tls_error(ctx)); + tls_config_free(config); @@ -395,7 +396,7 @@ index 6a64836fb..13474abe4 100644 /* Send HTTP request */ if (use_proxy) { SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", -@@ -1270,6 +1380,7 @@ static void download_one_url(const char *url) +@@ -1270,6 +1381,7 @@ static void download_one_url(const char *url) (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", target.path); } @@ -403,7 +404,7 @@ index 6a64836fb..13474abe4 100644 if (!USR_HEADER_HOST) SENDFMT(sfp, "Host: %s\r\n", target.host); if (!USR_HEADER_USER_AGENT) -@@ -1280,6 +1391,7 @@ static void download_one_url(const char *url) +@@ -1280,6 +1392,7 @@ static void download_one_url(const char *url) */ SENDFMT(sfp, "Connection: close\r\n"); @@ -411,7 +412,7 @@ index 6a64836fb..13474abe4 100644 #if ENABLE_FEATURE_WGET_AUTHENTICATION if (target.user && !USR_HEADER_AUTH) { SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, -@@ -1291,6 +1403,7 @@ static void download_one_url(const char *url) +@@ -1291,6 +1404,7 @@ static void download_one_url(const char *url) } #endif @@ -419,7 +420,7 @@ index 6a64836fb..13474abe4 100644 if (G.beg_range != 0 && !USR_HEADER_RANGE) SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); -@@ -1300,6 +1413,7 @@ static void download_one_url(const char *url) +@@ -1300,6 +1414,7 @@ static void download_one_url(const char *url) fputs(G.extra_headers, sfp); } @@ -427,7 +428,7 @@ index 6a64836fb..13474abe4 100644 if (option_mask32 & WGET_OPT_POST_FILE) { int fd = xopen_stdin(G.post_file); G.post_data = xmalloc_read(fd, NULL); -@@ -1314,15 +1428,18 @@ static void download_one_url(const char *url) +@@ -1314,15 +1429,18 @@ static void download_one_url(const char *url) ); } # if ENABLE_PLATFORM_MINGW32 @@ -446,7 +447,7 @@ index 6a64836fb..13474abe4 100644 } else # else SENDFMT(sfp, -@@ -1338,6 +1455,7 @@ static void download_one_url(const char *url) +@@ -1338,6 +1456,7 @@ static void download_one_url(const char *url) SENDFMT(sfp, "\r\n"); } @@ -454,7 +455,7 @@ index 6a64836fb..13474abe4 100644 fflush(sfp); /* Tried doing this unconditionally. -@@ -1345,27 +1463,38 @@ static void download_one_url(const char *url) +@@ -1345,27 +1464,38 @@ static void download_one_url(const char *url) */ #if SSL_SUPPORTED if (target.protocol == P_HTTPS) { @@ -493,7 +494,7 @@ index 6a64836fb..13474abe4 100644 switch (status) { case 0: case 100: -@@ -1441,6 +1570,7 @@ However, in real world it was observed that some web servers +@@ -1441,6 +1571,7 @@ However, in real world it was observed that some web servers /* * Retrieve HTTP headers. */ @@ -501,7 +502,7 @@ index 6a64836fb..13474abe4 100644 while ((str = get_sanitized_hdr(sfp)) != NULL) { static const char keywords[] ALIGN1 = "content-length\0""transfer-encoding\0""location\0"; -@@ -1497,6 +1627,7 @@ However, in real world it was observed that some web servers +@@ -1497,6 +1628,7 @@ However, in real world it was observed that some web servers goto establish_session; } } @@ -509,7 +510,7 @@ index 6a64836fb..13474abe4 100644 // if (status >= 300) // bb_error_msg_and_die("bad redirection (no Location: header from server)"); -@@ -1514,6 +1645,7 @@ However, in real world it was observed that some web servers +@@ -1514,6 +1646,7 @@ However, in real world it was observed that some web servers free(lsa); @@ -517,7 +518,7 @@ index 6a64836fb..13474abe4 100644 if (!(option_mask32 & WGET_OPT_SPIDER)) { if (G.output_fd < 0) G.output_fd = xopen(G.fname_out, G.o_flags); -@@ -1536,6 +1668,7 @@ However, in real world it was observed that some web servers +@@ -1536,6 +1669,7 @@ However, in real world it was observed that some web servers /* ftpcmd("QUIT", NULL, sfp); - why bother? */ } #endif @@ -525,7 +526,7 @@ index 6a64836fb..13474abe4 100644 fclose(sfp); free(server.allocated); -@@ -1544,11 +1677,13 @@ However, in real world it was observed that some web servers +@@ -1544,11 +1678,13 @@ However, in real world it was observed that some web servers free(target.user); free(fname_out_alloc); free(redirected_path); @@ -539,7 +540,7 @@ index 6a64836fb..13474abe4 100644 #if ENABLE_FEATURE_WGET_LONG_OPTIONS static const char wget_longopts[] ALIGN1 = /* name, has_arg, val */ -@@ -1590,6 +1725,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1590,6 +1726,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") #endif INIT_G(); @@ -547,7 +548,7 @@ index 6a64836fb..13474abe4 100644 #if ENABLE_FEATURE_WGET_TIMEOUT G.timeout_seconds = 900; -@@ -1626,6 +1762,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1626,6 +1763,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) ); @@ -556,7 +557,7 @@ index 6a64836fb..13474abe4 100644 #if 0 /* option bits debug */ if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); -@@ -1670,6 +1808,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1670,6 +1809,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") } #endif @@ -564,7 +565,7 @@ index 6a64836fb..13474abe4 100644 G.output_fd = -1; G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; if (G.fname_out) { /* -O FILE ? */ -@@ -1691,8 +1830,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1691,8 +1831,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") } } -- cgit v1.2.3-55-g6feb