cURL cURL > Development > Recent Source Code Activity

Recent Activity in the repo

The 100 latest commits in curl's git repository

win32: Fixed WinSock 2 #ifHaris Okanovic

A conditionally compiled block in connect.c references WinSock 2 symbols, but used `#ifdef HAVE_WINSOCK_H` instead of `#ifdef HAVE_WINSOCK2_H`.

Bug: http://curl.haxx.se/mail/lib-2014-08/0155.html

M lib/connect.c
Curl_disconnect: don't free the URLDaniel Stenberg

The URL is not a property of the connection so it should not be freed in the connection disconnect but in the Curl_close() that frees the easy handle.

Bug: http://curl.haxx.se/mail/lib-2014-08/0148.html Reported-by: Paras S

M lib/url.c
help output: minor whitespace editsDaniel Stenberg

Should've been amended in the previous commit but wasn't due to a mistake.

M src/tool_help.c
help output: use ≥2 spaces between option and descriptionZearin

... and some other cleanups

M src/tool_help.c
FAQ: some actually sometimes get paid...Daniel Stenberg
M docs/FAQ
sasl_sspi: Fixed a memory leak with the GSSAPI base-64 decoded challengeSteve Holme
M lib/curl_sasl_sspi.c
sasl_sspi: Renamed GSSAPI mutual authentication parameterSteve Holme

...From "mutual" to "mutual_auth" which better describes what it is.

M lib/curl_sasl_sspi.c
sasl_sspi: Corrected some of the GSSAPI security message error codesSteve Holme

Corrected a number of the error codes that can be returned from the Curl_sasl_create_gssapi_security_message() function when things go wrong.

