diff options
author | Alexander M Pickering <alex@cogarr.net> | 2024-11-21 17:56:48 -0600 |
---|---|---|
committer | Alexander M Pickering <alex@cogarr.net> | 2024-11-21 17:56:48 -0600 |
commit | d7ede5ff6b9454a819a89aa05d7fe49a5e21549b (patch) | |
tree | b5ecb2b22921d28e0c970bbfce99fac08f87c1d9 | |
parent | fbe4c913334712ccc58679ce184a857065337b31 (diff) | |
download | busybox-w32-packaging-d7ede5ff6b9454a819a89aa05d7fe49a5e21549b.tar.gz busybox-w32-packaging-d7ede5ff6b9454a819a89aa05d7fe49a5e21549b.tar.bz2 busybox-w32-packaging-d7ede5ff6b9454a819a89aa05d7fe49a5e21549b.zip |
Use correct methods
-rw-r--r-- | libressl.patch | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/libressl.patch b/libressl.patch index 8eb385e..4602a27 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..5ca91b79b 100644 | 105 | index 6a64836fb..40e1f0ad4 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 @@ |
@@ -120,7 +120,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
120 | #if ENABLE_FEATURE_WGET_TIMEOUT | 120 | #if ENABLE_FEATURE_WGET_TIMEOUT |
121 | unsigned timeout_seconds; | 121 | unsigned timeout_seconds; |
122 | smallint die_if_timed_out; | 122 | smallint die_if_timed_out; |
123 | @@ -460,6 +462,75 @@ static FILE *open_socket(len_and_sockaddr *lsa) | 123 | @@ -460,6 +462,79 @@ static FILE *open_socket(len_and_sockaddr *lsa) |
124 | return fp; | 124 | return fp; |
125 | } | 125 | } |
126 | 126 | ||
@@ -183,8 +183,12 @@ index 6a64836fb..5ca91b79b 100644 | |||
183 | + bb_error_msg_and_die("out of memory"); | 183 | + bb_error_msg_and_die("out of memory"); |
184 | + //rewind(pemfile); | 184 | + //rewind(pemfile); |
185 | + BIO_seek(pemfile, 0); | 185 | + BIO_seek(pemfile, 0); |
186 | + if(BIO_read(pemfile, pemmem, pemsize) == 0) | ||
187 | + bb_error_msg_and_die("Failed to read ssl bio in memory file"); | ||
188 | + /* | ||
186 | + if(fread(pemmem, sizeof(char), pemsize, pemfile) != pemsize) | 189 | + if(fread(pemmem, sizeof(char), pemsize, pemfile) != pemsize) |
187 | + bb_error_msg_and_die("Failed to read temp ca pem file"); | 190 | + bb_error_msg_and_die("Failed to read temp ca pem file"); |
191 | + */ | ||
188 | + tls_config_set_ca_mem(cfg, pemmem, pemsize); | 192 | + tls_config_set_ca_mem(cfg, pemmem, pemsize); |
189 | + //fclose(pemfile); | 193 | + //fclose(pemfile); |
190 | + BIO_free(pemfile); | 194 | + BIO_free(pemfile); |
@@ -196,7 +200,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
196 | /* We balk at any control chars in other side's messages. | 200 | /* We balk at any control chars in other side's messages. |
197 | * This prevents nasty surprises (e.g. ESC sequences) in "Location:" URLs | 201 | * This prevents nasty surprises (e.g. ESC sequences) in "Location:" URLs |
198 | * and error messages. | 202 | * and error messages. |
199 | @@ -689,6 +760,7 @@ static void reset_beg_range_to_zero(void) | 203 | @@ -689,6 +764,7 @@ static void reset_beg_range_to_zero(void) |
200 | } | 204 | } |
201 | 205 | ||
202 | #if ENABLE_FEATURE_WGET_OPENSSL | 206 | #if ENABLE_FEATURE_WGET_OPENSSL |
@@ -204,7 +208,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
204 | static int spawn_https_helper_openssl(const char *host, unsigned port) | 208 | static int spawn_https_helper_openssl(const char *host, unsigned port) |
205 | { | 209 | { |
206 | char *allocated = NULL; | 210 | char *allocated = NULL; |
207 | @@ -698,7 +770,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 211 | @@ -698,7 +774,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
208 | IF_FEATURE_WGET_HTTPS(volatile int child_failed = 0;) | 212 | IF_FEATURE_WGET_HTTPS(volatile int child_failed = 0;) |
209 | 213 | ||
210 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0) | 214 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0) |
@@ -213,7 +217,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
213 | bb_simple_perror_msg_and_die("socketpair"); | 217 | bb_simple_perror_msg_and_die("socketpair"); |
214 | 218 | ||
215 | if (!strchr(host, ':')) | 219 | if (!strchr(host, ':')) |
216 | @@ -709,18 +781,18 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 220 | @@ -709,18 +785,18 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
217 | fflush_all(); | 221 | fflush_all(); |
218 | pid = xvfork(); | 222 | pid = xvfork(); |
219 | if (pid == 0) { | 223 | if (pid == 0) { |
@@ -238,7 +242,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
238 | xmove_fd(2, 3); | 242 | xmove_fd(2, 3); |
239 | xopen("/dev/null", O_RDWR); | 243 | xopen("/dev/null", O_RDWR); |
240 | memset(&argv, 0, sizeof(argv)); | 244 | memset(&argv, 0, sizeof(argv)); |
241 | @@ -729,18 +801,18 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 245 | @@ -729,18 +805,18 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
242 | argv[2] = (char*)"-quiet"; | 246 | argv[2] = (char*)"-quiet"; |
243 | argv[3] = (char*)"-connect"; | 247 | argv[3] = (char*)"-connect"; |
244 | argv[4] = (char*)host; | 248 | argv[4] = (char*)host; |
@@ -263,7 +267,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
263 | *argp++ = (char*)"-verify"; //[7] | 267 | *argp++ = (char*)"-verify"; //[7] |
264 | *argp++ = (char*)"100"; //[8] | 268 | *argp++ = (char*)"100"; //[8] |
265 | *argp++ = (char*)"-verify_return_error"; //[9] | 269 | *argp++ = (char*)"-verify_return_error"; //[9] |
266 | @@ -762,10 +834,10 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 270 | @@ -762,10 +838,10 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
267 | # else | 271 | # else |
268 | bb_perror_msg_and_die("can't execute '%s'", argv[0]); | 272 | bb_perror_msg_and_die("can't execute '%s'", argv[0]); |
269 | # endif | 273 | # endif |
@@ -276,7 +280,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
276 | free(servername); | 280 | free(servername); |
277 | free(allocated); | 281 | free(allocated); |
278 | close(sp[1]); | 282 | close(sp[1]); |
279 | @@ -777,6 +849,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 283 | @@ -777,6 +853,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
280 | # endif | 284 | # endif |
281 | return sp[0]; | 285 | return sp[0]; |
282 | } | 286 | } |
@@ -284,7 +288,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
284 | #endif | 288 | #endif |
285 | 289 | ||
286 | #if ENABLE_FEATURE_WGET_HTTPS | 290 | #if ENABLE_FEATURE_WGET_HTTPS |
287 | @@ -1151,6 +1224,9 @@ static void download_one_url(const char *url) | 291 | @@ -1151,6 +1228,9 @@ static void download_one_url(const char *url) |
288 | server.user = NULL; | 292 | server.user = NULL; |
289 | target.user = NULL; | 293 | target.user = NULL; |
290 | 294 | ||
@@ -294,7 +298,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
294 | parse_url(url, &target); | 298 | parse_url(url, &target); |
295 | 299 | ||
296 | /* Use the proxy if necessary */ | 300 | /* Use the proxy if necessary */ |
297 | @@ -1234,22 +1310,41 @@ static void download_one_url(const char *url) | 301 | @@ -1234,22 +1314,41 @@ static void download_one_url(const char *url) |
298 | /* openssl-based helper | 302 | /* openssl-based helper |
299 | * Inconvenient API since we can't give it an open fd | 303 | * Inconvenient API since we can't give it an open fd |
300 | */ | 304 | */ |
@@ -346,7 +350,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
346 | socket_opened: | 350 | socket_opened: |
347 | #elif ENABLE_FEATURE_WGET_HTTPS | 351 | #elif ENABLE_FEATURE_WGET_HTTPS |
348 | /* Only internal TLS support is configured */ | 352 | /* Only internal TLS support is configured */ |
349 | @@ -1353,7 +1448,41 @@ static void download_one_url(const char *url) | 353 | @@ -1353,7 +1452,41 @@ static void download_one_url(const char *url) |
350 | shutdown(fileno(sfp), SHUT_WR); | 354 | shutdown(fileno(sfp), SHUT_WR); |
351 | } | 355 | } |
352 | #endif | 356 | #endif |
@@ -389,7 +393,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
389 | /* | 393 | /* |
390 | * Retrieve HTTP response line and check for "200" status code. | 394 | * Retrieve HTTP response line and check for "200" status code. |
391 | */ | 395 | */ |
392 | @@ -1536,6 +1665,10 @@ However, in real world it was observed that some web servers | 396 | @@ -1536,6 +1669,10 @@ However, in real world it was observed that some web servers |
393 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ | 397 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ |
394 | } | 398 | } |
395 | #endif | 399 | #endif |
@@ -400,7 +404,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
400 | fclose(sfp); | 404 | fclose(sfp); |
401 | 405 | ||
402 | free(server.allocated); | 406 | free(server.allocated); |
403 | @@ -1690,9 +1823,18 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 407 | @@ -1690,9 +1827,18 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
404 | xdup2(G.log_fd, STDERR_FILENO); | 408 | xdup2(G.log_fd, STDERR_FILENO); |
405 | } | 409 | } |
406 | } | 410 | } |
@@ -420,7 +424,7 @@ index 6a64836fb..5ca91b79b 100644 | |||
420 | 424 | ||
421 | if (G.output_fd >= 0) | 425 | if (G.output_fd >= 0) |
422 | xclose(G.output_fd); | 426 | xclose(G.output_fd); |
423 | @@ -1704,6 +1846,6 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 427 | @@ -1704,6 +1850,6 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
424 | free(G.extra_headers); | 428 | free(G.extra_headers); |
425 | #endif | 429 | #endif |
426 | FINI_G(); | 430 | FINI_G(); |