aboutsummaryrefslogtreecommitdiff
path: root/src/tool_metalink.c
AgeCommit message (Collapse)Author
2020-05-15source cleanup: remove all custom typedef structsDaniel Stenberg
- Stick to a single unified way to use structs - Make checksrc complain on 'typedef struct {' - Allow them in tests, public headers and examples - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually typedef different types/structs depending on build conditions. Closes #5338
2020-04-14tool: do not declare functions with Curl_ prefixDaniel Stenberg
To avoid collision risks with private libcurl symbols when linked with static versions (or just versions not hiding internal symbols). Reported-by: hydra3333 on github Fixes #5219 Closes #5234
2020-03-17windows: suppress UI in all CryptAcquireContext() callsViktor Szakats
Ref: https://docs.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta#parameters Reviewed-by: Marc Hörsken Closes https://github.com/curl/curl/pull/5088
2020-03-01polarssl: Additional removalSteve Holme
Follow up to 6357a19f. Reviewed-by: Daniel Stenberg Closes #5004
2020-02-20win32: USE_WIN32_CRYPTO to enable Win32 based MD4, MD5 and SHA256 functionsSteve Holme
Whilst lib\md4.c used this pre-processor, lib\md5.c and src\tool_metalink.c did not and simply relied on the WIN32 pre-processor directive. Reviewed-by: Marcel Raad Closes #4955
2020-01-12curl: remove 'config' field from OutStructDaniel Stenberg
As it was just unnecessary duplicated information already stored in the 'per_transfer' struct and that's around mostly anyway. The duplicated pointer caused problems when the code flow was aborted before the dupe was filled in and could cause a NULL pointer access. Reported-by: Brian Carpenter Fixes #4807 Closes #4810
2019-12-01build: Disable Visual Studio warning "conditional expression is constant"Jay Satiro
- Disable warning C4127 "conditional expression is constant" globally in curl_setup.h for when building with Microsoft's compiler. This mainly affects building with the Visual Studio project files found in the projects dir. Prior to this change the cmake and winbuild build systems already disabled 4127 globally for when building with Microsoft's compiler. Also, 4127 was already disabled for all build systems in the limited circumstance of the WHILE_FALSE macro which disabled the warning specifically for while(0). This commit removes the WHILE_FALSE macro and all other cruft in favor of disabling globally in curl_setup. Background: We have various macros that cause 0 or 1 to be evaluated, which would cause warning C4127 in Visual Studio. For example this causes it: #define Curl_resolver_asynch() 1 Full behavior is not clearly defined and inconsistent across versions. However it is documented that since VS 2015 Update 3 Microsoft has addressed this somewhat but not entirely, not warning on while(true) for example. Prior to this change some C4127 warnings occurred when I built with Visual Studio using the generated projects in the projects dir. Closes https://github.com/curl/curl/pull/4658
2019-10-02curl: create easy handles on-demand and not ahead of timeDaniel Stenberg
This should again enable crazy-large download ranges of the style [1-10000000] that otherwise easily ran out of memory starting in 7.66.0 when this new handle allocating scheme was introduced. Reported-by: Peter Sumatra Fixes #4393 Closes #4438
2019-09-13curl: fix memory leaked by parse_metalink()Kamil Dudka
This commit fixes a regression introduced by curl-7_65_3-5-gb88940850. Detected by tests 2005, 2008, 2009, 2010, 2011, and 2012 with valgrind and libmetalink enabled. Closes #4326
2019-07-20curl: support parallel transfersDaniel Stenberg
This is done by making sure each individual transfer is first added to a linked list as then they can be performed serially, or at will, in parallel. Closes #3804
2019-04-11build: fix Codacy/CppCheck warningsMarcel Raad
- remove unused variables - declare conditionally used variables conditionally - suppress unused variable warnings in the CMake tests - remove dead variable stores - consistently use WIN32 macro to detect Windows Closes https://github.com/curl/curl/pull/3739
2018-08-11GCC: silence -Wcast-function-type uniformlyMarcel Raad
Pointed-out-by: Rikard Falkeborn Closes https://github.com/curl/curl/pull/2860
2018-05-21checksrc: make sure sizeof() is used *with* parenthesesDaniel Stenberg
... and unify the source code to adhere. Closes #2563
2018-05-14gcc: disable picky gcc-8 function pointer warnings in two placesDaniel Stenberg
Reported-by: Rikard Falkeborn Bug: #2560 Closes #2569
2018-03-16cleanup: misc typos in strings and commentsluz.paz
Found via `codespell` Closes #2389
2017-11-24metalink: fix memory-leak and NULL pointer dereferenceDaniel Stenberg
Reported by scan-build Closes #2109
2017-09-22metalink: fix NSS issue in MultiSSL buildsViktor Szakats
In MultiSSL mode (i.e. when more than one SSL backend is compiled in), we cannot use the compile time flag `USE_NSS` as indicator that the NSS backend is in use. As far as Metalink is concerned, the SSL backend is only used for MD5, SHA-1 and SHA-256 calculations, therefore one of the available SSL backends is selected at compile time, in a strict order of preference. Let's introduce a new `HAVE_NSS_CONTEXT` constant that can be used to determine whether the SSL backend used for Metalink is the NSS backend, and use that to guard the code that wants to de-initialize the NSS-specific data structure. Ref: https://github.com/curl/curl/pull/1848
2017-09-11code style: use spaces around plusesDaniel Stenberg
2017-08-28metalink: allow compiling with multiple SSL backendsJohannes Schindelin
Previously, the code assumed that at most one of the SSL backends would be compiled in, emulating OpenSSL's functions if the configured backend was not OpenSSL itself. However, now we allow building with multiple SSL backends and choosing one at runtime. Therefore, metalink needs to be adjusted to handle this scenario, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-08-18metalink: adjust source code styleJohannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-08-10metalink: fix error: ‘*’ in boolean context, suggest ‘&&’ insteadDaniel Stenberg
2017-06-07metalink: remove unused printf() argumentDaniel Stenberg
2016-11-02metalink: simplify the hex parsing functionDaniel Stenberg
... and now it avoids using the libcurl toupper() function
2016-10-31strcase: make the tool use curl_str[n]equal insteadDaniel Stenberg
As they are after all part of the public API. Saves space and reduces complexity. Remove the strcase defines from the curlx_ family. Suggested-by: Dan Fandrich Idea: https://curl.haxx.se/mail/lib-2016-10/0136.html
2016-10-31strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg
We had some confusions on when each function was used. We should not act differently on different locales anyway.
2016-02-03URLs: change all http:// URLs to https://Daniel Stenberg
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