It makes more sense to return CURLE_BAD_CONTENT_ENCODING when the inbound security challenge can't be decoded correctly or doesn't contain the KERB_WRAP_NO_ENCRYPT flag and CURLE_OUT_OF_MEMORY when EncryptMessage() fails. Unfortunately the previous error code of CURLE_RECV_ERROR was a copy and paste mistakes on my part and should have been correct in commit 4b491c675f :(

M lib/curl_sasl_sspi.c
docs: Escaped single backslashSteve Holme
M docs/curl.1
M docs/libcurl/opts/CURLOPT_USERNAME.3
M docs/libcurl/opts/CURLOPT_USERPWD.3
TODO: Updated following GSSAPI (Kerberos V5) additionsSteve Holme

Updated "FTP 4.6 GSSAPI via Windows SSPI" and "SASL 14.1 Other authentication mechanisms" following recent additions.

Added SASL 14.2 GSSAPI via GSS-API libraries.

M docs/TODO
CURLOPT_USERNAME.3: Added Kerberos V5 and NTLM domain informationSteve Holme

This repeats what has already been documented in both the curl manpage and CURLOPT_USERPWD documentation but is provided here for completeness as someone may not especially read the latter when using libcurl.

M docs/libcurl/opts/CURLOPT_USERNAME.3
CURLOPT_USERPWD.3: Updated following Kerberos V5 SSPI changesSteve Holme

Added information about Kerberos V5 requiring the domain part in the user name.

Mentioned that the user name can be specified in UPN format, and not just in Down-Level Logon Name format, following the information added in commit 7679cb3fa8 reworking the exisitng information in the process.

M docs/libcurl/opts/CURLOPT_USERPWD.3
docs: Added Kerberos V5 and NTLM domain information to --userSteve Holme
M docs/curl.1
docs: Added Kerberos V5 to the --user SSPI current credentials usageSteve Holme
M docs/curl.1
sasl_sspi: Tell the server we don't support a GSSAPI receive bufferSteve Holme
M lib/curl_sasl_sspi.c
smtp: Added support for GSSAPI (Kerberos V5) authentication via Windows SSPISteve Holme
M lib/smtp.c
pop3: Added support for GSSAPI (Kerberos V5) authentication via Windows SSPISteve Holme
M lib/pop3.c
imap: Added support for GSSAPI (Kerberos V5) authentication via Windows SSPISteve Holme
M lib/imap.c
email: Added mutual authentication flagSteve Holme
M lib/imap.h
M lib/pop3.h
M lib/smtp.h
RELEASE-NOTES: synced with 0187c9e11d079Daniel Stenberg
M RELEASE-NOTES
http: fix the Content-Range: parserDaniel Stenberg

... to handle "*/[total]". Also, removed the strange hack that made CURLOPT_FAILONERROR on a 416 response after a *RESUME_FROM return CURLE_OK.

Reported-by: Dimitrios Siganos Bug: http://curl.haxx.se/mail/lib-2014-06/0221.html

M lib/http.c
M tests/data/test194
email: Introduced the GSSAPI statesSteve Holme
M lib/imap.c
M lib/imap.h
M lib/pop3.c
M lib/pop3.h
M lib/smtp.c
M lib/smtp.h
curl_sasl_sspi.c: Fixed more compilation warnings from commit 4b491c675fSteve Holme

warning: unused variable 'resp'

warning: no previous prototype for 'Curl_sasl_gssapi_cleanup'

M lib/curl_sasl_sspi.c
SHA-1: 61c93383b7f6cf79d12ff99e9dced1d1cc2a7064Steve Holme

* curl_sasl_sspi.c: Fixed compilation warning from commit 4b491c675f

warning: declaration of 'result' shadows a previous local

M lib/curl_sasl_sspi.c
curl_sasl.h: Fixed compilation error from commit 4b491c675fSteve Holme

warning: 'struct kerberos5data' declared inside parameter list

Due to missing forward declaration.

M lib/curl_sasl.h
urldata.h: Fixed compilation warnings from commit 3ec253532eSteve Holme

warning: extra tokens at end of #endif directive

M lib/urldata.h
sasl_sspi: Added GSSAPI message functionsSteve Holme
M lib/curl_sasl.c
M lib/curl_sasl.h
M lib/curl_sasl_sspi.c
urldata: Introduced a GSSAPI (Kerberos V5) data structureSteve Holme

Added a kerberos5data structure which is similar in nature to the ntlmdata and negotiatedata structures.

M lib/urldata.h
sspi: Moved KERB_WRAP_NO_ENCRYPT from socks_sspi moduleSteve Holme

In preparation for the upcoming SSPI implementation of GSSAPI authentication, moved the definition of KERB_WRAP_NO_ENCRYPT from socks_sspi.c to curl_sspi.h allowing it to be shared amongst other SSPI based code.

M lib/curl_sspi.h
M lib/socks_sspi.c
mk-ca-bundle.pl: add missing $Daniel Stenberg
M lib/mk-ca-bundle.pl
mk-ca-bundle.pl: switched to using hg.mozilla.orgDaniel Stenberg

... as mxr.mozilla.org is due to be retired.

The new host doesn't support If-Modified-Since nor ETags, meaning that the script will now defer to download and do a post-transfer checksum check to see if a new output is to be generated. The new output format will hold the SHA1 checksum of the source file for that purpose.

We call this version 1.22

Reported-by: Ed Morley Bug: http://curl.haxx.se/bug/view.cgi?id=1409

M lib/mk-ca-bundle.pl
openssl: fix version report for the 0.9.8 branchJose Alf

Fixed libcurl to correctly output the newer versions of OpenSSL 0.9.8, starting from openssl-0.9.8za.

M lib/vtls/openssl.c
create_conn: prune dead connectionsFrank Meier

Bringing back the old functionality that was mistakenly removed when the connection cache was remade. When creating a new connection, all the existing ones are checked and those that are known to be dead get disconnected for real and removed from the connection cache. It helps the cache from holding on to very many stale connections and aids in keeping down the number of system sockets in wait states.

Help-by: Jonatan Vela <jonatan.vela@ergon.ch>

Bug: http://curl.haxx.se/mail/lib-2014-06/0189.html

M lib/conncache.c
M lib/conncache.h
M lib/url.c
docs/SSLCERTS: update the section about NSS databaseKamil Dudka

Bug: http://curl.haxx.se/mail/lib-2014-07/0335.html Reported-by: David Shaw

M docs/SSLCERTS
Curl_poll + Curl_wait_ms: fix timeout return valuePeter Wang

Curl_poll and Curl_wait_ms require the fix applied to Curl_socket_check in commits b61e8b8 and c771968:

When poll or select are interrupted and coincides with the timeout elapsing, the functions return -1 indicating an error instead of 0 for the timeout.

M lib/select.c
config-tpf.h: Fixed up line lengths > 79 charactersSteve Holme
M lib/config-tpf.h
config-symbian.h: Fixed up line lengths > 79 charactersSteve Holme
M lib/config-symbian.h
tool_hugehelp.c.cvs: Added copyrightSteve Holme

Added copyright due to warning from checksrc.pl.

M src/tool_hugehelp.c.cvs
RELEASE-NOTES: Synced with cd6ecf6a89Steve Holme
M RELEASE-NOTES
sasl_sspi: Fixed hard coded buffer for response generationSteve Holme

Given the SSPI package info query indicates a token size of 4096 bytes, updated to use a dynamic buffer for the response message generation rather than a fixed buffer of 1024 bytes.

M lib/curl_sasl_sspi.c
sasl_sspi: Fixed missing free of challenge buffer on SPN failureSteve Holme
M lib/curl_sasl_sspi.c
http_negotiate_sspi: Tidy up to remove the get_gss_name() functionSteve Holme

Due to the reduction of code in commit 3b924b29 of get_gss_name() the function isn't necessary anymore.

M lib/http_negotiate_sspi.c
http_negotiate_sspi: Use a dynamic buffer for SPN generationSteve Holme

Updated to use a dynamic buffer for the SPN generation via the recently introduced Curl_sasl_build_spn() function rather than a fixed buffer of 1024 characters, which should have been more than enough, but by using the new function removes the need for another variable sname to do the wide character conversion in Unicode builds.

M lib/http_negotiate_sspi.c
M lib/urldata.h
sasl: Tidy up to rename SPN variable from URISteve Holme
M lib/curl_sasl.c
sasl: Use a dynamic buffer for SPN generationSteve Holme

Updated Curl_sasl_create_digest_md5_message() to use a dynamic buffer for the SPN generation via the recently introduced Curl_sasl_build_spn() function rather than a fixed buffer of 128 characters.

M lib/curl_sasl.c
sasl_sspi: Fixed SPN not being converted to wchar under Unicode buildsSteve Holme

Curl_sasl_create_digest_md5_message() would simply cast the SPN variable to a TCHAR when calling InitializeSecurityContext(). This meant that, under Unicode builds, it would not be valid wide character string.

Updated to use the recently introduced Curl_sasl_build_spn() function which performs the correct conversion for us.

M lib/curl_sasl_sspi.c
sasl: Introduced Curl_sasl_build_spn() for building a SPNSteve Holme

Various parts of the libcurl source code build a SPN for inclusion in authentication data. This information is either used by our own native generation routines or passed to authentication functions in third-party libraries such as SSPI. However, some of these instances use fixed buffers rather than dynamically allocated ones and not all of those that should, convert to wide character strings in Unicode builds.

Implemented a common function that generates a SPN and performs the wide character conversion where necessary.

M lib/curl_sasl.c
M lib/curl_sasl.h
M lib/curl_sasl_sspi.c
sasl_sspi: Fixed memory leak with not releasing Package Info structSteve Holme

Curl_sasl_create_digest_md5_message() wouldn't free the Package Info structure after QuerySecurityPackageInfo() had allocated it.

M lib/curl_sasl_sspi.c
docs: Update SPNEGO and GSS-API related doc sectionsMichael Osipov

Reflect recent changes in SPNEGO and GSS-API code in the docs. Update them with appropriate namings and remove visible spots for GSS-Negotiate.

M docs/FAQ
M docs/FEATURES
M docs/KNOWN_BUGS
M docs/MANUAL
M docs/curl.1
M docs/libcurl/curl_version_info.3
M docs/libcurl/libcurl-tutorial.3
M docs/libcurl/opts/CURLOPT_HTTPAUTH.3
M docs/libcurl/symbols-in-versions
sspi: Minor code tidy up to standardise coding styleSteve Holme

Following the recent changes and in attempt to align the SSPI based authentication code performed the following:

* Use NULL and SECBUFFVERSION rather than hard coded constants. * Avoid comparison of zero in if statements. * Standardised the buf and desc setup code.

M lib/curl_ntlm_msgs.c
M lib/http_negotiate_sspi.c
schannel: Fixed compilation warning in vtls.cSteve Holme

vtls.c:688:43: warning: unused parameter 'data'

M lib/vtls/curl_schannel.h
tool_getparam.c: Fixed compilation warningSteve Holme

warning: `orig_opt' might be used uninitialized in this function

M src/tool_getparam.c
RELEASE-NOTES: Synced with 159c3aafd8Steve Holme
M RELEASE-NOTES
curl_ntlm_msgs: make < 80 columns wideDaniel Stenberg
M lib/curl_ntlm_msgs.c
ntlm: Fixed hard coded buffer for SSPI based auth packet generationSteve Holme

Given the SSPI package info query indicates a token size of 2888 bytes, and as with the Winbind code and commit 9008f3d56, use a dynamic buffer for the Type-1 and Type-3 message generation rather than a fixed buffer of 1024 bytes.

M lib/curl_ntlm_msgs.c
M lib/urldata.h
ntlm: Added support for SSPI package info querySteve Holme

Just as with the SSPI implementations of Digest and Negotiate added a package info query so that libcurl can a) return a more appropriate error code when the NTLM package is not supported and b) it can be of use later to allocate a dynamic buffer for the Type-1 and Type-3 output tokens rather than use a fixed buffer of 1024 bytes.

M lib/curl_ntlm_msgs.c
http2: added some more logging for debugging stream problemsDaniel Stenberg
M lib/http2.c
HTTP/2: Reset promised stream, not its associated stream.Tatsuhiro Tsujikawa
M lib/http2.c
HTTP/2: Move :authority before non-pseudo header fieldsTatsuhiro Tsujikawa
M lib/http2.c
http2: show the received header for better debuggingDaniel Stenberg
M lib/http2.c
openssl: replace call to OPENSSL_configDaniel Stenberg

OPENSSL_config() is "strongly recommended" to use but unfortunately that function makes an exit() call on wrongly formatted config files which makes it hard to use in some situations. OPENSSL_config() itself calls CONF_modules_load_file() and we use that instead and we ignore its return code!

Reported-by: Jan Ehrhardt Bug: http://curl.haxx.se/bug/view.cgi?id=1401

M lib/vtls/openssl.c
runtests.pl: Pad test case numbers with up to three zeroesFabian Keil

Test case numbers with four digits have been available for a while now.

M tests/runtests.pl
docs: Added Negotiate to the SSPI current credentials usage descriptionSteve Holme
M docs/curl.1
TODO: HTTP Digest via Windows SSPISteve Holme
M docs/TODO
TODO: FTP GSSAPI via Windows SSPISteve Holme
M docs/TODO
http_negotiate_sspi: Fixed specific username and password not workingSteve Holme

Bug: http://curl.haxx.se/mail/lib-2014-06/0224.html Reported-by: Leonardo Rosati

M lib/http_negotiate_sspi.c
M lib/urldata.h
http_negotiate_sspi: Fixed endless unauthorized loop in commit 6bc76194e8Steve Holme

If the server rejects our authentication attempt and curl hasn't called CompleteAuthToken() then the status variable will be SEC_I_CONTINUE_NEEDED and not SEC_E_OK.

As such the existing detection mechanism for determining whether or not the authentication process has finished is not sufficient.

However, the WWW-Authenticate: Negotiate header line will not contain any data when the server has exhausted the negotiation, so we can use that coupled with the already allocated context pointer.

M lib/http_negotiate_sspi.c
RELEASE-NOTES: synced with 5b37db44a3ebDaniel Stenberg
M RELEASE-NOTES
parsedate.c: fix the return code for an overflow edge conditionDan Fandrich
M lib/parsedate.c
darwinssl: don't use strtok()Toby Peterson

The GetDarwinVersionNumber() function uses strtok, which is not thread-safe.

M lib/vtls/curl_darwinssl.c
Curl_ossl_version: adapted to detect BoringSSLDaniel Stenberg

This seems to be the way it should work. Right now we can't build with BoringSSL and try this out properly due to a minor API breakage.

M lib/vtls/openssl.c
Curl_ossl_version: detect and show libresslDaniel Stenberg

LibreSSL is otherwise OpenSSL API compliant (so far)

M lib/vtls/openssl.c
HTTP/2: Fix infinite loop in readwrite_data()Tatsuhiro Tsujikawa

To prevent infinite loop in readwrite_data() function when stream is reset before any response body comes, reset closed flag to false once it is evaluated to true.

M lib/http2.c
gtls: only define Curl_gtls_seed if Nettle is not being usedDan Fandrich
M lib/vtls/gtls.c
ssl: provide Curl_ssl_backend even if no SSL library is availableDan Fandrich
M lib/vtls/vtls.c
M lib/vtls/vtls.h
HTTP2: Support expect: 100-continueTatsuhiro Tsujikawa

"Expect: 100-continue", which was once deprecated in HTTP/2, is now resurrected in HTTP/2 draft 14. This change adds its support to HTTP/2 code. This change also includes stricter header field checking.

M lib/http.c
M lib/http.h
M lib/http2.c
CURLOPT_SSL_VERIFYPEER.3. add a warning about disabling itDaniel Stenberg
M docs/libcurl/opts/CURLOPT_SSL_VERIFYPEER.3
FEATURES: minor updateDaniel Stenberg
M docs/FEATURES
openssl: make ossl_send return CURLE_OK betterDaniel Stenberg

Previously it only returned a CURLcode for errors, which is when it returns a different size than what was passed in to it.

The http2 code only checked the curlcode and thus failed.

M lib/vtls/openssl.c
RELEASE-NOTES: synced with 7bb4c8cadb5d0Daniel Stenberg
M RELEASE-NOTES
CURLOPT_HEADEROPT.3: typo: do -> toMichael Wallner
M docs/libcurl/opts/CURLOPT_HEADEROPT.3
schannel: use CryptGenRandom for random numbersMarcel Raad

This function is available for every Windows version since Windows 95/NT.

reference: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379942.aspx

M lib/vtls/curl_schannel.c
M lib/vtls/curl_schannel.h
curl_version_info.3: 'ssl_version_num' is always 0Daniel Stenberg

... and has been so since 2005

M docs/libcurl/curl_version_info.3
ssl: generalize how the ssl backend identifier is setDaniel Stenberg

Each backend now defines CURL_SSL_BACKEND accordingly. Added the *AXTLS one which was missing previously.

M docs/libcurl/symbols-in-versions
M include/curl/curl.h
M lib/getinfo.c
M lib/vtls/axtls.h
M lib/vtls/curl_darwinssl.h
M lib/vtls/curl_schannel.h
M lib/vtls/cyassl.h
M lib/vtls/gskit.h
M lib/vtls/gtls.h
M lib/vtls/nssg.h
M lib/vtls/openssl.h
M lib/vtls/polarssl.h
M lib/vtls/qssl.h
M lib/vtls/vtls.c
M lib/vtls/vtls.h
axtls: define curlssl_random using axTLS's PRNGDan Fandrich
M lib/vtls/axtls.c
M lib/vtls/axtls.h
cyassl: fix the test for ASN_NO_SIGNER_EDan Fandrich

It's an enum so a macro test won't work. The CyaSSL changelog doesn't say exactly when this error code was introduced, but it's likely to be 2.7.0.

M lib/vtls/cyassl.c
cyassl: use RNG_GenerateBlock to generate a good random numberDan Fandrich
M lib/vtls/cyassl.c
M lib/vtls/cyassl.h
opts: fixed some typosDan Fandrich
M docs/libcurl/opts/CURLOPT_FTPSSLAUTH.3
M docs/libcurl/opts/CURLOPT_IOCTLFUNCTION.3
M docs/libcurl/opts/CURLOPT_NOBODY.3
M docs/libcurl/opts/CURLOPT_PUT.3
M docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.3
M docs/libcurl/opts/CURLOPT_SSH_KEYDATA.3
M docs/libcurl/opts/CURLOPT_URL.3
smtp: fixed a segfault during test 1320 torture testDan Fandrich

Under these circumstances, the connection hasn't been fully established and smtp_connect hasn't been called, yet smtp_done still calls the state machine which dereferences the NULL conn pointer in struct pingpong.

M lib/smtp.c
vtls: repair build without TLS supportDaniel Stenberg

... by defining Curl_ssl_random() properly

M lib/vtls/vtls.h
polarssl: provide a (weak) random functionDaniel Stenberg

This now provides a weak random function since PolarSSL doesn't have a quick and easy way to provide a good one. It does however provide the framework to make one so it _can_ and _should_ be done...

M lib/vtls/polarssl.h
curl_tlsinfo -> curl_tlssessioninfoMichael Wallner
M docs/libcurl/curl_easy_getinfo.3
cyassl: use the default (weeker) randomDaniel Stenberg

I couldn't find any dedicated function in its API to get a "good" random with.

M lib/vtls/cyassl.h
cyassl: made it compile with version 2.0.6 againDaniel Stenberg

ASN_NO_SIGNER_E didn't exist back then!

M lib/vtls/cyassl.c
vtls: make the random function mandatory in the TLS backendDaniel Stenberg

To force each backend implementation to really attempt to provide proper random. If a proper random function is missing, then we can explicitly make use of the default one we use when TLS support is missing.

This commit makes sure it works for darwinssl, gnutls, nss and openssl.

M lib/vtls/curl_darwinssl.c
M lib/vtls/curl_darwinssl.h
M lib/vtls/gtls.c
M lib/vtls/gtls.h
M lib/vtls/nss.c
M lib/vtls/nssg.h
M lib/vtls/openssl.c
M lib/vtls/openssl.h
M lib/vtls/vtls.c
M lib/vtls/vtls.h
libcurl.m4: include the standard source headerDaniel Stenberg

... with permission from David Shaw

M docs/libcurl/libcurl.m4
nss: do not check the version of NSS at run timeKamil Dudka

The minimal required version of NSS is 3.14.x so it does not make sense to check for NSS 3.12.0+ at run time.

M lib/vtls/nss.c
curl.h: bring back CURLE_OBSOLETE16Anthon Pang

Removing defines, even obsolete ones that haven't been used for a very long time, still break a lot of applications.

Bug: https://github.com/bagder/curl/pull/106

M include/curl/curl.h
tests: Fix a couple of incomplete response linesFabian Keil
M tests/data/test1041
M tests/data/test1511
M tests/data/test33
runtests.pl: Remove filteroff() which hasn't been used since 2001Fabian Keil
M tests/runtests.pl