Commit Graph

50 Commits

Author SHA1 Message Date
3dc7f71098 Update copyright year 2022-02-25 17:46:43 +01:00
d1ff6143f7 WolfSSL: Fix buffer overflow in SHA512 hashing
* libwget/hashfile.c (wget_hash_deinit, WOLFSSL): Include wolfssl/options.h.
2022-01-09 13:44:18 +01:00
22162f82b2 Update copyright year 2021-01-22 21:58:38 +01:00
d6af2800d5 Fix clang 11 warnings in WolfSSL code.
* libwget/hashfile.c (wget_hash_fast): Cast size_t to unsigned int.
  (wget_hash): Likewise.
* libwget/ssl_wolfssl.c (ShowX509): Use XFREE without trailing semicolon.
  (wget_ssl_open): Use 64bit to 32bit casts to pacify clang 11.
2020-12-20 17:31:28 +01:00
59d9ecd9c0 * Update copyright year to 2020 2020-01-10 00:33:02 +01:00
367846d170 * libwget/hashfile.c: Improve C99 compliancy 2019-09-18 17:09:44 +02:00
4b9edbad2d Update Copyright statements to be compatible with update-copyright module 2019-09-10 23:41:56 +02:00
f08fc4c515 Fix hashing with Gcrypt backend 2019-08-29 22:36:36 +02:00
77c36cb2fe Fix hashing with Nettle backend 2019-08-29 22:36:35 +02:00
787ae622e7 Fix hashing with OpenSSL backend 2019-08-29 22:36:35 +02:00
d785886939 Fix hashing with GnuTLS backend
* libwget/hashfile.c: Fix the GnuTLS functions
2019-08-29 22:36:35 +02:00
8f172db636 * libwget/hashfile.c (wget_hash_file_fd): Do not close fd on error 2019-08-29 22:36:35 +02:00
4c3945641a Fix hashing with WolfTLS backend
* include/wget/wget.h: Change param for wget_hash_init(),
  change param and return type for wget_hash_deinit()
* libwget/hashfile.c: Rewrite hashing functions for WITH_LIBWOLFCRYPT
* unit-tests/test.c: Add tests for incremental hashing
2019-08-29 22:36:35 +02:00
9bd04955e0 * libwget/hashfile.c: Make use of WGET_E_UNSUPPORTED 2019-08-29 22:36:35 +02:00
e4bcb5eab6 Add more hash backends 2019-08-29 22:36:35 +02:00
76bc9ecb93 Introduce WGET_E_IO
* include/wget/wget.h: Introduce WGET_E_IO
* libwget/error.c: Add WGET_E_IO to wget_strerror()
* libwget/hashfile.c: Make use of WGET_E_IO
* libwget/io.c: Likewise
2019-08-17 18:32:14 +02:00
fc627c2546 Rename wget_digest_algorithm_t -> wget_digest_algorithm
* include/wget/wget.h: Rename wget_digest_algorithm_t -> wget_digest_algorithm
* libwget/hash_printf.c: Likewise
* libwget/hashfile.c: Likewise
2019-07-19 16:55:08 +02:00
4bb81b423a Rename wget_hash_hd_t -> wget_hash_hd
* include/wget/wget.h: Rename wget_hash_hd_t -> wget_hash_hd
* libwget/hashfile.c: Likewise
2019-07-19 16:53:19 +02:00
4d190a1b38 Rename _wget_hash_hd_st -> wget_hash_hd_st
* include/wget/wget.h: Likewise
* libwget/hashfile.c: Likewise
2019-06-27 12:22:48 +02:00
5bc488bbac Fix several forgotten xmalloc -> wget_malloc
* libwget/css.c (wget_css_parse_file): Rename xmalloc->wget_malloc
* libwget/hashfile.c (wget_hash_init): Likewise
* libwget/ssl_gnutls.c (_cert_verify_hpkp): Likewise
* libwget/xml.c (wget_xml_parse_file): Likewise
2019-06-21 11:42:01 +02:00
cdb3600791 Update copyrigght to 2019 2019-01-02 12:42:53 +01:00
3688ffb941 Update copyright to 2018 2018-04-30 20:52:11 +02:00
6aa809d2c4 Fix scan-build for gnulib hash code
* .gitlab-ci.yml: Obsolete configure cache
* include/wget/wget.h: Add WGET_DIGTYPE_MAX
* libwget/hashfile.c: Fix code
2018-04-06 12:06:19 +02:00
cf37e7a0e8 * libwget/hashfile.c: Fix warnings 2018-04-06 11:35:11 +02:00
a2ffb6a07c Check for gnutls/crypto.h
* configure.ac: Check for gnutls/crypto.h
* libwget/hashfile.c: Need HAVE_GNUTLS_CRYPTO_H to include gnutls/crypto.h

