Commit Graph

4258 Commits

Author SHA1 Message Date
Tim Rühsen
470a7dfc84 * src/gnutls.c (ssl_init): Small cleanup fixing output of ncerts 2020-05-22 15:49:12 +02:00
Tim Rühsen
c23eaff56f * src/convert.c (downloaded_files_free): Only compile if DEBUG_MALLOC or TESTING is defined 2020-05-01 17:54:58 +02:00
Tim Rühsen
5a141065c4 * src/netrc.c (free_netrc): Only compile if DEBUG_MALLOC or TESTING is defined 2020-05-01 17:54:58 +02:00
Вячеслав Петрищев
7a3a82faf8 Fix SSL/TLS timeout issues.
* connect.c (fd_read, fd_peek): Let implementation take care about timeout.
* gnutls.c (_do_handshake, _do_reauth, wgnutls_read_timeout): Fix support for interactive timeout.
* gnutls.c (wgnutls_peek): Let wgnutls_read_timeout() take care about timeout.
* openssl.c (openssl_read_peek): Fix 0 (-1) timeout.
* retr.c (fd_read_body): Avoid wrong 'interactive timeout'.
2020-05-01 17:53:47 +02:00
Вячеслав Петрищев
c12a295496 Set interactive to true for bar progress.
* src/progress.c (bar_set_params): Set interactive to true.
* src/retr.c (fd_read_body): Avoid call fd_read with 0 timeout.
2020-05-01 17:53:21 +02:00
Вячеслав Петрищев
fb5e2e628d New implementation for openssl_read, openssl_peek ssl_connect_with_timeout (openssl)
Add new implementation for openssl_read, openssl_peek
ssl_connect_with_timeout (openssl). Thats allow continue
read after ETIMEDOUT (if timeout < opt.read_timeout)
without 'Retrying', and do not create thread (under MSWin)
for every read. Old implementation, (with fix for 'timeout')
avaible for build with: -DOPENSSL_RUN_WITHTIMEOUT

Add timeout for transport_implementation {reader,peeker};

* src/init.c (cmd_time): Add check for negative value.
* src/connect.h (transport_implementation {reader,peeker}): Change function prototype.
* src/connect.c (select_fd_nb): New function, aviod conversion to blocked under MSWin.
* src/gnutls.c
   (gnutls_read): Fix: using timeout, seting ETIMEDOUT, conversion to blocked.
   (gnutls_peek): Likewise.
   (wgnutls_errstr): Add errmsg for ETIMEDOUT.
   (_do_handshake) (_do_reauth): Fix conversion to blocked.
* src/openssl.c:
   Add new implementation for openssl_read, openssl_peek, ssl_connect_with_timeout.
   (init_prng): when option --random-file given warn user if RAND_load_file() fail.
2020-05-01 17:51:48 +02:00
Tim Rühsen
9dacc2836a Add missing linefeed in output strings
* src/ftp.c (getftp): Add linefeed to error message.
* src/res.c (res_parse_from_file): Likewise.
* src/utils.c (fopen_stat): Likewise.
  (open_stat): Likewise.
2020-04-18 18:39:50 +02:00
Tim Rühsen
6e5cf727c5 * src/metalink.c: Include filename.h instead of dosname.h 2020-03-28 19:26:12 +01:00
Tim Rühsen
78ef6fab13 * gnulib: Update 2020-03-28 19:23:35 +01:00
Tomas Hozza
706e71564c Don't print message about loading crl or ca-cert files with --no-verbose
* src/gnutls.c (ssl_init): Use LOG_VERBOSE verbosity for informative
  message related to loading CRL or CA certificate file.

Before change [1], wget didn't produce any output related to loading CA
certificates when --no-verbose option has been used. When --no-verbose
option is used, only error messages and basic information should get
printed. Information about loading CRL or CA certificate is probably not
a basic information. Any error when loading the CRL or CA certificate
will be still printed with --no-verbose.

Some users rely on wget not printing such information and they consider
it a regression.

Reported as https://bugzilla.redhat.com/show_bug.cgi?id=1807267

