aboutsummaryrefslogtreecommitdiff
path: root/src/tool_metalink.c
AgeCommit message (Collapse)Author
2015-03-19metalink: fix resource leak in OOMDaniel Stenberg
Coverity CID 1288826
2015-03-06metalink: add some error checksDaniel Stenberg
malloc() and strdup() calls without checking return codes. Reported-by: Markus Elfring Bug: https://github.com/bagder/curl/issues/150
2015-03-05openssl: remove all uses of USE_SSLEAYDaniel Stenberg
SSLeay was the name of the library that was subsequently turned into OpenSSL many moons ago (1999). curl does not work with the old SSLeay library since years. This is now reflected by only using USE_OPENSSL in code that depends on OpenSSL.
2014-06-17tool_metalink: Support polarssl as digest providerMichał Górny
2014-03-01tool: Moved --stderr to the global configSteve Holme
2014-02-23tool_cfgable: Renamed Configurable structure to OperationConfigSteve Holme
To allow for the addition of a global config structure and prevent confusion between the two.
2013-12-02tool_metalink: do not use HAVE_NSS_INITCONTEXTKamil Dudka
... no longer provided by the configure script
2013-07-30md5 & metalink: use better build macros on Apple operating systemsNick Zitzmann
Previously we used __MAC_10_X and __IPHONE_X to mark digest-generating code that was specific to OS X and iOS. Now we use __MAC_OS_X_VERSION_MAX_ALLOWED and __IPHONE_OS_VERSION_MAX_ALLOWED instead of those macros. Bug: http://sourceforge.net/p/curl/bugs/1255/ Reported by: Edward Rudd
2013-01-06Revert changes relative to lib/*.[ch] recent renamingYang Tse
This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
2012-12-28build: make use of 76 lib/*.h renamed filesYang Tse
76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
2012-12-14setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>Yang Tse
Inclusion of top two most included header files now done in setup_once.h
2012-11-13tool_metalink: fix error detection of hash alg initializationKamil Dudka
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-09tool_metalink: allow to use hash algorithms provided by NSSKamil Dudka
Fixes bug #3578163: http://sourceforge.net/tracker/?func=detail&atid=100976&aid=3578163&group_id=976
2012-11-09tool_metalink: allow to handle failure of hash alg initializationKamil Dudka
2012-11-09tool_metalink: introduce metalink_cleanup() in the internal APIKamil Dudka
... to release resources allocated at global scope
2012-10-22metalink/md5: Use CommonCrypto on Apple operating systemsNick Zitzmann
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-13Fix now broken libmetalink-aware OpenSSL build.Guenter Knauf
2012-10-01tool_metalink.c: Filtered resource URLs by typeTatsuhiro Tsujikawa
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-09-12tool_metalink.c: Added name of validation hash to messagesMarc Hoersken
This makes it easier to debug broken hashes or hash functions.
2012-09-11wincrypt: Fixed cross-compilation issues caused by include nameMarc Hoersken
For some reason WinCrypt.h is named wincrypt.h under MinGW.
2012-09-11tool_metalink.c: Added support for Microsoft Windows CryptoAPIMarc Hoersken
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-11tool_metalink.c: Fixed error: 'O_BINARY' undeclaredMarc Hoersken
Check for O_BINARY which is not available on every system.
2012-09-11tool_metalink.c: Fixed validation of binary files containing EOFMarc Hoersken
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-08-08metalink: Un-broke the build when building --with-darwinsslNick Zitzmann
2012-08-06metalink: change code order to build with gnutls-nettleDaniel Stenberg
Bug: http://curl.haxx.se/bug/view.cgi?id=3554668 Reported by: Anthony G. Basile
2012-06-28Metalink: message updatesTatsuhiro Tsujikawa
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-27Metalink: updated message formatTatsuhiro Tsujikawa
2012-06-21curl: Prefixed all Metalink related messages with "Metalink: "Tatsuhiro Tsujikawa
2012-06-21curl: Made --metalink option toggle Metalink functionalityTatsuhiro Tsujikawa
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-21curl: Refactored metalink_checksumTatsuhiro Tsujikawa
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-08metalink: restore some includesDaniel Stenberg
Commit eeeba1496cbca removed them and thus broke my Linux build
2012-06-08metalink: build fixes and adjustments IIYang Tse
Additionally, make hash checking ability mandatory in order to allow metalink support in curl. A command line option could be introduced to skip hash checking at runtime, but the ability to check hashes should always be built-in when providing metalink support.
2012-06-07metalink: build fixes and adjustments IYang Tse
2012-05-26metalink: fix build errors when disabledDaniel Stenberg
2012-05-26Reduced #ifdef HAVE_METALINKTatsuhiro Tsujikawa
2012-05-26Disable hash check if neither OpenSSL nor GNUTLS is installed.Tatsuhiro Tsujikawa
2012-05-26Minimize usage of structs from libmetalinkTatsuhiro Tsujikawa
2012-05-26Check checksum of downloaded file if checksum is availableTatsuhiro Tsujikawa
Metalink file contains several hash types of checksums, such as md5, sha-1, sha-256, etc. To deal with these checksums, I created abstraction layer based on lib/curl_md5.h and lib/md5.c. Basically, they are almost the same but I changed the code so that it is not hash type dependent. Currently, GNUTLS(nettle or gcrypt) and OpenSSL functions are supported. Checksum checking is done by reopening download file. If there is an I/O error, the current implementation just prints error message and does not try next resource. In this patch, the supported hash types are: md5, sha-1 and sha-256.
2012-05-26Fixed segmentation fault when Metalink has no valid file or no resource.Tatsuhiro Tsujikawa
2012-05-26Support media-type parameter in Content-TypeTatsuhiro Tsujikawa
2012-05-26metalink: parse downloaded Metalink fileTatsuhiro Tsujikawa
Parse downloaded Metalink file and add downloads described there. Fixed compile error without metalink support.
2012-05-26metalink: show help message even if disabledTatsuhiro Tsujikawa
Print message if --metalink is used while metalink support is not enabled. Migrated Metalink support in tool_operate.c and removed operatemetalink().
2012-05-26Support Metalink.Tatsuhiro Tsujikawa
This change adds experimental Metalink support to curl. To enable Metalink support, run configure with --with-libmetalink. To feed Metalink file to curl, use --metalink option like this: $ curl -O --metalink foo.metalink We use libmetalink to parse Metalink files.