Found this problem on the OpenCSW Solaris build farm
2018-04-03 16:53:30 +02:00
75cab6754e Make strings translatable for error_printf()
* libwget/*.c: Likewise
* src/*.c: Likewise
* po/POTFILES.in: Add source files
2018-01-11 13:11:36 +01:00
6656526e22 * libwget/hashfile.c: Use doxygen 'ingroup' instead of 'defgroup' 2017-12-02 14:33:55 +01:00
40cef71282 Reduce scope of variables
* libwget/bar.c: Likewise
* libwget/console.c: Likewise
* libwget/encoding.c: Likewise
* libwget/hashmap.c: Likewise
* libwget/io.c: Likewise
* libwget/md5.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ssl_gnutls.c: Likewise
* libwget/xml.c: Likewise
* src/job.c: Likewise
* src/plugin.c: Likewise
* libwget/hashfile.c: Include local private.h
* src/host.c: Remove unused find_free_job_context struct

Found by: cppcheck
2017-10-05 00:27:31 +05:30
d9af6d266f Open files in binary mode where needed
* examples/websequencediagram.c: Use binary mode on file open
* libwget/css.c: Likewise
* libwget/hashfile.c: Likewise
* libwget/http_highlevel.c: Likewise
* libwget/io.c: Likewise
* libwget/xml.c: Likewise
* src/job.c: Likewise
* src/options.c: Likewise
* src/wget.c: Likewise
* tests/libtest.c: Likewise
* tests/stringmap_perf.c: Likewise

This fixes discrepancies between stat/st_size and read bytes on
MinGW / Wine / Windows.
2017-05-20 22:03:45 +02:00
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
59f163cd7b Remove useless cpp parens (syntax-check) 2017-04-29 20:56:57 +02:00
56efdab1a7 Remove trailing whitespaces (syntax-check) 2017-04-29 20:51:32 +02:00
bc06128232 Fix space-tab sequences (syntax-check) 2017-04-29 20:40:14 +02:00
58f1274808 Do not include unused strings.h
* examples/getstream.c: Remove #include <strings.h>
* libwget/css.c: Likewise
* libwget/encoding.c: Likewise
* libwget/hashfile.c: Likewise
* libwget/metalink.c: Likewise
* libwget/net.c: Likewise
* libwget/robots.c: Likewise
* src/wget.c: Likewise
2017-04-29 20:24:19 +02:00
bc824ea518 * libwget/hashfile.c: Silence -Wundef from gnulib's hash code 2017-04-06 10:54:50 +02:00
ec396c577f Fix URLs to HTTPS where possible 2017-02-28 15:31:30 +01:00
cb5f9a230f Check for gcrypt.h
* configure.ac: Check for gcrypt.h
* libwget/hashfile.c: Check for HAVE_GCRYPT_H
2016-10-17 21:05:23 +02:00
fd46f870b1 Add gnulib digest hash fallback
* bootstrap.conf: Add md2, md5, sha1, sha256, sha512 modules
* libwget/hashfile.c: Add code branch to use gnulib functions if needed
2016-10-17 21:04:36 +02:00
b701a06495 * libwget/hashfile.c: Remove unused defines 2016-10-17 11:41:01 +02:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
dd3c2f63b2 Updated copyright year for all relevant files 2016-01-25 13:06:21 +01:00
ce38918e06 Add docs for hash functions
* docs/Makefile.am: Add libwget-hash.3
* include/libwget.h.in: Remove hash function docs
* libwget/hashfile.c: Add hash function docs
2016-01-18 15:53:29 +01:00
120beed0ed Fix resource leak when using libgcrypt for hashing
* libwget/hashfile.c (wget_hash_deinit): Close gcrypt context
2016-01-18 10:29:53 +01:00
984776008a Remove usage of alloca()
* libwget/hashfile.c (wget_hash_file_fd): Do not use alloca()
* src/options.c (_read_config): Do not use alloca()
2016-01-11 13:09:29 +01:00
6a28c7c07c Add support for gcrypt hashing
* configure.ac: Add libgcrypt as fallback for libnettle
* libwget/hashfile.c: Add gcrypt hash functions
2016-01-07 17:08:28 +01:00
e8260a2e21 Fix hash functions for use with libnettle
* src/hashfile: Add needed includes (nettle 3.1.1 and 2.7)
* src/hashfile (wget_hash_deinit): Call digest() instead of update()
2016-01-07 15:12:57 +01:00
f63767b028 Documented hashing functions 2015-10-23 15:49:15 +02:00
10003c829f Initial docs for hashing utils 2015-10-23 15:48:39 +02:00
0f8e49128a Transfer copyright to Free Software Foundation, Inc. 2015-09-22 11:50:06 +02:00
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00