Commit Graph

11 Commits

Author SHA1 Message Date
c6ee3d79ad Fix syntax-check 'sc_prohibit_have_config_h'
* cfg.mk: Remove sc_prohibit_have_config_h from local-checks-to-skip
* libwget/*.c: Include <config.h> unconditionally
* src/*.c: Likewise
* tests/*.c: Likewise
2017-04-30 22:01:34 +02:00
7171aff7e8 Use atoll() instead of atol() for time_t variables
* libwget/cookie.c: Use atoll() instead of atol()
* libwget/hsts.c: Likewise
* libwget/http.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/tls_session.c: Likewise
* libwget/hpkp.c: Change type of maxage from long to time_t
2017-03-29 16:18:26 +02:00
706b19648f Read and write time_t as long long int
* libwget/cookie.c: Write time_t as long long int
* libwget/hsts.c:   Likewise
* libwget/ocsp.c:   Likewise
* libwget/tls_session.c: Likewise
* libwget/hpkp.c:   Read and write time_t as long long int

Reported-By: Tim Rühsen
2017-03-29 11:58:51 +05:30
64cfea7f05 * libwget/tls_session.c: Make code similar to hsts.c 2017-03-08 12:18:28 +01:00
ec396c577f Fix URLs to HTTPS where possible 2017-02-28 15:31:30 +01:00
bfcd65c12b Use typedefs for function pointer arguments
* include/wget/wget.h: Add typedefs
* libwget/cookie.c: Use typedefs
* libwget/css.c: Likewise
* libwget/css_url.c: Likewise
* libwget/decompressor.c: Likewise
* libwget/hashmap.c: Likewise
* libwget/hsts.c: Likewise
* libwget/http.c: Likewise
* libwget/init.c: Likewise
* libwget/io.c: Likewise
* libwget/list.c: Likewise
* libwget/logger.c: Likewise
* libwget/metalink.c: Likewise
* libwget/net.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/private.h: Likewise
* libwget/robots.c: Likewise
* libwget/stringmap.c: Likewise
* libwget/tls_session.c: Likewise
* libwget/vector.c: Likewise
* libwget/xml.c: Likewise
* src/blacklist.c: Likewise
* src/host.c: Likewise
* src/options.c: Likewise
* src/wget.c: Likewise
* tests/stringmap_perf.c: Likewise
* tests/test.c: Likewise
2017-01-23 14:43:17 +01:00
566e9f7c70 Add typedef for wget_update() callback functions
* include/wget/wget.h: Add typedef wget_update_cb_t
* libwget/cookie.c: Use wget_update_cb_t
* libwget/hsts.c: Likewise
* libwget/tls_session.c: Likewise
2017-01-19 17:11:58 +01:00
c270cda231 New inline function to compute length of base64 decoded string
* include/wget/wget.h (wget_base64_get_decoded_length): new function
 * libwget/tls_session.c (_tls_session_db_load): use
   wget_base64_get_decoded_length().
2016-11-06 17:10:18 +01:00
165cfa20fb Mark some functions as pure
* libwget/cookie.c (_compare_cookie{,2}): Mark as pure
* libwget/encoding.c (_utf8_is_valid): Same
* libwget/hsts.c (_compare_hsts): Same
* libwget/ocsp.c (_compare_ocsp): Same
* libwget/netrc.c (_compare_netrc): Same
* libwget/tls_session.c (_compare_tls_session): Same
2016-09-30 14:48:08 +02:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
2bc25879cf Add TLS Session Resumption with persistent cache
* include/libwget.h.in: Add wget_tls_session_* set of functions,
  add new define WGET_SSL_SESSION_CACHE
* libwget/Makefile.am: Add tls_session.c to libwget
* libwget/ssl_gnutls.c (struct _config): Add tls_session_cache.
  (struct _session_context): Add delayed_session_data.
  (wget_ssl_set_config_string): Handle WGET_SSL_SESSION_CACHE.
  (wget_ssl_open): Add False Start debug messages,
  Set session data if cound in cache,
  Write session data into cache.
  (wget_ssl_read_timeout): Write session data into cache when
    False Start has been activated.
* libwget/tls_session.c: New file with session data cache implementation
* src/options.c (print_help): Add new options --tls-resume and
  --tls-session-file.
  (config): Set tls_resume activated by default.
  (options[]): Add tls-resume and tls-session-file.
  (init): Create session file name, init session data cache,
  Set session cache for TLS layer.
  (deinit): Free session cache and session cache filename.
* src/options.h (struct config): Add tls_session_db, tls_session_file,
  tls_resume.
* src/wget.c (main): Save session cache if changed.

TLS Session Resumption speeds up TLS handshake by 1xRTT.
Together with TCP Fast Open (enabled by default), we are down at
1xRTT TLS handshake overhead. To get down to 0 RTT we need a different
TLS protocol - TLS v1.3 will hopefully soon be standardized.
2016-07-22 10:43:59 +02:00