[1] http://git.savannah.gnu.org/cgit/wget.git/commit/?id=e4a8fe84e2b813b65d91aec29298eecabe4850a5

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2020-03-24 14:58:01 +01:00
Tim Rühsen
103aaf7740 Add NTLM fuzzer
* configure.ac: Create WITH_NTLM conditional.
* fuzz/Makefile.am: Add wget_ntlm_fuzzer.
* fuzz/wget_ntlm_fuzzer.c: New file.
* fuzz/wget_ntlm_fuzzer.in/*: Initial fuzz corpora.
2020-03-06 18:52:37 +01:00
Tim Rühsen
4221b5656a * src/http.c (check_auth): Fix memory leak 2020-03-06 12:09:02 +01:00
Tim Rühsen
fe5fbdd947 * src/http-ntlm.c (mkhash): Fix read buffer overflow 2020-03-06 11:37:57 +01:00
Tim Rühsen
7c017e604c * README.checkout: Fix gperf typo and tab indentation 2020-03-05 21:08:07 +01:00
Tim Rühsen
0a0177c694 * .gitlab-ci.yml: Generate online docs and coverage reports for Gitlab 2020-03-05 21:08:07 +01:00
Tim Rühsen
238074e2b8 Add code coverage reporting
* configure.ac: Add AX_CODE_COVERAGE.
* Makefile.am: Add rules 'check-coverage' and 'fuzz-coverage'.
* fuzz/Makefile.am: Amend LDADD, AM_CFLAGS and AM_CPPFLAGS.
* src/Makefile.am: Amend LDADD, AM_CFLAGS and AM_CPPFLAGS.

This add a new configure option, --enable-code-coverage.

With this option enabled, generate test code coverage with
  make code-coverage
and generate coverage for the fuzz test corpora with
  make fuzz-coverage
2020-03-05 20:24:07 +01:00
Tim Rühsen
6377ae1647 * src/http.c: Don't cast 3rd param to request_set_header. 2020-03-05 19:19:42 +01:00
Tim Rühsen
4e5a75566a * README: Fix typo 'can retrieves' -> 'can retrieve' 2020-03-05 19:10:55 +01:00
Darshit Shah
2db7fe688d * doc/wget.texi: Add maintainers and mention wget2 2020-03-03 20:50:05 +01:00
Darshit Shah
87815e223d doc/wget.texi: Clarify usage of --level 2020-03-03 20:10:51 +01:00
Tim Rühsen
eb02512a40 * src/http.c (gethttp): Remove unneeded free of hstat.(message|error) 2020-03-03 19:33:53 +01:00
Tim Rühsen
1ac3812e8a * src/http.c (gethttp): Fix memleaks
Reported-by: Вячеслав Петрищев
2020-03-03 18:38:41 +01:00
Tim Rühsen
910c0abe7a * src/http.c (read_response_body): Fix memleak
Reported-by: Вячеслав Петрищев
2020-03-03 10:26:09 +01:00
Tim Rühsen
be51eeceab * contrib/spell-checker: Add lightening to exceptions 2020-02-29 18:23:45 +01:00
Tim Rühsen
f4a57afd42 Always build ssl_cleanup
* src/gnutls.c (ssl_cleanup): Don't build conditionally.
* src/openssl.c (ssl_cleanup): Likewise
2020-02-29 17:25:41 +01:00
Tim Rühsen
3e2f450c6a * doc/wget.texi: Fix spelling error
Reported-by: Jim Cathey
2020-02-28 22:03:35 +01:00
Tim Rühsen
fded294d7a * src/convert.c (convert_cleanup): Free downloaded_css_set 2020-02-27 20:04:24 +01:00
Tim Rühsen
c0d76ec935 * src/openssl.c (ssl_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:59:15 +01:00
Tim Rühsen
472823283c * src/gnutls.c (ssl_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:59:05 +01:00
Tim Rühsen
b0e94e582b * src/netrc.c (netrc_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:56:40 +01:00
Tim Rühsen
8215479ffb * src/log.c (log_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:56:05 +01:00
Tim Rühsen
30139c6745 * src/host.c (host_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:55:31 +01:00
Tim Rühsen
4588045b28 * src/spider.c (spider_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:54:48 +01:00
Tim Rühsen
765271fdf5 * src/res.c (res_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:53:57 +01:00
Tim Rühsen
e52e418bdd * src/convert.c (convert_cleanup): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:53:15 +01:00
Tim Rühsen
a3d3322a48 * src/html-url.c (cleanup_html_url): Only compile for DEBUG_MALLOC or TESTING 2020-02-27 19:51:55 +01:00
Tim Rühsen
ee187476de * src/http.c (http_cleanup): Free hashtable basic_authed_hosts 2020-02-27 19:33:47 +01:00
Tim Rühsen
8cd4dcc278 * src/cookies.c (cookie_jar_delete): Set psl to NULL after calling psl_free 2020-02-27 14:38:01 +01:00
Tim Rühsen
4d8bf37870 * src/init.c (cleanup): Call ssl_cleanup and connect_cleanup 2020-02-27 14:30:53 +01:00
Tim Rühsen
b209ca91fb Add ssl_cleanup to free memory
* src/ssl.h: Add declaration for ssl_cleanup.
* src/openssl.c: Add ssl_cleanup stub.
* src/gnutls.c: Implement ssl_cleanup.
2020-02-27 14:29:25 +01:00
Tim Rühsen
7146b9dc77 * src/http.c (http_cleanup): Call invalidate_persistent to free resources 2020-02-27 14:28:10 +01:00
Tim Rühsen
b3dc802efb * src/cookies.c: Free PSL in cookie_jar_delete 2020-02-27 14:27:05 +01:00
Tim Rühsen
6938c84aa4 * src/connect.c (connect_cleanup): Only needed with DEBUG_MALLOC or TESTING 2020-02-27 14:26:31 +01:00
Tim Rühsen
8010507d73 * src/http.c (http_loop): Avoid unneeded strdup 2020-02-27 11:35:50 +01:00
Вячеслав Петрищев
f747eea059 * src/http.c (gethttp): Fix memleak 2020-02-27 11:12:27 +01:00
Tim Rühsen
46a6e2957e * src/http.c: Do not reveal OS type to server via User-Agent: header
Following the "privacy by design" principle, which is now European law by
virtue of the GDPR since 2018, the client should not transmit the operating
system.

Fixes #57884
Reported-by: Bruno Haible
2020-02-23 18:51:10 +01:00
Tim Rühsen
04b7369490 * tests/unit-tests.c: Fix 'multiple definition of...' with gcc 10 2020-02-22 13:41:04 +01:00
Tim Rühsen
8e130c32ba Split unique_name into two functions with just one arg
* src/http.c (check_file_output): Call unique_name_passthrough.
* src/metalink.c (badhash_suffix): Call unique_name.
* src/url.c (url_file_name): Call unique_name_passthrough.
* src/utils.c: Split unique_name, amend description.
* src/utils.h: Amend unique_name, add unique_name_passthrough.
2020-02-22 12:59:18 +01:00
Tim Rühsen
88d841c651 * .gitlab-ci.yml: Set tag 'linux' explicitly for each runner 2020-02-22 08:53:56 +01:00
Tim Rühsen
d08bdbc878 * src/http.c (print_response_line): Fixed comparison
Introduced in 68868bbb37 (13.2.2020).

Reported-by: Gisle Vanem
2020-02-22 08:47:20 +01:00