Commit Graph

1510 Commits

Author SHA1 Message Date
Kamil Dudka 1099f3a071 tool_metalink: fix error detection of hash alg initialization
The {MD5,SHA1,SHA256}_Init functions from OpenSSL are called directly
without any wrappers and they return 1 for success, 0 otherwise.  Hence,
we have to use the same approach in all the wrapper functions that are
used for the other crypto libraries.

This commit fixes a regression introduced in commit dca8ae5f.
2012-11-13 13:17:45 +01:00
Kamil Dudka 49c37e6c1c tool_metalink: allow to use hash algorithms provided by NSS
Fixes bug #3578163:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=3578163&group_id=976
2012-11-09 10:42:54 +01:00
Kamil Dudka dca8ae5f02 tool_metalink: allow to handle failure of hash alg initialization 2012-11-09 10:27:10 +01:00
Kamil Dudka cf75a64651 tool_metalink: introduce metalink_cleanup() in the internal API
... to release resources allocated at global scope
2012-11-09 10:27:10 +01:00
Guenter Knauf 5a4f6413d1 Added deps for static metalink-aware MinGW builds. 2012-11-08 18:41:59 +01:00
Daniel Stenberg a1be8e7f9b curl: set CURLOPT_SSL_VERIFYHOST to 0 to disable 2012-11-06 22:27:25 +01:00
Dave Reisner 550e403f00 uniformly use AM_CPPFLAGS, avoid deprecated INCLUDES
Since automake 1.12.4, the warnings are issued on running automake:

  warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Avoid INCLUDES and roll these flags into AM_CPPFLAGS.

Compile tested on:
  Ubuntu 10.04 (automake 1:1.11.1-1)
  Ubuntu 12.04 (automake 1:1.11.3-1ubuntu2)
  Arch Linux (automake 1.12.4)
