Commit Graph

3507 Commits

Author SHA1 Message Date
98ae168aad Improve cert checks 2026-01-31 20:01:18 +01:00
98f13a017d * tests/test-ocsp-stap.c: Enable test for WolfSSL 2026-01-11 14:57:27 +01:00
aae08fe5ac Improve WolfSSL/OpenSSL OCSP checks
* libwget/ssl_openssl.c (wget_ssl_open): Correctly return WGET_E_CERTIFICATE.
* libwget/ssl_wolfssl.c (wget_ssl_init): Support OCSP w/o stapling.
* src/options.c (init): Set WGET_SSL_OCSP_DATE and WGET_SSL_OCSP_NONCE for WolfSSL.
* tests/test-ocsp-server.c: Enable more tests for WolfSSL.
2026-01-11 14:49:41 +01:00
24607fd500 * tests/certs: Regenerate 2026-01-08 11:41:15 +01:00
b7f3b7bff0 * libwget/http_parse.c (wget_http_parse_content_disposition): Use basename as filename 2026-01-08 10:29:08 +01:00
fb08d6e567 * libwget/cookie_parse.c (cookie_normalize_cookie): Only accept secure cookies from HTTPS 2026-01-08 10:08:57 +01:00
cafaf8ffc9 * libwget/ssl_wolfssl.c (wget_ssl_open): Enable domain check 2026-01-08 09:48:54 +01:00
774700815a * src/wget.c: Fix typo and improve output messages
Reported-by: Benno Schulenberg <coordinator@translationproject.org>
2026-01-04 18:28:44 +01:00
ff54ea25b5 Continue bulk downloads with -i after error
* libwget/decompressor.c (wget_decompress): Return error code.
* libwget/http.c: Return error from wget_decompress().
* libwget/http2.c: Likewise.
* tests/Makefile.am: New test test-broken-gzip.
* tests/test-broken-gzip.c: New test file.
2026-01-04 00:01:28 +01:00
36797ff101 Implement 1xx response skipping for HTTP/2
* libwget/http2.c (on_frame_recv_callback): Skip 1xx responses.
* tests/Makefile.am: Add test-1xx.
* tests/libtest.c (h2_on_frame_recv_callback): Send 1xx response if requested from test.
* tests/libtest.h (struct url): Add new member code_1xx.
* tests/test-1xx.c: New test file.
2026-01-03 23:30:16 +01:00
be7415fc71 Don't fetch robots.txt with --no-robots and --no-follow-sitemaps
* src/wget.c (queue_url_from_local): Skip fetching robots.txt.
* tests/test-robots-off.c: New test case for --no-robots --no-follow-sitemaps.
2026-01-03 20:09:51 +01:00
36ca81bb0f Implement --progress=dot
* src/bar.c: Main implementation of dotted progress bar.
* src/options.c: Handle different types for the dotted progress bar.
* src/wget.c: Adjust calling the progress bar.
* src/wget_bar.h: Define PROGRESS_TYPE_DOT.
* src/wget_options.h: Extend struct config.
* tests/test-wget-1.c: Simple testing if wget2 accepts the dot types.
2026-01-03 15:25:26 +01:00
77c99bbee9 * docs/wget2.md: Remove redundant period in --retry-on-http-error=list section 2026-01-02 00:02:05 +01:00
45529b4585 Add Dockerfile to build static wget2 with musl
* README.md: Add description on how to build static wget2 for Linux/amd64.
* contrib/Dockerfile.musl.static.amd64: New Dockerfile.
* contrib/Dockerfile.win32.static: Fix docker warning.
2026-01-01 14:01:08 +01:00
e5e5243cfc * contrib/Dockerfile.win32.static: Updated / fixed 2025-12-31 13:19:49 +01:00
4115806c8e * README.md: Add chown command for wget2.exe 2025-12-31 13:19:07 +01:00
b010a7e09b * contrib/release: Fix assignment of signing_key 2025-12-30 19:35:44 +01:00
485c6aa5ba Release v2.2.1 v2.2.1 2025-12-30 19:00:38 +01:00
1be59a046e * gnulib: Update 2025-12-30 19:00:30 +01:00
0390345ceb Fix redirect/mirror regression from 400713ca (#698)
* src/wget.c (process_response_header): Delegate link handling to process_response().
* tests/Makefile.am: Add test-link-location.c.
* tests/test-link-location.c: New test file.
2025-12-30 18:26:14 +01:00
69d3692c95 * docs/libwget.doxy.in: Skip building graphs because too complex 2025-12-30 17:51:54 +01:00
7b0b8e0fe1 * docs/wget2.md: Fix html examples in text 2025-12-30 17:51:08 +01:00
ceabf85d26 * README.md: Fix anchor links for Gitlab 2025-12-30 17:15:54 +01:00
b6b195707f Fix --server-response for HTTP/1.1 (#705)
* libwget/http.c (wget_http_get_response_cb): Clone header memory.
2025-12-30 17:07:31 +01:00
defac2cfcd Fix convert-links (#709)
* src/wget.c (convert_links): process URL the same way as in normalize_uri().
* tests/Makefile.am: Add new test file test-k-percent-encoding.c.
* tests/test-k-percent-encoding.c: New file.
2025-12-30 14:27:13 +01:00
bb324b89f2 * src/wget.c: Set exit status 8 on 403 2025-12-29 20:05:12 +01:00
b966fa041a * libwget/ssl_openssl.c (wget_ssl_set_config_int): Ignore WGET_SSL_DANE 2025-12-29 20:04:39 +01:00
89dde538d4 * .gitlab-ci.yml (Sanitizers/Debian): Fetch fuzzer corpora from git 2025-12-29 18:54:29 +01:00
8bd2fb62cc tests/test-limit-rate-http2.c: Increase timeout variance for valgrind tests 2025-12-29 17:56:35 +01:00
d801660640 * tests/test-ocsp-server.c: Silence syntax-check 2025-12-29 17:54:00 +01:00
37010560fc * tests/test-ocsp-server.c: Skip some tests for OpenSSL 2025-12-29 17:47:11 +01:00
f21cdfdaa6 * .gitlab-ci.yml: Fix artifacts for Scan-Build/Debian 2025-12-29 17:38:55 +01:00
5181f2ca30 * src/wget.c (set_file_metadata): Explicitly set errno to 0 2025-12-29 17:37:10 +01:00
8dbbe1e6f4 src/options.c (preload_dns_cache): Simplify fopen/fclose logic to calm scan-build 2025-12-29 17:32:07 +01:00
fe3605c49b * configure.ac: Disable several clang warnings for gnulib code 2025-12-29 17:09:51 +01:00
f1822db636 * tests/libtest.c: Use wget lib functions instead of select() 2025-12-29 14:41:50 +01:00
225e58fa42 * configure.ac: Disable UBSAN flag 'function' 2025-12-29 14:18:37 +01:00
684be47852 Fix file overwrite issue with metalink
Fix a remotely triggered arbitrary file write/overwrite abusing
metalink <file name="…"> path traversal.

Reported-by: Arkadi <arkadva8@gmail.com>
2025-12-26 19:17:42 +01:00
fc7fcbc00e Fix remote buffer overflow in get_local_filename_real()
In src/blacklist.c:get_local_filename_real(), the stack/heap selection for
fname_esc was inverted, so the code used `char tmp[1024]` exactly when the
required size is >1024, leading to stack corruption when
wget_restrict_file_name() writes into it.

This was introduced by commit 3dc30f5f0c.

Reported-by: Arkadi <arkadva8@gmail.com>
2025-12-26 18:27:29 +01:00
43cd61f0f5 * .gitlab-ci.yml: Drop -Werror for Sanitizer runner 2025-12-26 17:55:13 +01:00
ba4d64e443 Fix WolfSSL build
* Makefile.am: Run tests of GnuTLS is available.
* configure.ac: Add conditional WITH_GNUTLS_IN_TESTSUITE,
  add check for SSLv2_client_method().
* libwget/ssl_wolfssl.c (wget_ssl_init): Silently fall back to
  SSLv3 if SSLv2 is requested but not available.
2025-12-26 17:42:16 +01:00
4626211f57 * libwget/ssl_wolfssl.c (ShowX509): Fix -Wzero-as-null-pointer-constant 2025-12-26 17:42:16 +01:00
8e62f3a38f * .gitlab-ci.yml: Drop i386 CI runner 2025-12-26 17:42:15 +01:00
5766fd3e2a * .gitlab-ci.yml: Drop HTTP2 CI runner 2025-12-26 17:42:15 +01:00
7189cf41c5 Add comprehensive HTTP/2 testing infrastructure with libnghttp2
This adds extensive HTTP/2 test coverage using libnghttp2 as the test
server, covering multiplexing, stream error handling, connection
management, and settings negotiation.

* tests/libtest.h (wget_test_url_t): Add h2_delay_response and
  h2_rst_stream_error fields for HTTP/2 test control.
  (WGET_TEST_H2_MIN_CONCURRENT_STREAMS): New test flag.
  (wget_test_get_h2_server_port): Declare function.

* tests/libtest.c: Remove HAVE_MICROHTTPD_HTTP2_H infrastructure,
  (h2_session_data, h2_server_t): New structures for libnghttp2 server,
  (h2_send_callback, h2_recv_callback): Implement nghttp2 I/O callbacks,
  (h2_on_frame_recv_callback): Handle HTTP/2 frames,
  (h2_on_header_callback): Process request headers,
  (h2_data_read_callback): Stream response body with 8KB chunk limit,
  (h2_on_stream_close_callback): Clean up stream resources,
  (h2_session_data_new, h2_session_data_free): Manage session lifecycle,
  (h2_server_thread): Main server loop with TLS and ALPN support,
  (h2_server_start, h2_server_stop): Control server lifecycle,
  (_http_server_stop): Remove gnutls_global_deinit() call to fix
  server restart issues,
  (wget_test_start_server_handler): Default start_h2 to 0 (opt-in),
  enable HTTP/2 with WGET_TEST_H2_ONLY flag,
  (wget_test): Skip H2_PASS when libnghttp2 unavailable,
  (wget_test_get_h2_server_port): Return HTTP/2 server port.

* tests/Makefile.am (WGET_TESTS): Add test-http2-multiplexing,
  test-http2-stream-errors, test-http2-connection-errors,
  test-http2-settings.

* tests/test-http2-multiplexing.c: New file testing concurrent
  downloads over single HTTP/2 connection with multiplexing.

* tests/test-http2-stream-errors.c: New file testing stream error
  isolation with RST_STREAM frames.

* tests/test-http2-connection-errors.c: New file testing connection
  recovery after server restart.

* tests/test-http2-settings.c: New file testing SETTINGS frame
  exchange, header compression, and large headers.

* tests/test-limit-rate-http2.c (main): Skip 3-file multiplexed
  download test when running with HTTP/2 due to rate limiting
  limitations in test server.

The HTTP/2 test server uses libnghttp2 with GnuTLS for TLS and ALPN
negotiation. Tests verify protocol-specific features like multiplexing,
stream independence, and proper SETTINGS exchange. HTTP/2 is now opt-in
via WGET_TEST_H2_ONLY to avoid breaking existing tests.
2025-12-26 17:42:15 +01:00
c2a9108c4d Fix checks for errno
* libwget/ssl_gnutls.c (ssl_writev): Only check errno on error.
* src/job.c (job_validate_file): Set errno explicitly to 0.
* src/utils.c (mkdir_path): Check a secure value of errno.
* src/wget.c (prepare_file): Likewise.
2025-12-14 18:56:19 +01:00
087b931b7d * src/options.c (set_long_option): Allow 'no_' prefix in config options 2025-12-07 19:35:24 +01:00
a479b1aeaf * html_url (html_get_url): Remove dead code (Coverity #209327) 2025-12-07 18:09:29 +01:00
c7eb342fd1 * README.md: Remove OpenCSW badges (build pipeline isn't maintained since a while) 2025-12-07 18:03:56 +01:00
18165409bb Fix gcc 15 -Wunterminated-string-initialization
* libwget/base64.c (base64_encode): Drop explicit error length.
* libwget/buffer_printf.c (convert_pointer): Likewise.

Just cosmetics - allows to build with -Werror.
2025-11-09 19:43:29 +01:00