summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* http_proxy: multiple CONNECT with hyper done betterDaniel Stenberg2021-10-211-1/+0
| | | | | | Enabled test 206 Closes #7888
* test1185: verify checksrcDaniel Stenberg2021-10-182-1/+185
| | | | Closes #7866
* checksrc: ignore preprocessor linesDaniel Stenberg2021-10-172-4/+1
| | | | | | | | | | | | | | | | In order to check the actual code better, checksrc now ignores everything that look like preprocessor instructions. It also means that code in macros are now longer checked. Note that some rules then still don't need to be followed when code is exactly below a cpp instruction. Removes two checksrc exceptions we needed previously because of preprocessor lines being checked. Reported-by: Marcel Raad Fixes #7863 Closes #7864
* urlapi: skip a strlen(), pass in zeroDaniel Stenberg2021-10-151-1/+1
| | | | | | | | | ... to let curl_easy_escape() itself do the strlen. This avoids a (false positive) Coverity warning and it avoids us having to store the strlen() return value in an int variable. Reviewed-by: Daniel Gustafsson Closes #7862
* misc: update copyright yearsDaniel Stenberg2021-10-152-2/+2
|
* aws-sigv4: make signature work when post data is binaryAbhinav Singh2021-10-156-2/+212
| | | | | | | | | User sets the post fields size for binary data. Hence, we should not be using strlen on it. Added test 1937 and 1938 to verify. Closes #7844
* sws: fix memory leak on exitJay Satiro2021-10-141-5/+7
| | | | | | | | | - Free the allocated http request struct on cleanup. Prior to this change if sws was built with leak sanitizer it would report a memory leak error during testing. Closes https://github.com/curl/curl/pull/7849
* curl: correct grammar in generated libcurl codeБорис Верховский2021-10-1310-9/+9
| | | | Closes #7802
* tests: disable test 2043Daniel Stenberg2021-10-131-0/+1
| | | | | | | | It uses revoked.badssl.com which now is expired and therefor this now permafails. We should not use external sites for tests, this test should be converted to use our own infra. Closes #7845
* runtests: split out ignored testsDaniel Stenberg2021-10-121-3/+7
| | | | | | | | | | | Report ignore tests separately from the actual fails. Don't exit non-zero if test servers couldn't get killed. Assisted-by: Jay Satiro Fixes #7818 Closes #7841
* test368: verify dash is appended for "-r [num]"Daniel Stenberg2021-10-112-1/+50
| | | | Follow-up to 8758a26f8878
* urlapi: URL decode percent-encoded host namesDaniel Stenberg2021-10-111-19/+44
| | | | | | | | | | | | | | | | | | | | | | The host name is stored decoded and can be encoded when used to extract the full URL. By default when extracting the URL, the host name will not be URL encoded to work as similar as possible as before. When not URL encoding the host name, the '%' character will however still be encoded. Getting the URL with the CURLU_URLENCODE flag set will percent encode the host name part. As a bonus, setting the host name part with curl_url_set() no longer accepts a name that contains space, CR or LF. Test 1560 has been extended to verify percent encodings. Reported-by: Noam Moshe Reported-by: Sharon Brizinov Reported-by: Raul Onitza-Klugman Reported-by: Kirill Efimov Fixes #7830 Closes #7834
* CI/makefiles: introduce dedicated test targetMarc Hoersken2021-10-082-0/+7
| | | | | | | | | | Make it easy to use the same set of test flags throughout all current and future CI builds. Reviewed-by: Jay Satiro Follow up to #7690 Closes #7785
* http: fix Basic auth with empty name field in URLDaniel Stenberg2021-10-062-1/+49
| | | | | | | | Add test 367 to verify. Reported-by: Rick Lane Fixes #7819 Closes #7820
* CURLOPT_MAXLIFETIME_CONN: maximum allowed lifetime for conn reuseJeffrey Tolar2021-10-064-2/+159
| | | | | | | | | ... and close connections that are too old instead of reusing them. By default, this behavior is disabled. Bug: https://curl.se/mail/lib-2021-09/0058.html Closes #7751
* print_category: print help descriptions alignedDaniel Stenberg2021-10-013-18/+18
| | | | | | | | Adjust the description position to make an aligned column when doing help listings, which is more pleasing to the eye. Suggested-by: Gisle Vanem Closes #7792
* tool_listhelp: easier to generate with gen.plDaniel Stenberg2021-09-303-8/+8
| | | | | | | | | | | | | | | tool_listhelp.c is now a separate file with only the command line --help output, exactly as generated by gen.pl. This makes it easier to generate updates according to what's in the docs/cmdline-opts docs. cd $srcroot/docs/cmdline-opts ./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c With a configure build, this also works: make -C src listhelp Closes #7787
* scripts/copyright: .muse is .lift nowDaniel Stenberg2021-09-285-5/+5
| | | | And update 5 files with old copyright year range
* CURLOPT_PREREQFUNCTION: add new callbackMax Dymond2021-09-2711-3/+375
| | | | | | | | | | | | | | Triggered before a request is made but after a connection is set up Changes: - callback: Update docs and callback for pre-request callback - Add documentation for CURLOPT_PREREQDATA and CURLOPT_PREREQFUNCTION, - Add redirect test and callback failure test - Note that the function may be called multiple times on a redirection - Disable new 2086 test due to Windows weirdness Closes #7477
* urlapi: support UNC paths in file: URLs on WindowsSergey Markelov2021-09-272-0/+4
| | | | | | | | | | - file://host.name/path/file.txt is a valid UNC path \\host.name\path\files.txt to a non-local file transformed into URI (RFC 8089 Appendix E.3) - UNC paths on other OSs must be smb: URLs Closes #7366
* urlapi: add curl_url_strerror()i-ky2021-09-277-49/+76
| | | | | | | | | | Add curl_url_strerror() to convert CURLUcode into readable string and facilitate easier troubleshooting in programs using URL API. Extend CURLUcode with CURLU_LAST for iteration in unit tests. Update man pages with a mention of new function. Update example code and tests with new functionality where it fits. Closes #7605
* libssh2: add SHA256 fingerprint supportMats Lindestam2021-09-268-4/+122
| | | | | | | Added support for SHA256 fingerprint in command line curl and in libcurl. Closes #7646
* cleanup: constify unmodified static structsRikard Falkeborn2021-09-236-16/+16
| | | | | | | Constify a number of static structs that are never modified. Make them const to show this. Closes #7759
* test897: verify delivery of IMAP post-body header contentDaniel Stenberg2021-09-213-2/+79
| | | | | | | | | | | | | The "content" is delivered as "body" by curl, but the envelope continues after the body and the rest of it should be delivered as header. The IMAP server can now get 'POSTFETCH' set to include more data to include after the body and test 897 is done to verify that such "extra" header data is in fact delivered by curl as header. Ref: #7284 but fails to reproduce the issue Closes #7748
* http: fix the broken >3 digit response code detectionDaniel Stenberg2021-09-172-1/+46
| | | | | | | | | | | | | When the "reason phrase" in the HTTP status line starts with a digit, that was treated as the forth response code digit and curl would claim the response to be non-compliant. Added test 1466 to verify this case. Regression brought by 5dc594e44f73b17 Reported-by: Glenn de boer Fixes #7738 Closes #7739
* hsts: CURLSTS_FAIL from hsts read callback should fail transferDaniel Stenberg2021-09-162-2/+28
| | | | | | | | | | ... and have CURLE_ABORTED_BY_CALLBACK returned. Extended test 1915 to verify. Reported-by: Jonathan Cardoso Fixes #7726 Closes #7729
* test1184: disableDaniel Stenberg2021-09-161-0/+2
| | | | | | | | | The test should be fine and it works for me repeated when run manually, but clearly it causes CI failures and it needs more research. Reported-by: RiderALT on github Fixes #7725 Closes #7732
* tests/sshserver.pl: make it work with openssh-8.7p1Kamil Dudka2021-09-161-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by not using options with no argument where an argument is required: === Start of file tests/log/ssh_server.log curl_sshd_config line 6: no argument after keyword "DenyGroups" curl_sshd_config line 7: no argument after keyword "AllowGroups" curl_sshd_config line 10: Deprecated option AuthorizedKeysFile2 curl_sshd_config line 29: Deprecated option KeyRegenerationInterval curl_sshd_config line 39: Deprecated option RhostsRSAAuthentication curl_sshd_config line 40: Deprecated option RSAAuthentication curl_sshd_config line 41: Deprecated option ServerKeyBits curl_sshd_config line 45: Deprecated option UseLogin curl_sshd_config line 56: no argument after keyword "AcceptEnv" curl_sshd_config: terminating, 3 bad configuration options === End of file tests/log/ssh_server.log === Start of file log/sftp_server.log curl_sftp_config line 33: Unsupported option "rhostsrsaauthentication" curl_sftp_config line 34: Unsupported option "rsaauthentication" curl_sftp_config line 52: no argument after keyword "sendenv" curl_sftp_config: terminating, 1 bad configuration options Connection closed. Connection closed === End of file log/sftp_server.log Closes #7724
* hsts: handle unlimited expiryDaniel Stenberg2021-09-153-13/+22
| | | | | | | | | | | | | | | | | | | When setting a blank expire string, meaning unlimited, curl would pass TIME_T_MAX to getime_r() when creating the output, while on 64 bit systems such a large value cannot be convetered to a tm struct making curl to exit the loop with an error instead. It can't be converted because the year it would represent doesn't fit in the 'int tm_year' field! Starting now, unlimited expiry is instead handled differently by using a human readable expiry date spelled out as "unlimited" instead of trying to use a distant actual date. Test 1660 and 1915 have been updated to help verify this change. Reported-by: Jonathan Cardoso Fixes #7720 Closes #7721
* ftp,imap,pop3,smtp: reject STARTTLS server response pipeliningPatrick Monnerat2021-09-135-1/+221
| | | | | | | | | | | | | If a server pipelines future responses within the STARTTLS response, the former are preserved in the pingpong cache across TLS negotiation and used as responses to the encrypted commands. This fix detects pipelined STARTTLS responses and rejects them with an error. CVE-2021-22947 Bug: https://curl.se/docs/CVE-2021-22947.html
* ftp,imap,pop3: do not ignore --ssl-reqdPatrick Monnerat2021-09-134-0/+165
| | | | | | | | | | | | In imap and pop3, check if TLS is required even when capabilities request has failed. In ftp, ignore preauthentication (230 status of server greeting) if TLS is required. Bug: https://curl.se/docs/CVE-2021-22946.html CVE-2021-22946
* http_proxy: fix the User-Agent inclusion in CONNECTDaniel Stenberg2021-09-132-1/+109
| | | | | | | | | | | | It should not refer to the uagent string that is allocated and created for the end server http request, as that pointer may be cleared on subsequent CONNECT requests. Added test case 1184 to verify. Reported-by: T200proX7 on github Fixes #7705 Closes #7707
* runtests: add option -u to error on server unexpectedly aliveMarc Hoersken2021-09-092-26/+98
| | | | | | | | | | | | | | | Let's try to actually handle the server unexpectedly alive case by first making them visible on CI builds as failures. This is needed to detect issues with killing of the test servers completely including nested process chains with multiple PIDs per test server (including bash and perl). On Windows/cygwin platforms this is especially helpful with debugging PID mixups due to cygwin using its own PID space. Reviewed-by: Daniel Stenberg Closes #7180
* copyrights: update copyright year rangesDaniel Stenberg2021-09-086-6/+6
|
* curl: stop retry if Retry-After: is longer than allowedDaniel Stenberg2021-09-062-1/+50
| | | | | | | | | | | If Retry-After: specifies a period that is longer than what fits within --retry-max-time, then stop retrying immediately. Added test 366 to verify. Reported-by: Kari Pahula Fixes #7675 Closes #7676
* test1173: check references to libcurl optionsDaniel Stenberg2021-09-042-17/+65
| | | | | | | ... that they refer to actual existing libcurl options. Reviewed-by: Daniel Gustafsson Closes #7656
* opt-docs: verify man page sections + orderDaniel Stenberg2021-09-041-5/+68
| | | | | | | | | | | | | | | | | | | | In every libcurl option man page there are now 8 mandatory sections that must use the right name in the correct order and test 1173 verifies this. Only 14 man pages needed adjustments. The sections and the order is as follows: - NAME - SYNOPSIS - DESCRIPTION - PROTOCOLS - EXAMPLE - AVAILABILITY - RETURN VALUE - SEE ALSO Reviewed-by: Daniel Gustafsson Closes #7656
* opt-docs: make sure all man pages have examplesDaniel Stenberg2021-09-041-0/+22
| | | | | | | | | Extended manpage-syntax.pl (run by test 1173) to check that every man page for a libcurl option has an EXAMPLE section that is more than two lines. Then fixed all errors it found and added examples. Reviewed-by: Daniel Gustafsson Closes #7656
* connect: get local port + ip also when reusing connectionsDaniel Stenberg2021-09-022-1/+72
| | | | | | | | | | | | Regression. In d6a37c23a3c (7.75.0) we removed the duplicated storage (connection + easy handle), so this info needs be extracted again even for re-used connections. Add test 435 to verify Reported-by: Max Dymond Fixes #7660 Closes #7662
* tests: adjust the tftpd output to work with hyper modeDaniel Stenberg2021-09-0120-126/+123
| | | | | | | | | | By making them look less like http headers, the hyper mode "tweak" doesn't interfere. Enable test 2002 and 2003 in hyper builds (and 1280 which is unrelated but should be enabled). Closes #7658
* test365: verify response with chunked AND Content-Length headersDaniel Stenberg2021-08-312-1/+66
|
* http: ignore content-length if any transfer-encoding is usedDaniel Stenberg2021-08-317-57/+49
| | | | | Fixes #7643 Closes #7649
* http: disallow >3-digit response codesDaniel Stenberg2021-08-263-27/+28
| | | | | | | | | | Make the built-in HTTP parser behave similar to hyper and reject any HTTP response using more than 3 digits for the response code. Updated test 1432 accordingly. Enabled test 1432 in the hyper builds. Closes #7641
* test1280: CRLFify the response to please hyperDaniel Stenberg2021-08-261-5/+5
| | | | Closes #7639
* tests: enable test 1129 for hyper buildsDaniel Stenberg2021-08-261-1/+0
| | | | Closes #7638
* c-hyper: handle HTTP/1.1 => HTTP/1.0 downgrade on reused connectionDaniel Stenberg2021-08-231-1/+0
| | | | | | Enable test 1074 Closes #7617
* c-hyper: deal with Expect: 100-continue combined with POSTFIELDSDaniel Stenberg2021-08-231-2/+0
| | | | | | Enable test 1130 and 1131 Closes #7616
* tests: be explicit about using 'python3' instead of 'python'a13460542021-08-234-4/+4
| | | | | | | This fixes running tests in virtualenvs (or on distros) that no longer have a symlink from python to python2 or python3. Closes #7602
* DISABLED: enable 11 more tests for hyper buildsDaniel Stenberg2021-08-231-11/+0
| | | | Closes #7612
* setopt: enable CURLOPT_IGNORE_CONTENT_LENGTH for hyperDaniel Stenberg2021-08-231-1/+0
| | | | | | | | | | | Since this option is also used for FTP, it needs to work to set for applications even if hyper doesn't support it for HTTP. Verified by test 1137. Updated docs to specify that the option doesn't work for HTTP when using the hyper backend. Closes #7614