2012-11-06 00:32:21 +01:00
Nick Zitzmann 94891ff296 metalink/md5: Use CommonCrypto on Apple operating systems
Previously the Metalink code used Apple's CommonCrypto library only if
curl was built using the --with-darwinssl option. Now we use CommonCrypto
on all Apple operating systems including Tiger or later, or iOS 5 or
later, so you don't need to build --with-darwinssl anymore. Also rolled
out this change to libcurl's md5 code.
2012-10-22 23:32:59 +02:00
Guenter Knauf c79c0909d9 Fix now broken libmetalink-aware OpenSSL build. 2012-10-13 01:03:34 +02:00
Guenter Knauf 3fc5779b91 Revert c44e674; add OpenSSL includes/defines.
The makefile is designed to build against a libmetalink devel package;
therefore is does not matter what will change inside libmetalink.
Add OpenSSL includes and defines for libmetalink-aware OpenSSL builds.
2012-10-13 00:48:05 +02:00
Tatsuhiro Tsujikawa 42bbc5ce10 tool_metalink.c: Filtered resource URLs by type
In Metalink v3, the type attribute of url element indicates the
type of the resource the URL points to. It can include URL to the
meta data, such as BitTorrent metainfo file.  In Curl, we are not
interested in these meta data URLs. Instead, we are only
interested in the HTTP and FTP URLs. This change filters out
non-HTTP and FTP URLs. If we don't filter out them, it will be
downloaded by curl and hash check will fail if hash is provided
and next URL will be tried. This change will cut this useless
network transfer.
2012-10-01 22:03:07 +02:00
Marc Hoersken d89861f651 Makefile.vc6: Follow up on 0c8ccf7 2012-09-24 10:26:15 +02:00
Marc Hoersken a34197ef77 tool_metalink.c: Added name of validation hash to messages
This makes it easier to debug broken hashes or hash functions.
2012-09-12 00:09:23 +02:00
Marc Hoersken 7f7e2ea72f wincrypt: Fixed cross-compilation issues caused by include name
For some reason WinCrypt.h is named wincrypt.h under MinGW.
2012-09-11 14:35:18 +02:00
Marc Hoersken c44e6741ce Makefile.m32: Updated to build against libmetalink 0.1.2
The include and library path were moved within libmetalink, this
patch adjusts the defaults provided within the curl MinGW makefile.
2012-09-11 13:37:37 +02:00
Marc Hoersken 94c3e0f702 tool_metalink.c: Added support for Microsoft Windows CryptoAPI
Since Metalink support requires a crypto library for hash functions
and Windows comes with the builtin CryptoAPI, this patch adds that
API as a fallback to the supported crypto libraries.
It is automatically used on Windows if no other library is provided.
2012-09-11 13:37:30 +02:00
Marc Hoersken 71813f5e46 tool_metalink.c: Fixed error: 'O_BINARY' undeclared
Check for O_BINARY which is not available on every system.
2012-09-11 08:20:43 +02:00
Marc Hoersken a6df3550cf tool_metalink.c: Fixed validation of binary files containing EOF
Since Windows/MinGW threat 0x1A as the EOF character, reading binary
files which contain that byte does not work using text mode.
The read function will only read until the first 0x1A byte. This
means that the hash is not computed from the whole file and the
final validation check using hash comparision fails.
2012-09-11 01:42:58 +02:00
David Blaikie 8b5d050267 tool_easysrc.c: Test pointers against NULL
While validating a new Clang diagnostic (-Wnon-literal-null-conversion -
yes, the name isn't quite correct in this case, but it suffices) I found
a few violations of it in Curl.
2012-09-06 21:00:26 +02:00
Nick Zitzmann 1de496cf0f metalink: Un-broke the build when building --with-darwinssl 2012-08-08 11:16:26 +02:00
Daniel Stenberg 73b1a965f7 globbing: fix segfault when >9 globs were used
Stupid lack of range checks caused the code to overwrite local variables
after glob number nine. Added checks now.

Bug: http://curl.haxx.se/bug/view.cgi?id=3546353
2012-08-07 13:45:59 +02:00
Daniel Stenberg 3b9103e4a6 operate: fix clang-analyzer warnings for never read variables
Two separate "Value stored to 'XXX' is never read" warnings
2012-08-06 23:59:28 +02:00
Daniel Stenberg 77c66e0247 operate: fix clang-analyzer warning
Value stored to 'separator' is never read
2012-08-06 23:32:49 +02:00
Daniel Stenberg 9f304291bd metalink: change code order to build with gnutls-nettle
Bug: http://curl.haxx.se/bug/view.cgi?id=3554668
Reported by: Anthony G. Basile
2012-08-06 22:39:13 +02:00
Kamil Dudka 487406c3c0 tool_operate: fix misplaced initialization of orig_noprogress
... and orig_isatty which caused --silent to be entirely ignored in case
the standard output was redirected to a file!
2012-07-22 02:06:22 +02:00
Daniel Stenberg ff318a6302 getparam: fix the GetStr() macro
It should return PARAM_NO_MEM if the strdup fails. Spotted by
clang-analyzer
2012-07-15 20:33:11 +02:00
Guenter Knauf a39789c85c Minor fixes to MinGW makefiles. 2012-07-12 14:15:58 +02:00
Guenter Knauf dfe405076e Removed libcurl.imp from Makefile.am.
Updated .gitignore for NetWare created files.
2012-07-11 17:40:09 +02:00
Guenter Knauf f9dfd7e4b7 Changed MinGW makefiles to use WINSSL now. 2012-07-11 11:33:08 +02:00
Daniel Stenberg f2b6ebed7b cmdline: parse numerical options stricter
1 - str2offset() no longer accepts negative numbers since offsets are by
nature positive.

2 - introduced str2unum() for the command line parser that accepts
numericals which are not supposed to be negative, so that it will
properly complain on apparent bad uses and mistakes.

Bug: http://curl.haxx.se/mail/archive-2012-07/0013.html
2012-07-10 23:11:30 +02:00
Guenter Knauf 9a158f1ef0 Removed obsolete include path to project root. 2012-07-08 18:06:15 +02:00
Guenter Knauf 6388ac7dc1 Renamed vars to avoid shadow global declaration. 2012-07-04 12:54:21 +02:00
Guenter Knauf 6fb0ed88d6 Moved some patterns to subfolder's .gitignore. 2012-07-03 14:31:50 +02:00
Guenter Knauf 1ba5712f88 MinGW makefile tweaks for running from sh.
Added function macros to make path converting easier.
Added CROSSPREFIX to all compile tools.
2012-07-03 12:56:41 +02:00
Tatsuhiro Tsujikawa 89b431f60f curl: Added runtime version check for libmetalink 2012-07-02 16:28:01 +02:00
Tatsuhiro Tsujikawa 4e3320a679 Include metalink/metalink.h for libmetalink functions 2012-07-02 03:39:21 +02:00
Tatsuhiro Tsujikawa bf4580d5fd Metalink: message updates
Print "parsing (...) OK" only when no warnings are generated.  If
no file is found in Metalink, treat it FAILED.

If no digest is provided, print WARNING in parse_metalink().
Also print validating FAILED after download.

These changes make tests 2012 to 2016 pass.
2012-06-28 00:26:16 +02:00
Tatsuhiro Tsujikawa 3e6dfe138a Metalink: updated message format 2012-06-27 13:15:59 +02:00
Tatsuhiro Tsujikawa 7f59577fdd Metalink: ignore --include if --metalink is used.
Including headers in response body will break Metalink XML parser.
If it is included in the file described in Metalink XML, hash check
will fail. Therefore, --include should be ignored if --metalink is
used.
2012-06-22 18:58:30 +02:00
Tatsuhiro Tsujikawa aefb9196cf curl: Prefixed all Metalink related messages with "Metalink: " 2012-06-21 17:34:54 +02:00
Tatsuhiro Tsujikawa 7561a0fc83 curl: Restore noprogress and isatty config values.
The noprogress and isatty in Configurable are global, in a sense
that they persist in one curl invocation. Currently once one
download writes its response data to tty, they are set to FALSE
and they are not restored on successive downloads.  This change
first backups the current noprogress and isatty, and restores
them when download does not write its data to tty.
2012-06-21 03:35:52 +02:00
Tatsuhiro Tsujikawa 196c8242ca curl: Made --metalink option toggle Metalink functionality
In this change, --metalink option no longer takes argument.  If
it is specified, given URIs are processed as Metalink XML file.
If given URIs are remote (e.g., http URI), curl downloads it
first. Regardless URI is local file (e.g., file URI scheme) or
remote, Metalink XML file is not written to local file system and
the received data is fed into Metalink XML parser directly.  This
means with --metalink option, filename related options like -O
and -o are ignored.

Usage examples:

$ curl --metalink http://example.org/foo.metalink

This will download foo.metalink and parse it and then download
the URI described there.

$ curl --metalink file://foo.metalink

This will parse local file foo.metalink and then download the URI
described there.
2012-06-21 03:35:23 +02:00
Tatsuhiro Tsujikawa 424bb35877 curl: Refactored metalink_checksum
When creating metalink_checksum from metalink_checksum_t, first
check hex digest is valid for the given hash function.  We do
this check in the order of digest_aliases so that first good
match will be chosen (strongest hash function available).  As a
result, the metalinkfile now only contains at most one
metalink_checksum because other entries are just redundant.
2012-06-21 03:34:37 +02:00
Gisle Vanem 08e0ad7b39 tool_doswin.c: fix djgpp function _use_lfn() used without a prototype
http://curl.haxx.se/mail/archive-2012-06/0028.html
2012-06-20 23:40:42 +02:00
Guenter Knauf feaf8f9590 Fixed NetWare makefile broken from last commit. 2012-06-19 11:55:06 +02:00
Guenter Knauf 705330c750 Some more NetWare makefile tweaks for metalink. 2012-06-18 23:19:35 +02:00
Yang Tse 599a2c1f1a tool_cb_see.c: WinCE build adjustment 2012-06-18 18:52:29 +02:00
Yang Tse 819afe46ee schannel: remove version number and identify its use with 'schannel' literal
Version number is removed in order to make this info consistent with
how we do it with other MS and Linux system libraries for which we don't
provide this info.

Identifier changed from 'WinSSPI' to 'schannel' given that this is the
actual provider of the SSL/TLS support. libcurl can still be built with
SSPI and without SCHANNEL support.
2012-06-13 16:42:48 +02:00
Daniel Stenberg af0888aaf6 Revert: 634f7cfee4 partially
Make sure CURL_VERSION_SSPI is present and works as in previous releases
for ABI and API compatibility reasons.
2012-06-11 22:58:39 +02:00
Steve Holme 9a51c11074 Makefile.vc6: Added version.lib if built with SSPI 2012-06-11 19:04:16 +02:00