mirror of
https://github.com/curl/curl.git
synced 2026-07-26 02:57:15 +03:00
badwords: rework exceptions, fix many of them
Also: - support per-directory and per-upper-directory whitelist entries. - convert badlist input grep tweak into the above format. (except for 'And' which had just a few hits.) - fix many code exceptions, but do not enforce. (there also remain about 350 'will' uses in lib) - fix badwords in example code, drop exceptions. - badwords-all: convert to Perl. To make it usable from CMake. - FAQ: reword to not use 'will'. Drop exception. Closes #20886
This commit is contained in:
parent
11c14b5ca5
commit
435eabeac8
89 changed files with 367 additions and 344 deletions
|
|
@ -30,9 +30,8 @@ VERSIONDEL=8
|
|||
|
||||
# libtool version:
|
||||
VERSIONINFO=-version-info $(VERSIONCHANGE):$(VERSIONADD):$(VERSIONDEL)
|
||||
# This flag accepts an argument of the form current[:revision[:age]]. So,
|
||||
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
|
||||
# 1.
|
||||
# This flag accepts an argument of the form current[:revision[:age]]. It means
|
||||
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1.
|
||||
#
|
||||
# Here's the simplified rule guide on how to change -version-info:
|
||||
# (current version is C:R:A)
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
#ifdef CURLRES_ARES
|
||||
|
||||
/***********************************************************************
|
||||
* Only for ares-enabled builds
|
||||
* And only for functions that fulfill the asynch resolver backend API
|
||||
* as defined in asyn.h, nothing else belongs in this file!
|
||||
* Only for ares-enabled builds and only for functions that fulfill
|
||||
* the asynch resolver backend API as defined in asyn.h,
|
||||
* nothing else belongs in this file!
|
||||
**********************************************************************/
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
|
|
@ -549,16 +549,16 @@ static void async_ares_hostbyname_cb(void *user_data,
|
|||
|
||||
it is also possible that the other request could always take longer
|
||||
because it needs more time or only the second DNS server can fulfill it
|
||||
successfully. But, to align with the philosophy of Happy Eyeballs, we
|
||||
successfully. Yet, to align with the philosophy of Happy Eyeballs, we
|
||||
do not want to wait _too_ long or users will think requests are slow
|
||||
when IPv6 lookups do not actually work (but IPv4 ones do).
|
||||
|
||||
So, now that we have a usable answer (some IPv4 addresses, some IPv6
|
||||
Now that we have a usable answer (some IPv4 addresses, some IPv6
|
||||
addresses, or "no such domain"), we start a timeout for the remaining
|
||||
pending responses. Even though it is typical that this resolved
|
||||
request came back quickly, that need not be the case. It might be that
|
||||
this completing request did not get a result from the first DNS
|
||||
server or even the first round of the whole DNS server pool. So it
|
||||
server or even the first round of the whole DNS server pool. This
|
||||
could already be a long time after we issued the DNS queries in
|
||||
the first place. Without modifying c-ares, we cannot know exactly
|
||||
where in its retry cycle we are. We could guess based on how much
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ void Curl_bufq_initp(struct bufq *q, struct bufc_pool *pool,
|
|||
size_t max_chunks, int opts);
|
||||
|
||||
/**
|
||||
* Reset the buffer queue to be empty. Will keep any allocated buffer
|
||||
* chunks around.
|
||||
* Reset the buffer queue to be empty. Keep any allocated buffer chunks
|
||||
* around.
|
||||
*/
|
||||
void Curl_bufq_reset(struct bufq *q);
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ CURLcode Curl_bufq_sipn(struct bufq *q, size_t max_len,
|
|||
|
||||
/**
|
||||
* Write buf to the end of the buffer queue.
|
||||
* Will write bufq content or passed `buf` directly using the `writer`
|
||||
* Write bufq content or passed `buf` directly using the `writer`
|
||||
* callback when it sees fit. 'buf' might get passed directly
|
||||
* on or is placed into the buffer, depending on `len` and current
|
||||
* amount buffered, chunk size, etc.
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf,
|
|||
proxy */
|
||||
/* If a proxy-authorization header was used for the proxy, then we should
|
||||
make sure that it is not accidentally used for the document request
|
||||
after we have connected. So let's free and clear it here. */
|
||||
after we have connected. Let's thus free and clear it here. */
|
||||
Curl_safefree(data->state.aptr.proxyuserpwd);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ static void h2_tunnel_go_state(struct Curl_cfilter *cf,
|
|||
ts->state = new_state;
|
||||
/* If a proxy-authorization header was used for the proxy, then we should
|
||||
make sure that it is not accidentally used for the document request
|
||||
after we have connected. So let's free and clear it here. */
|
||||
after we have connected. Let's thus free and clear it here. */
|
||||
Curl_safefree(data->state.aptr.proxyuserpwd);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -688,8 +688,8 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
|
|||
if(scope_ptr) {
|
||||
/* The "myhost" string either comes from Curl_if2ip or from
|
||||
Curl_printable_address. The latter returns only numeric scope
|
||||
IDs and the former returns none at all. So the scope ID, if
|
||||
present, is known to be numeric */
|
||||
IDs and the former returns none at all. Making the scope ID,
|
||||
if present, known to be numeric */
|
||||
curl_off_t scope_id;
|
||||
if(curlx_str_number((const char **)CURL_UNCONST(&scope_ptr),
|
||||
&scope_id, UINT_MAX))
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ void Curl_conn_close(struct Curl_easy *data, int sockindex);
|
|||
/**
|
||||
* Shutdown the connection at `sockindex` non-blocking, using timeout
|
||||
* from `data->set.shutdowntimeout`, default DEFAULT_SHUTDOWN_TIMEOUT_MS.
|
||||
* Will return CURLE_OK and *done == FALSE if not finished.
|
||||
* Return CURLE_OK and *done == FALSE if not finished.
|
||||
*/
|
||||
CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done);
|
||||
|
||||
|
|
@ -604,14 +604,14 @@ int Curl_conn_sockindex(struct Curl_easy *data, curl_socket_t sockfd);
|
|||
|
||||
/*
|
||||
* Receive data on the connection, using FIRSTSOCKET/SECONDARYSOCKET.
|
||||
* Will return CURLE_AGAIN iff blocked on receiving.
|
||||
* Return CURLE_AGAIN iff blocked on receiving.
|
||||
*/
|
||||
CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex,
|
||||
char *buf, size_t len, size_t *pnread);
|
||||
|
||||
/*
|
||||
* Send data on the connection, using FIRSTSOCKET/SECONDARYSOCKET.
|
||||
* Will return CURLE_AGAIN iff blocked on sending.
|
||||
* Return CURLE_AGAIN iff blocked on sending.
|
||||
*/
|
||||
CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex,
|
||||
const void *buf, size_t len, bool eos,
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ CURLcode Curl_cpool_add(struct Curl_easy *data,
|
|||
|
||||
/**
|
||||
* Return if the pool has reached its configured limits for adding
|
||||
* the given connection. Will try to discard the oldest, idle
|
||||
* connections to make space.
|
||||
* the given connection. Try to discard the oldest, idle connections
|
||||
* to make space.
|
||||
*/
|
||||
#define CPOOL_LIMIT_OK 0
|
||||
#define CPOOL_LIMIT_DEST 1
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ static bool bad_domain(const char *domain, size_t len)
|
|||
|
||||
cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
||||
|
||||
But Firefox and Chrome as of June 2022 accept space, comma and double-quotes
|
||||
Yet, Firefox and Chrome as of June 2022 accept space, comma and double-quotes
|
||||
fine. The prime reason for filtering out control bytes is that some HTTP
|
||||
servers return 400 for requests that contain such.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ struct Curl_share;
|
|||
struct Curl_sigpipe_ctx;
|
||||
|
||||
/* Run the shutdown of the connection once.
|
||||
* Will shortly attach/detach `data` to `conn` while doing so.
|
||||
* Shortly attach/detach `data` to `conn` while doing so.
|
||||
* `done` will be set TRUE if any error was encountered or if
|
||||
* the connection was shut down completely. */
|
||||
void Curl_cshutdn_run_once(struct Curl_easy *data,
|
||||
|
|
@ -78,7 +78,7 @@ size_t Curl_cshutdn_dest_count(struct Curl_easy *data,
|
|||
bool Curl_cshutdn_close_oldest(struct Curl_easy *data,
|
||||
const char *destination);
|
||||
|
||||
/* Add a connection to have it shut down. Will terminate the oldest
|
||||
/* Add a connection to have it shut down. Terminate the oldest
|
||||
* connection when total connection limit of multi is being reached. */
|
||||
void Curl_cshutdn_add(struct cshutdn *cshutdn,
|
||||
struct connectdata *conn,
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
|||
/* There is no way (yet) for the application to configure the
|
||||
* session cache size, shared between many transfers. As for curl
|
||||
* itself, a high session count will impact startup time. Also, the
|
||||
* scache is not optimized for several hundreds of peers. So,
|
||||
* keep it at a reasonable level. */
|
||||
* scache is not optimized for several hundreds of peers.
|
||||
* Keep it at a reasonable level. */
|
||||
if(Curl_ssl_scache_create(25, 2, &share->ssl_scache))
|
||||
res = CURLSHE_NOMEM;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ void curlx_dyn_reset(struct dynbuf *s)
|
|||
|
||||
/*
|
||||
* Specify the size of the tail to keep (number of bytes from the end of the
|
||||
* buffer). The rest will be dropped.
|
||||
* buffer). The rest is dropped.
|
||||
*/
|
||||
CURLcode curlx_dyn_tail(struct dynbuf *s, size_t trail)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ WINBASEAPI DWORD WINAPI GetFullPathNameW(LPCWSTR, DWORD, LPWSTR, LPWSTR *);
|
|||
* longer than MAX_PATH then setting 'out' to "\\?\" prefix + that full path.
|
||||
*
|
||||
* For example 'in' filename255chars in current directory C:\foo\bar is
|
||||
* fixed as \\?\C:\foo\bar\filename255chars for 'out' which will tell Windows
|
||||
* fixed as \\?\C:\foo\bar\filename255chars for 'out' which tells Windows
|
||||
* it is ok to access that filename even though the actual full path is longer
|
||||
* than 260 chars.
|
||||
*
|
||||
|
|
@ -439,7 +439,7 @@ int curlx_win32_stat(const char *path, curlx_struct_stat *buffer)
|
|||
#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_COOKIES) || \
|
||||
!defined(CURL_DISABLE_ALTSVC)
|
||||
/* rename() on Windows does not overwrite, so we cannot use it here.
|
||||
MoveFileEx() will overwrite and is usually atomic but fails when there are
|
||||
MoveFileEx() does overwrite and is usually atomic but fails when there are
|
||||
open handles to the file. */
|
||||
int curlx_win32_rename(const char *oldpath, const char *newpath)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ static int inet_pton6(const char *src, unsigned char *dst)
|
|||
if(colonp) {
|
||||
/*
|
||||
* Since some memmove()'s erroneously fail to handle
|
||||
* overlapping regions, we will do the shift by hand.
|
||||
* overlapping regions, we do the shift by hand.
|
||||
*/
|
||||
const ssize_t n = tp - colonp;
|
||||
ssize_t i;
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@
|
|||
*
|
||||
* Provide the target buffer @dest and size of the target buffer @dsize, If
|
||||
* the source string @src with its *string length* @slen fits in the target
|
||||
* buffer it will be copied there - including storing a null terminator.
|
||||
* buffer it is copied there - including storing a null terminator.
|
||||
*
|
||||
* If the target buffer is too small, the copy is not performed but if the
|
||||
* target buffer has a non-zero size it will get a null terminator stored.
|
||||
* target buffer has a non-zero size it gets a null terminator stored.
|
||||
*/
|
||||
void curlx_strcopy(char *dest, /* destination buffer */
|
||||
size_t dsize, /* size of target buffer */
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
* wait on, being used to delay execution. Winsock select() and poll() timeout
|
||||
* mechanisms need a valid socket descriptor in a not null file descriptor set
|
||||
* to work. Waiting indefinitely with this function is not allowed, a zero or
|
||||
* negative timeout value will return immediately. Timeout resolution,
|
||||
* negative timeout value is returned immediately. Timeout resolution,
|
||||
* accuracy, as well as maximum supported value is system dependent, neither
|
||||
* factor is a critical issue for the intended use of this function in the
|
||||
* library.
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen)
|
|||
return NULL;
|
||||
|
||||
/* We return the local codepage version of the error string because if it is
|
||||
output to the user's terminal it will likely be with functions which
|
||||
output to the user's terminal, it is likely done with functions which
|
||||
expect the local codepage (eg fprintf, failf, infof). */
|
||||
if(!FormatMessageA((FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err,
|
||||
|
|
|
|||
|
|
@ -350,8 +350,8 @@ static CURLcode cw_out_append(struct cw_out_ctx *ctx,
|
|||
}
|
||||
|
||||
/* if we do not have a buffer, or it is of another type, make a new one.
|
||||
* And for CW_OUT_HDS always make a new one, so we "replay" headers
|
||||
* exactly as they came in */
|
||||
* For CW_OUT_HDS always make a new one, so we "replay" headers exactly
|
||||
* as they came in */
|
||||
if(!ctx->buf || (ctx->buf->type != otype) || (otype == CW_OUT_HDS)) {
|
||||
struct cw_out_buf *cwbuf = cw_out_buf_create(otype);
|
||||
if(!cwbuf)
|
||||
|
|
|
|||
|
|
@ -1049,7 +1049,7 @@ UNITTEST void de_cleanup(struct dohentry *d)
|
|||
* https://datatracker.ietf.org/doc/html/rfc1035#section-3.1
|
||||
*
|
||||
* The input buffer pointer will be modified so it points to after the end of
|
||||
* the DNS name encoding on output. (And that is why it is an "unsigned char
|
||||
* the DNS name encoding on output. (that is why it is an "unsigned char
|
||||
* **" :-)
|
||||
*/
|
||||
static CURLcode doh_decode_rdata_name(const unsigned char **buf,
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ CURLcode Curl_dynhds_h1_add_line(struct dynhds *dynhds,
|
|||
|
||||
/**
|
||||
* Add the headers to the given `dynbuf` in HTTP/1.1 format with
|
||||
* cr+lf line endings. Will NOT output a last empty line.
|
||||
* CR+LF line endings. Does NOT output a last empty line.
|
||||
*/
|
||||
CURLcode Curl_dynhds_h1_dprint(struct dynhds *dynhds, struct dynbuf *dbuf);
|
||||
|
||||
|
|
|
|||
|
|
@ -938,7 +938,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
|
|||
static void dupeasy_meta_freeentry(void *p)
|
||||
{
|
||||
(void)p;
|
||||
/* Will always be FALSE. Cannot use a 0 assert here since compilers
|
||||
/* Always FALSE. Cannot use a 0 assert here since compilers
|
||||
* are not in agreement if they then want a NORETURN attribute or
|
||||
* not. *sigh* */
|
||||
DEBUGASSERT(p == NULL);
|
||||
|
|
|
|||
24
lib/ftp.c
24
lib/ftp.c
|
|
@ -209,7 +209,7 @@ static CURLcode ftp_parse_url_path(struct Curl_easy *data,
|
|||
const char *slashPos = NULL;
|
||||
const char *fileName = NULL;
|
||||
CURLcode result = CURLE_OK;
|
||||
const char *rawPath = NULL; /* url-decoded "raw" path */
|
||||
const char *rawPath = NULL; /* URL-decoded "raw" path */
|
||||
size_t pathLen = 0;
|
||||
|
||||
ftpc->ctl_valid = FALSE;
|
||||
|
|
@ -217,7 +217,7 @@ static CURLcode ftp_parse_url_path(struct Curl_easy *data,
|
|||
|
||||
if(ftpc->rawpath)
|
||||
freedirs(ftpc);
|
||||
/* url-decode ftp path before further evaluation */
|
||||
/* URL-decode ftp path before further evaluation */
|
||||
result = Curl_urldecode(ftp->path, 0, &ftpc->rawpath, &pathLen, REJECT_CTRL);
|
||||
if(result) {
|
||||
failf(data, "path contains control characters");
|
||||
|
|
@ -232,8 +232,8 @@ static CURLcode ftp_parse_url_path(struct Curl_easy *data,
|
|||
fileName = rawPath; /* this is a full file path */
|
||||
/*
|
||||
else: ftpc->file is not used anywhere other than for operations on
|
||||
a file. In other words, never for directory operations.
|
||||
So we can safely leave filename as NULL here and use it as a
|
||||
a file. In other words, never for directory operations,
|
||||
so we can safely leave filename as NULL here and use it as a
|
||||
argument in dir/file decisions.
|
||||
*/
|
||||
break;
|
||||
|
|
@ -677,7 +677,7 @@ static CURLcode getftpresponse(struct Curl_easy *data,
|
|||
* A caution here is that the ftp_readresp() function has a cache that may
|
||||
* contain pieces of a response from the previous invoke and we need to
|
||||
* make sure we do not wait for input while there is unhandled data in
|
||||
* that cache. But also, if the cache is there, we call ftp_readresp() and
|
||||
* that cache. Also, if the cache is there, we call ftp_readresp() and
|
||||
* the cache was not good enough to continue we must not busy-loop around
|
||||
* this function.
|
||||
*
|
||||
|
|
@ -1559,7 +1559,7 @@ static CURLcode ftp_state_list(struct Curl_easy *data,
|
|||
char *cmd;
|
||||
|
||||
if((data->set.ftp_filemethod == FTPFILE_NOCWD) && ftp->path) {
|
||||
/* url-decode before evaluation: e.g. paths starting/ending with %2f */
|
||||
/* URL-decode before evaluation: e.g. paths starting/ending with %2f */
|
||||
const char *rawPath = ftpc->rawpath;
|
||||
const char *slashPos = strrchr(rawPath, '/');
|
||||
if(slashPos) {
|
||||
|
|
@ -1688,7 +1688,7 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data,
|
|||
which may not exist in the server! The SIZE command is not in
|
||||
RFC959. */
|
||||
|
||||
/* 2. This used to set REST. But since we can do append, we issue no
|
||||
/* 2. This used to set REST, but since we can do append, we issue no
|
||||
another ftp command. Skip the source file offset and APPEND the rest on
|
||||
the file instead */
|
||||
|
||||
|
|
@ -1942,8 +1942,8 @@ static CURLcode ftp_state_quote(struct Curl_easy *data,
|
|||
behavior.
|
||||
|
||||
In addition: asking for the size for 'TYPE A' transfers is not
|
||||
constructive since servers do not report the converted size. So
|
||||
skip it.
|
||||
constructive since servers do not report the converted size.
|
||||
Thus, skip it.
|
||||
*/
|
||||
result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file);
|
||||
if(!result)
|
||||
|
|
@ -2382,10 +2382,10 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep)
|
|||
else if((data->state.list_only || !ftpc->file) &&
|
||||
!(data->set.prequote)) {
|
||||
/* The specified path ends with a slash, and therefore we think this
|
||||
is a directory that is requested, use LIST. But before that we
|
||||
is a directory that is requested, use LIST. Before that, we also
|
||||
need to set ASCII transfer mode. */
|
||||
|
||||
/* But only if a body transfer was requested. */
|
||||
/* Only if a body transfer was requested. */
|
||||
if(ftp->transfer == PPTRANSFER_BODY) {
|
||||
result = ftp_nb_type(data, ftpc, ftp, TRUE, FTP_LIST_TYPE);
|
||||
if(result)
|
||||
|
|
@ -3709,7 +3709,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
|
|||
if(data->set.ftp_filemethod == FTPFILE_NOCWD)
|
||||
pathLen = 0; /* relative path => working directory is FTP home */
|
||||
else
|
||||
/* file is url-decoded */
|
||||
/* file is URL-decoded */
|
||||
pathLen -= ftpc->file ? strlen(ftpc->file) : 0;
|
||||
ftpc->prevpath = curlx_memdup0(rawPath, pathLen);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ struct Curl_header_store {
|
|||
|
||||
/*
|
||||
* Initialize header collecting for a transfer.
|
||||
* Will add a client writer that catches CLIENTWRITE_HEADER writes.
|
||||
* Add a client writer that catches CLIENTWRITE_HEADER writes.
|
||||
*/
|
||||
CURLcode Curl_headers_init(struct Curl_easy *data);
|
||||
|
||||
|
|
|
|||
12
lib/http.c
12
lib/http.c
|
|
@ -505,8 +505,8 @@ static bool http_should_fail(struct Curl_easy *data, int httpcode)
|
|||
/*
|
||||
** Examine the current authentication state to see if this is an error. The
|
||||
** idea is for this function to get called after processing all the headers
|
||||
** in a response message. So, if we have been to asked to authenticate a
|
||||
** particular stage, and we have done it, we are OK. If we are already
|
||||
** in a response message. If we have been to asked to authenticate
|
||||
** a particular stage, and we have done it, we are OK. If we are already
|
||||
** completely authenticated, it is not OK to get another 401 or 407.
|
||||
**
|
||||
** It is possible for authentication to go stale such that the client needs
|
||||
|
|
@ -1973,7 +1973,7 @@ void Curl_http_method(struct Curl_easy *data,
|
|||
|
||||
static CURLcode http_useragent(struct Curl_easy *data)
|
||||
{
|
||||
/* The User-Agent string might have been allocated in url.c already, because
|
||||
/* The User-Agent string might have been allocated already, because
|
||||
it might have been used in the proxy connect, but if we have got a header
|
||||
with the user-agent string specified, we erase the previously made string
|
||||
here. */
|
||||
|
|
@ -2097,7 +2097,7 @@ static CURLcode http_target(struct Curl_easy *data,
|
|||
if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) {
|
||||
/* Using a proxy but does not tunnel through it */
|
||||
|
||||
/* The path sent to the proxy is in fact the entire URL. But if the remote
|
||||
/* The path sent to the proxy is in fact the entire URL, but if the remote
|
||||
host is a IDN-name, we must make sure that the request we produce only
|
||||
uses the encoded hostname! */
|
||||
|
||||
|
|
@ -4136,7 +4136,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
|||
k->download_done = TRUE;
|
||||
|
||||
/* If max download size is *zero* (nothing) we already have
|
||||
nothing and can safely return ok now! But for HTTP/2, we would
|
||||
nothing and can safely return ok now! For HTTP/2, we would
|
||||
like to call http2_handle_stream_close to properly close a
|
||||
stream. In order to do this, we keep reading until we
|
||||
close the stream. */
|
||||
|
|
@ -4545,7 +4545,7 @@ CURLcode Curl_http_write_resp_hd(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
/*
|
||||
* HTTP protocol `write_resp` implementation. Will parse headers
|
||||
* HTTP protocol `write_resp` implementation. Parse headers
|
||||
* when not done yet and otherwise return without consuming data.
|
||||
*/
|
||||
CURLcode Curl_http_write_resp_hds(struct Curl_easy *data,
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ CURLcode Curl_output_digest(struct Curl_easy *data,
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* So IE browsers < v7 cut off the URI part at the query part when they
|
||||
/* IE browsers < v7 cut off the URI part at the query part when they
|
||||
evaluate the MD5 and some (IIS?) servers work with them so we may need to
|
||||
do the Digest IE-style. Note that the different ways cause different MD5
|
||||
sums to get sent.
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ size_t Curl_llist_count(struct Curl_llist *list);
|
|||
void *Curl_node_elem(struct Curl_llist_node *n);
|
||||
|
||||
/* Remove the node from the list and return the custom data
|
||||
* from a Curl_llist_node. Will NOT invoke a registered `dtor`. */
|
||||
* from a Curl_llist_node. Does NOT invoke a registered `dtor`. */
|
||||
void *Curl_node_take_elem(struct Curl_llist_node *e);
|
||||
|
||||
/* Curl_node_next() returns the next element in a list from a given
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ static void mstate(struct Curl_easy *data, CURLMstate state
|
|||
static void ph_freeentry(void *p)
|
||||
{
|
||||
(void)p;
|
||||
/* Will always be FALSE. Cannot use a 0 assert here since compilers
|
||||
/* Always FALSE. Cannot use a 0 assert here since compilers
|
||||
* are not in agreement if they then want a NORETURN attribute or
|
||||
* not. *sigh* */
|
||||
DEBUGASSERT(p == NULL);
|
||||
|
|
@ -1867,7 +1867,7 @@ static void multi_posttransfer(struct Curl_easy *data)
|
|||
* multi_follow() handles the URL redirect magic. Pass in the 'newurl' string
|
||||
* as given by the remote server and set up the new URL to request.
|
||||
*
|
||||
* This function DOES NOT FREE the given url.
|
||||
* This function DOES NOT FREE the given URL.
|
||||
*/
|
||||
static CURLcode multi_follow(struct Curl_easy *data,
|
||||
const struct Curl_scheme *handler,
|
||||
|
|
|
|||
|
|
@ -1230,7 +1230,7 @@ static CURLcode pop3_state_command_resp(struct Curl_easy *data,
|
|||
when there is no body to return. */
|
||||
pop3c->eob = 2;
|
||||
|
||||
/* But since this initial CR LF pair is not part of the actual body, we set
|
||||
/* Since this initial CR LF pair is not part of the actual body, we set
|
||||
the strip counter here so that these bytes will not be delivered. */
|
||||
pop3c->strip = 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ struct SingleRequest {
|
|||
BIT(eos_sent); /* iff EOS has been sent to the server */
|
||||
BIT(rewind_read); /* iff reader needs rewind at next start */
|
||||
BIT(upload_done); /* set to TRUE when all request data has been sent */
|
||||
BIT(upload_aborted); /* set to TRUE when upload was aborted. Will also
|
||||
* show `upload_done` as TRUE. */
|
||||
BIT(upload_aborted); /* set to TRUE when upload was aborted. Also
|
||||
* shows `upload_done` as TRUE. */
|
||||
BIT(ignorebody); /* we read a response-body but we ignore it! */
|
||||
BIT(http_bodyless); /* HTTP response status code is between 100 and 199,
|
||||
204 or 304 */
|
||||
|
|
@ -207,13 +207,13 @@ bool Curl_req_sendbuf_empty(struct Curl_easy *data);
|
|||
|
||||
/**
|
||||
* Stop sending any more request data to the server.
|
||||
* Will clear the send buffer and mark request sending as done.
|
||||
* Clear the send buffer and mark request sending as done.
|
||||
*/
|
||||
CURLcode Curl_req_abort_sending(struct Curl_easy *data);
|
||||
|
||||
/**
|
||||
* Stop sending and receiving any more request data.
|
||||
* Will abort sending if not done.
|
||||
* Abort sending if not done.
|
||||
*/
|
||||
CURLcode Curl_req_stop_send_recv(struct Curl_easy *data);
|
||||
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
|
|||
}
|
||||
}
|
||||
|
||||
/* The User-Agent string might have been allocated in url.c already, because
|
||||
/* The User-Agent string might have been allocated already, because
|
||||
it might have been used in the proxy connect, but if we have got a header
|
||||
with the user-agent string specified, we erase the previously made string
|
||||
here. */
|
||||
|
|
@ -1011,7 +1011,7 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header)
|
|||
*
|
||||
* Allow any non whitespace content, up to the field separator or end of
|
||||
* line. RFC 2326 is not 100% clear on the session ID and for example
|
||||
* gstreamer does url-encoded session ID's not covered by the standard.
|
||||
* gstreamer does URL-encoded session ID's not covered by the standard.
|
||||
*/
|
||||
end = start;
|
||||
while((*end > ' ') && (*end != ';'))
|
||||
|
|
|
|||
18
lib/select.c
18
lib/select.c
|
|
@ -75,17 +75,17 @@ static int our_select(curl_socket_t maxfd, /* highest socket number */
|
|||
|
||||
#ifdef USE_WINSOCK
|
||||
/* Winsock select() must not be called with an fd_set that contains zero
|
||||
fd flags, or it will return WSAEINVAL. But, it also cannot be called
|
||||
with no fd_sets at all! From the documentation:
|
||||
fd flags, or it will return WSAEINVAL. It also cannot be called with
|
||||
no fd_sets at all! From the documentation:
|
||||
|
||||
Any two of the parameters, readfds, writefds, or exceptfds, can be
|
||||
given as null. At least one must be non-null, and any non-null
|
||||
descriptor set must contain at least one handle to a socket.
|
||||
Any two of the parameters, readfds, writefds, or exceptfds, can be
|
||||
given as null. At least one must be non-null, and any non-null
|
||||
descriptor set must contain at least one handle to a socket.
|
||||
|
||||
It is unclear why Winsock does not handle this for us instead of
|
||||
calling this an error. Luckily, with Winsock, we can _also_ ask how
|
||||
many bits are set on an fd_set. So, let's check it beforehand.
|
||||
*/
|
||||
It is unclear why Winsock does not handle this for us instead of
|
||||
calling this an error. Luckily, with Winsock, we can _also_ ask how
|
||||
many bits are set on an fd_set. Therefore, let's check it beforehand.
|
||||
*/
|
||||
return select((int)maxfd + 1,
|
||||
fds_read && fds_read->fd_count ? fds_read : NULL,
|
||||
fds_write && fds_write->fd_count ? fds_write : NULL,
|
||||
|
|
|
|||
10
lib/tftp.c
10
lib/tftp.c
|
|
@ -175,7 +175,7 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state)
|
|||
/* Average reposting an ACK after 5 seconds */
|
||||
state->retry_max = (int)timeout / 5;
|
||||
|
||||
/* But bound the total number */
|
||||
/* Bound the total number */
|
||||
if(state->retry_max < 3)
|
||||
state->retry_max = 3;
|
||||
|
||||
|
|
@ -370,9 +370,9 @@ static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event)
|
|||
int rblock = getrpacketblock(&state->rpacket);
|
||||
|
||||
if(rblock != state->block &&
|
||||
/* There is a bug in tftpd-hpa that causes it to send us an ack for
|
||||
* 65535 when the block number wraps to 0. So when we are expecting
|
||||
* 0, also accept 65535. See
|
||||
/* There is a bug in tftpd-hpa that causes it to send us an ACK for
|
||||
* 65535 when the block number wraps to 0. To handle it, when we are
|
||||
* expecting 0, also accept 65535. See
|
||||
* https://www.syslinux.org/archives/2010-September/015612.html
|
||||
* */
|
||||
!(state->block == 0 && rblock == 65535)) {
|
||||
|
|
@ -418,7 +418,7 @@ static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event)
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* TFTP considers data block size < 512 bytes as an end of session. So
|
||||
/* TFTP considers data block size < 512 bytes as an end of session, so
|
||||
* in some cases we must wait for additional data to build full (512 bytes)
|
||||
* data block.
|
||||
* */
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc);
|
|||
|
||||
/**
|
||||
* Write the transfer raw response bytes, as received from the connection.
|
||||
* Will handle all passed bytes or return an error. By default, this will
|
||||
* write the bytes as BODY to the client. Protocols may provide a
|
||||
* Handle all passed bytes or return an error. By default, this writes
|
||||
* the bytes as BODY to the client. Protocols may provide a
|
||||
* "write_resp" callback in their handler to add specific treatment. E.g.
|
||||
* HTTP parses response headers and passes them differently to the client.
|
||||
* @param data the transfer
|
||||
|
|
@ -112,7 +112,7 @@ CURLcode Curl_xfer_flush(struct Curl_easy *data);
|
|||
/**
|
||||
* Send data on the socket/connection filter designated
|
||||
* for transfer's outgoing data.
|
||||
* Will return CURLE_OK on blocking with (*pnwritten == 0).
|
||||
* Return CURLE_OK on blocking with (*pnwritten == 0).
|
||||
*/
|
||||
CURLcode Curl_xfer_send(struct Curl_easy *data,
|
||||
const void *buf, size_t blen, bool eos,
|
||||
|
|
@ -121,7 +121,7 @@ CURLcode Curl_xfer_send(struct Curl_easy *data,
|
|||
/**
|
||||
* Receive data on the socket/connection filter designated
|
||||
* for transfer's incoming data.
|
||||
* Will return CURLE_AGAIN on blocking with (*pnrcvd == 0).
|
||||
* Return CURLE_AGAIN on blocking with (*pnrcvd == 0).
|
||||
*/
|
||||
CURLcode Curl_xfer_recv(struct Curl_easy *data,
|
||||
char *buf, size_t blen,
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
#include "curlx/strerr.h"
|
||||
#include "curlx/strparse.h"
|
||||
|
||||
/* And now for the protocols */
|
||||
/* Now for the protocols */
|
||||
#include "ftp.h"
|
||||
#include "dict.h"
|
||||
#include "telnet.h"
|
||||
|
|
@ -458,7 +458,7 @@ void Curl_init_userdefined(struct Curl_easy *data)
|
|||
static void easy_meta_freeentry(void *p)
|
||||
{
|
||||
(void)p;
|
||||
/* Will always be FALSE. Cannot use a 0 assert here since compilers
|
||||
/* Always FALSE. Cannot use a 0 assert here since compilers
|
||||
* are not in agreement if they then want a NORETURN attribute or
|
||||
* not. *sigh* */
|
||||
DEBUGASSERT(p == NULL);
|
||||
|
|
@ -2083,7 +2083,7 @@ static CURLcode parse_proxy(struct Curl_easy *data,
|
|||
proxyinfo = sockstype ? &conn->socks_proxy : &conn->http_proxy;
|
||||
proxyinfo->proxytype = (unsigned char)proxytype;
|
||||
|
||||
/* Is there a username and password given in this proxy url? */
|
||||
/* Is there a username and password given in this proxy URL? */
|
||||
uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE);
|
||||
if(uc && (uc != CURLUE_NO_USER)) {
|
||||
result = Curl_uc_to_curlcode(uc);
|
||||
|
|
@ -3204,7 +3204,7 @@ static void url_conn_reuse_adjust(struct Curl_easy *data,
|
|||
static void conn_meta_freeentry(void *p)
|
||||
{
|
||||
(void)p;
|
||||
/* Will always be FALSE. Cannot use a 0 assert here since compilers
|
||||
/* Always FALSE. Cannot use a 0 assert here since compilers
|
||||
* are not in agreement if they then want a NORETURN attribute or
|
||||
* not. *sigh* */
|
||||
DEBUGASSERT(p == NULL);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include "curl_setup.h"
|
||||
|
||||
/*
|
||||
* Prototypes for library-wide functions provided by url.c
|
||||
* Prototypes for library-wide functions
|
||||
*/
|
||||
|
||||
CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn);
|
||||
|
|
|
|||
|
|
@ -255,13 +255,13 @@ static void auth_digest_get_qop_values(const char *options, int *value)
|
|||
* Parameters:
|
||||
*
|
||||
* chlgref [in] - The challenge message.
|
||||
* nonce [in/out] - The buffer where the nonce will be stored.
|
||||
* nonce [in/out] - The buffer where the nonce is stored.
|
||||
* nlen [in] - The length of the nonce buffer.
|
||||
* realm [in/out] - The buffer where the realm will be stored.
|
||||
* realm [in/out] - The buffer where the realm is stored.
|
||||
* rlen [in] - The length of the realm buffer.
|
||||
* alg [in/out] - The buffer where the algorithm will be stored.
|
||||
* alg [in/out] - The buffer where the algorithm is stored.
|
||||
* alen [in] - The length of the algorithm buffer.
|
||||
* qop [in/out] - The buffer where the qop-options will be stored.
|
||||
* qop [in/out] - The buffer where the qop-options is stored.
|
||||
* qlen [in] - The length of the qop buffer.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
|
|
@ -384,7 +384,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||
if(result)
|
||||
return result;
|
||||
|
||||
/* So far so good, now calculate A1 and H(A1) according to RFC 2831 */
|
||||
/* Good so far, now calculate A1 and H(A1) according to RFC 2831 */
|
||||
ctxt = Curl_MD5_init(&Curl_DIGEST_MD5);
|
||||
if(!ctxt)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
|
@ -669,7 +669,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
|
|||
* uripath [in] - The path of the HTTP uri.
|
||||
* digest [in/out] - The digest data struct being used and modified.
|
||||
* outptr [in/out] - The address where a pointer to newly allocated memory
|
||||
* holding the result will be stored upon completion.
|
||||
* holding the result is stored upon completion.
|
||||
* outlen [out] - The length of the output message.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
|
|
@ -853,8 +853,8 @@ static CURLcode auth_create_digest_http_message(
|
|||
nonce="1053604145", uri="/64", response="c55f7f30d83d774a3d2dcacf725abaca"
|
||||
|
||||
Digest parameters are all quoted strings. Username which is provided by
|
||||
the user will need double quotes and backslashes within it escaped.
|
||||
realm, nonce, and opaque will need backslashes as well as they were
|
||||
the user needs double quotes and backslashes within it escaped.
|
||||
realm, nonce, and opaque needs backslashes as well as they were
|
||||
de-escaped when copied from request header. cnonce is generated with
|
||||
web-safe characters. uri is already percent encoded. nc is 8 hex
|
||||
characters. algorithm and qop with standard values only contain web-safe
|
||||
|
|
@ -977,7 +977,7 @@ oom:
|
|||
* uripath [in] - The path of the HTTP uri.
|
||||
* digest [in/out] - The digest data struct being used and modified.
|
||||
* outptr [in/out] - The address where a pointer to newly allocated memory
|
||||
* holding the result will be stored upon completion.
|
||||
* holding the result is stored upon completion.
|
||||
* outlen [out] - The length of the output message.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
|
|||
* uripath [in] - The path of the HTTP uri.
|
||||
* digest [in/out] - The digest data struct being used and modified.
|
||||
* outptr [in/out] - The address where a pointer to newly allocated memory
|
||||
* holding the result will be stored upon completion.
|
||||
* holding the result is stored upon completion.
|
||||
* outlen [out] - The length of the output message.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@
|
|||
/* Indicates that 128-bit encryption is supported. */
|
||||
|
||||
#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1 << 30)
|
||||
/* Indicates that the client will provide an encrypted master key in
|
||||
/* Indicates that the client provides an encrypted master key in
|
||||
the "Session Key" field of the Type 3 message. */
|
||||
|
||||
#define NTLMFLAG_NEGOTIATE_56 (1 << 31)
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
|
|||
/* ssl context comes from schannel.
|
||||
* When extended protection is used in IIS server,
|
||||
* we have to pass a second SecBuffer to the SecBufferDesc
|
||||
* otherwise IIS will not pass the authentication (401 response).
|
||||
* otherwise IIS does not pass the authentication (401 response).
|
||||
* Minimum supported version is Windows 7.
|
||||
* https://learn.microsoft.com/security-updates/SecurityAdvisories/2009/973811
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
|||
* data [in] - The session handle.
|
||||
* nego [in/out] - The Negotiate data struct being used and modified.
|
||||
* outptr [in/out] - The address where a pointer to newly allocated memory
|
||||
* holding the result will be stored upon completion.
|
||||
* holding the result is stored upon completion.
|
||||
* outlen [out] - The length of the output message.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
|||
/* ssl context comes from Schannel.
|
||||
* When extended protection is used in IIS server,
|
||||
* we have to pass a second SecBuffer to the SecBufferDesc
|
||||
* otherwise IIS will not pass the authentication (401 response).
|
||||
* otherwise IIS does not pass the authentication (401 response).
|
||||
* Minimum supported version is Windows 7.
|
||||
* https://learn.microsoft.com/security-updates/SecurityAdvisories/2009/973811
|
||||
*/
|
||||
|
|
@ -278,7 +278,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
|||
* data [in] - The session handle.
|
||||
* nego [in/out] - The Negotiate data struct being used and modified.
|
||||
* outptr [in/out] - The address where a pointer to newly allocated memory
|
||||
* holding the result will be stored upon completion.
|
||||
* holding the result is stored upon completion.
|
||||
* outlen [out] - The length of the output message.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static void cf_ngtcp2_setup_keep_alive(struct Curl_cfilter *cf,
|
|||
struct cf_ngtcp2_ctx *ctx = cf->ctx;
|
||||
const ngtcp2_transport_params *rp;
|
||||
/* Peer should have sent us its transport parameters. If it
|
||||
* announces a positive `max_idle_timeout` it will close the
|
||||
* announces a positive `max_idle_timeout` it closes the
|
||||
* connection when it does not hear from us for that time.
|
||||
*
|
||||
* Some servers use this as a keep-alive timer at a rather low
|
||||
|
|
@ -2018,7 +2018,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf,
|
|||
* This is called PMTUD (Path Maximum Transmission Unit Discovery).
|
||||
* Since a PMTUD might be rejected right on send, we do not want it
|
||||
* be followed by other packets of lesser size. Because those would
|
||||
* also fail then. So, if we detect a PMTUD while buffering, we flush.
|
||||
* also fail then. If we detect a PMTUD while buffering, we flush.
|
||||
*/
|
||||
max_payload_size = ngtcp2_conn_get_max_tx_udp_payload_size(ctx->qconn);
|
||||
path_max_payload_size =
|
||||
|
|
@ -2043,7 +2043,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf,
|
|||
++pktcnt;
|
||||
if(pktcnt == 1) {
|
||||
/* first packet in buffer. This is either of a known, "good"
|
||||
* payload size or it is a PMTUD. We will see. */
|
||||
* payload size or it is a PMTUD. We shall see. */
|
||||
gsolen = nread;
|
||||
}
|
||||
else if(nread > gsolen ||
|
||||
|
|
@ -2257,7 +2257,7 @@ static CURLcode cf_ngtcp2_shutdown(struct Curl_cfilter *cf,
|
|||
|
||||
if(Curl_bufq_is_empty(&ctx->q.sendbuf)) {
|
||||
/* Sent everything off. ngtcp2 seems to have no support for graceful
|
||||
* shutdowns. So, we are done. */
|
||||
* shutdowns. We are done. */
|
||||
CURL_TRC_CF(data, cf, "shutdown completely sent off, done");
|
||||
*done = TRUE;
|
||||
result = CURLE_OK;
|
||||
|
|
@ -2859,7 +2859,7 @@ static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf,
|
|||
goto out;
|
||||
|
||||
/* We do not announce a max idle timeout, but when the peer does
|
||||
* it will close the connection when it expires. */
|
||||
* it closes the connection when it expires. */
|
||||
rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn);
|
||||
if(rp && rp->max_idle_timeout) {
|
||||
timediff_t idletime_ms =
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ static void cf_quiche_recv_body(struct Curl_cfilter *cf,
|
|||
return;
|
||||
|
||||
/* Even when the transfer has already errored, we need to receive
|
||||
* the data from quiche, as quiche will otherwise get stuck and
|
||||
* the data from quiche, as quiche otherwise gets stuck and
|
||||
* raise events to receive over and over again. */
|
||||
cb_ctx.cf = cf;
|
||||
cb_ctx.data = data;
|
||||
|
|
@ -779,7 +779,7 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf,
|
|||
else
|
||||
failf(data, "connection closed by server");
|
||||
/* Connection timed out, expire all transfers belonging to it
|
||||
* as will not get any more POLL events here. */
|
||||
* as it does not get any more POLL events here. */
|
||||
cf_quiche_expire_conn_closed(cf, data);
|
||||
return CURLE_SEND_ERROR;
|
||||
}
|
||||
|
|
@ -939,8 +939,8 @@ static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf,
|
|||
rv = quiche_h3_send_body(ctx->h3c, ctx->qconn, stream->id,
|
||||
(uint8_t *)CURL_UNCONST(buf), len, eos);
|
||||
if(rv == QUICHE_H3_ERR_DONE || (rv == 0 && len > 0)) {
|
||||
/* Blocked on flow control and should HOLD sending. But when do we open
|
||||
* again? */
|
||||
/* Blocked on flow control and should HOLD sending.
|
||||
When do we open again? */
|
||||
if(!quiche_conn_stream_writable(ctx->qconn, stream->id, len)) {
|
||||
CURL_TRC_CF(data, cf, "[%" PRIu64 "] send_body(len=%zu) "
|
||||
"-> window exhausted", stream->id, len);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ typedef CURLcode Curl_vquic_session_reuse_cb(struct Curl_cfilter *cf,
|
|||
* @param ctx the TLS context to initialize
|
||||
* @param cf the connection filter involved
|
||||
* @param data the transfer involved
|
||||
* @param peer the peer that will be connected to
|
||||
* @param peer the peer to be connected to
|
||||
* @param alpns the ALPN specifications to negotiate, may be NULL
|
||||
* @param cb_setup optional callback for early TLS config
|
||||
* @param cb_user_data user_data param for callback
|
||||
|
|
|
|||
|
|
@ -1306,8 +1306,8 @@ static int myssh_in_SFTP_REALPATH(struct Curl_easy *data,
|
|||
|
||||
/* This is the last step in the SFTP connect phase. Do note that while
|
||||
we get the homedir here, we get the "workingpath" in the DO action
|
||||
since the homedir will remain the same between request but the
|
||||
working path will not. */
|
||||
since the homedir remains the same between request but the
|
||||
working path does not. */
|
||||
CURL_TRC_SSH(data, "CONNECT phase done");
|
||||
myssh_to(data, sshc, SSH_STOP);
|
||||
return SSH_NO_ERROR;
|
||||
|
|
@ -1372,8 +1372,8 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data,
|
|||
sshc->acceptfail = FALSE;
|
||||
|
||||
/* if a command starts with an asterisk, which a legal SFTP command never
|
||||
can, the command will be allowed to fail without it causing any
|
||||
aborts or cancels etc. It will cause libcurl to act as if the command
|
||||
can, the command is allowed to fail without it causing any
|
||||
aborts or cancels etc. It causes libcurl to act as if the command
|
||||
is successful, whatever the server responds. */
|
||||
|
||||
if(cmd[0] == '*') {
|
||||
|
|
@ -1583,8 +1583,8 @@ static int myssh_in_SFTP_QUOTE_STAT(struct Curl_easy *data,
|
|||
sshc->acceptfail = FALSE;
|
||||
|
||||
/* if a command starts with an asterisk, which a legal SFTP command never
|
||||
can, the command will be allowed to fail without it causing any
|
||||
aborts or cancels etc. It will cause libcurl to act as if the command
|
||||
can, the command is allowed to fail without it causing any
|
||||
aborts or cancels etc. It causes libcurl to act as if the command
|
||||
is successful, whatever the server responds. */
|
||||
|
||||
if(cmd[0] == '*') {
|
||||
|
|
@ -1844,7 +1844,7 @@ static void sshc_cleanup(struct ssh_conn *sshc)
|
|||
/*
|
||||
* ssh_statemach_act() runs the SSH state machine as far as it can without
|
||||
* blocking and without reaching the end. The data the pointer 'block' points
|
||||
* to will be set to TRUE if the libssh function returns SSH_AGAIN
|
||||
* to is set to TRUE if the libssh function returns SSH_AGAIN
|
||||
* meaning it wants to be called again when the socket is ready
|
||||
*/
|
||||
static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
||||
|
|
@ -2637,7 +2637,7 @@ static CURLcode scp_send(struct Curl_easy *data, int sockindex,
|
|||
|
||||
#if 0
|
||||
/* The following code is misleading, mostly added as wishful thinking
|
||||
* that libssh at some point will implement non-blocking ssh_scp_write/read.
|
||||
* that libssh at some point would implement non-blocking ssh_scp_write/read.
|
||||
* Currently rc can only be number of bytes read or SSH_ERROR. */
|
||||
myssh_block2waitfor(conn, sshc, (rc == SSH_AGAIN));
|
||||
|
||||
|
|
@ -2671,7 +2671,7 @@ static CURLcode scp_recv(struct Curl_easy *data, int sockindex,
|
|||
return CURLE_SSH;
|
||||
#if 0
|
||||
/* The following code is misleading, mostly added as wishful thinking
|
||||
* that libssh at some point will implement non-blocking ssh_scp_write/read.
|
||||
* that libssh at some point would implement non-blocking ssh_scp_write/read.
|
||||
* Currently rc can only be SSH_OK or SSH_ERROR. */
|
||||
|
||||
myssh_block2waitfor(conn, sshc, (nread == SSH_AGAIN));
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ static CURLcode ssh_knownhost(struct Curl_easy *data,
|
|||
rc = CURLKHSTAT_REJECT;
|
||||
|
||||
switch(rc) {
|
||||
default: /* unknown return codes will equal reject */
|
||||
default: /* unknown return codes is the same as reject */
|
||||
case CURLKHSTAT_REJECT:
|
||||
myssh_to(data, sshc, SSH_SESSION_FREE);
|
||||
FALLTHROUGH();
|
||||
|
|
@ -545,8 +545,8 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data,
|
|||
infof(data, "SSH MD5 fingerprint: %s", md5buffer);
|
||||
}
|
||||
|
||||
/* This does NOT verify the length of 'pubkey_md5' separately, which will
|
||||
make the comparison below fail unless it is exactly 32 characters */
|
||||
/* This does NOT verify the length of 'pubkey_md5' separately, which
|
||||
makes the comparison below fail unless it is exactly 32 characters */
|
||||
if(!fingerprint || !curl_strequal(md5buffer, pubkey_md5)) {
|
||||
if(fingerprint) {
|
||||
failf(data,
|
||||
|
|
@ -600,7 +600,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
/*
|
||||
* ssh_force_knownhost_key_type() will check the known hosts file and try to
|
||||
* ssh_force_knownhost_key_type() checks the known hosts file and try to
|
||||
* force a specific public key type from the server if an entry is found.
|
||||
*/
|
||||
static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data,
|
||||
|
|
@ -624,7 +624,7 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data,
|
|||
struct connectdata *conn = data->conn;
|
||||
/* lets try to find our host in the known hosts file */
|
||||
while(!libssh2_knownhost_get(sshc->kh, &store, store)) {
|
||||
/* For non-standard ports, the name will be enclosed in */
|
||||
/* For non-standard ports, the name is enclosed in */
|
||||
/* square brackets, followed by a colon and the port */
|
||||
if(store) {
|
||||
if(store->name) {
|
||||
|
|
@ -741,8 +741,8 @@ static CURLcode sftp_quote(struct Curl_easy *data,
|
|||
sshc->acceptfail = FALSE;
|
||||
|
||||
/* if a command starts with an asterisk, which a legal SFTP command never
|
||||
can, the command will be allowed to fail without it causing any
|
||||
aborts or cancels etc. It will cause libcurl to act as if the command
|
||||
can, the command is allowed to fail without it causing any
|
||||
aborts or cancels etc. It causes libcurl to act as if the command
|
||||
is successful, whatever the server responds. */
|
||||
|
||||
if(cmd[0] == '*') {
|
||||
|
|
@ -894,7 +894,7 @@ static CURLcode sftp_upload_init(struct Curl_easy *data,
|
|||
/*
|
||||
* NOTE!!! libssh2 requires that the destination path is a full path
|
||||
* that includes the destination file and name OR ends in a "/"
|
||||
* If this is not done the destination file will be named the
|
||||
* If this is not done the destination file is named the
|
||||
* same name as the last directory in the path.
|
||||
*/
|
||||
|
||||
|
|
@ -1169,8 +1169,8 @@ static CURLcode sftp_quote_stat(struct Curl_easy *data,
|
|||
sshc->acceptfail = FALSE;
|
||||
|
||||
/* if a command starts with an asterisk, which a legal SFTP command never
|
||||
can, the command will be allowed to fail without it causing any aborts or
|
||||
cancels etc. It will cause libcurl to act as if the command is
|
||||
can, the command is allowed to fail without it causing any aborts or
|
||||
cancels etc. It causes libcurl to act as if the command is
|
||||
successful, whatever the server responds. */
|
||||
|
||||
if(cmd[0] == '*') {
|
||||
|
|
@ -1296,7 +1296,7 @@ static CURLcode sftp_download_stat(struct Curl_easy *data,
|
|||
data->req.size = -1;
|
||||
data->req.maxdownload = -1;
|
||||
Curl_pgrsSetDownloadSize(data, -1);
|
||||
attrs.filesize = 0; /* might be uninitialized but will be read below */
|
||||
attrs.filesize = 0; /* might be uninitialized but is read below */
|
||||
}
|
||||
else {
|
||||
curl_off_t size = attrs.filesize;
|
||||
|
|
@ -1489,9 +1489,9 @@ static CURLcode ssh_state_authlist(struct Curl_easy *data,
|
|||
* must never change it later. Thus, always specify the correct username
|
||||
* here, even though the libssh2 docs kind of indicate that it should be
|
||||
* possible to get a 'generic' list (not user-specific) of authentication
|
||||
* methods, presumably with a blank username. That will not work in my
|
||||
* methods, presumably with a blank username. That does not work in my
|
||||
* experience.
|
||||
* So always specify it here.
|
||||
* Therefore always specify it here.
|
||||
*/
|
||||
struct connectdata *conn = data->conn;
|
||||
sshc->authlist = libssh2_userauth_list(sshc->ssh_session,
|
||||
|
|
@ -1835,8 +1835,7 @@ static CURLcode ssh_state_sftp_realpath(struct Curl_easy *data,
|
|||
|
||||
/* This is the last step in the SFTP connect phase. Do note that while we
|
||||
get the homedir here, we get the "workingpath" in the DO action since the
|
||||
homedir will remain the same between request but the working path will
|
||||
not. */
|
||||
homedir remains the same between request but the working path does not. */
|
||||
CURL_TRC_SSH(data, "CONNECT phase done");
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
@ -2235,7 +2234,7 @@ static CURLcode ssh_state_scp_download_init(struct Curl_easy *data,
|
|||
curl_off_t bytecount;
|
||||
|
||||
/*
|
||||
* We must check the remote file; if it is a directory no values will
|
||||
* We must check the remote file; if it is a directory no values are
|
||||
* be set in sb
|
||||
*/
|
||||
|
||||
|
|
@ -2380,7 +2379,7 @@ static CURLcode ssh_state_scp_upload_init(struct Curl_easy *data,
|
|||
/*
|
||||
* libssh2 requires that the destination path is a full path that
|
||||
* includes the destination file and name OR ends in a "/" . If this is
|
||||
* not done the destination file will be named the same name as the last
|
||||
* not done the destination file is named the same name as the last
|
||||
* directory in the path.
|
||||
*/
|
||||
sshc->ssh_channel =
|
||||
|
|
@ -2560,7 +2559,7 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data,
|
|||
/*
|
||||
* ssh_statemachine() runs the SSH state machine as far as it can without
|
||||
* blocking and without reaching the end. The data the pointer 'block' points
|
||||
* to will be set to TRUE if the libssh2 function returns LIBSSH2_ERROR_EAGAIN
|
||||
* to is set to TRUE if the libssh2 function returns LIBSSH2_ERROR_EAGAIN
|
||||
* meaning it wants to be called again when the socket is ready
|
||||
*/
|
||||
static CURLcode ssh_statemachine(struct Curl_easy *data,
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf,
|
|||
struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
|
||||
if(!ssl_config->no_revoke) {
|
||||
if(__builtin_available(macOS 10.9, iOS 7, tvOS 9, watchOS 2, *)) {
|
||||
/* Even without this set, validation will seemingly-unavoidably fail
|
||||
/* Even without this set, validation seemingly-unavoidably fails
|
||||
* for certificates that trustd already knows to be revoked.
|
||||
* This policy further allows trustd to consult CRLs and OCSP data
|
||||
* to determine revocation status (which it may then cache). */
|
||||
|
|
@ -142,7 +142,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf,
|
|||
* of a cert being NOT REVOKED. Which not in general available for
|
||||
* certificates on the Internet.
|
||||
* It seems that applications using this policy are expected to PIN
|
||||
* their certificate public keys or verification will fail.
|
||||
* their certificate public keys or verification fails.
|
||||
* This does not seem to be what we want here. */
|
||||
if(!ssl_config->revoke_best_effort) {
|
||||
revocation_flags |= kSecRevocationRequirePositiveResponse;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ static gnutls_x509_crt_fmt_t gnutls_do_file_type(const char *type)
|
|||
|
||||
#define GNUTLS_CIPHERS "NORMAL:%PROFILE_MEDIUM:-ARCFOUR-128:" \
|
||||
"-CTYPE-ALL:+CTYPE-X509"
|
||||
/* If GnuTLS was compiled without support for SRP it will error out if SRP is
|
||||
/* If GnuTLS was compiled without support for SRP it errors out if SRP is
|
||||
requested in the priority string, so treat it specially
|
||||
*/
|
||||
#define GNUTLS_SRP "+SRP"
|
||||
|
|
@ -710,7 +710,7 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf,
|
|||
|
||||
/* get the session ID data size */
|
||||
gnutls_session_get_data(session, NULL, &sdata_len);
|
||||
if(!sdata_len) /* gnutls does this for some version combinations */
|
||||
if(!sdata_len) /* GnuTLS does this for some version combinations */
|
||||
return CURLE_OK;
|
||||
|
||||
sdata = curlx_malloc(sdata_len); /* get a buffer for it */
|
||||
|
|
@ -818,7 +818,7 @@ static CURLcode gtls_set_priority(struct Curl_cfilter *cf,
|
|||
#ifdef USE_GNUTLS_SRP
|
||||
if(conn_config->username) {
|
||||
/* Only add SRP to the cipher list if SRP is requested. Otherwise
|
||||
* GnuTLS will disable TLS 1.3 support. */
|
||||
* GnuTLS disables TLS 1.3 support. */
|
||||
result = curlx_dyn_add(&buf, priority);
|
||||
if(!result)
|
||||
result = curlx_dyn_add(&buf, ":" GNUTLS_SRP);
|
||||
|
|
@ -1116,7 +1116,7 @@ CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx,
|
|||
Curl_alpn_copy(&alpns, alpns_requested);
|
||||
|
||||
/* This might be a reconnect, so we check for a session ID in the cache
|
||||
to speed up things. We need to do this before constructing the gnutls
|
||||
to speed up things. We need to do this before constructing the GnuTLS
|
||||
session since we need to set flags depending on the kind of reuse. */
|
||||
if(conn_config->cache_session && !conn_config->verifystatus) {
|
||||
result = Curl_ssl_scache_take(cf, data, peer->scache_key, &scs);
|
||||
|
|
@ -1178,7 +1178,7 @@ CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx,
|
|||
#endif
|
||||
|
||||
/* convert the ALPN string from our arguments to a list of strings that
|
||||
* gnutls wants and will convert internally back to this string for sending
|
||||
* GnuTLS wants and does convert internally back to this string for sending
|
||||
* to the server. nice. */
|
||||
if(!gtls_alpns_count && alpns.count) {
|
||||
size_t i;
|
||||
|
|
@ -1579,7 +1579,7 @@ CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf,
|
|||
long * const certverifyresult = &ssl_config->certverifyresult;
|
||||
|
||||
(void)cf;
|
||||
/* This function will return the peer's raw certificate (chain) as sent by
|
||||
/* This function returns the peer's raw certificate (chain) as sent by
|
||||
the peer. These certificates are in raw format (DER encoded for
|
||||
X.509). In case of a X.509 then a certificate list may be present. The
|
||||
first certificate in the list is the peer's certificate, following the
|
||||
|
|
@ -1637,7 +1637,7 @@ CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf,
|
|||
if(config->verifypeer) {
|
||||
bool verified = FALSE;
|
||||
unsigned int verify_status = 0;
|
||||
/* This function will try to verify the peer's certificate and return
|
||||
/* This function tries to verify the peer's certificate and return
|
||||
its status (trusted, invalid etc.). The value of status should be
|
||||
one or more of the gnutls_certificate_status_t enumerated elements
|
||||
bitwise or'd. To avoid denial of service attacks some default
|
||||
|
|
@ -1693,7 +1693,7 @@ CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf,
|
|||
|
||||
/* initialize an X.509 certificate structure. */
|
||||
if(gnutls_x509_crt_init(&x509_cert)) {
|
||||
failf(data, "failed to init gnutls x509_crt");
|
||||
failf(data, "failed to init GnuTLS x509_crt");
|
||||
*certverifyresult = GNUTLS_E_NO_CERTIFICATE_FOUND;
|
||||
result = CURLE_SSL_CONNECT_ERROR;
|
||||
goto out;
|
||||
|
|
@ -1777,7 +1777,7 @@ CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf,
|
|||
if(config->issuercert) {
|
||||
gnutls_datum_t issuerp;
|
||||
if(gnutls_x509_crt_init(&x509_issuer)) {
|
||||
failf(data, "failed to init gnutls x509_crt for issuer");
|
||||
failf(data, "failed to init GnuTLS x509_crt for issuer");
|
||||
result = CURLE_SSL_ISSUER_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1796,7 +1796,7 @@ CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf,
|
|||
config->issuercert ? config->issuercert : "none");
|
||||
}
|
||||
|
||||
/* This function will check if the given certificate's subject matches the
|
||||
/* This function checks if the given certificate's subject matches the
|
||||
given hostname. This is a basic implementation of the matching described
|
||||
in RFC2818 (HTTPS), which takes into account wildcards, and the subject
|
||||
alternative name PKIX extension. Returns non zero on success, and zero on
|
||||
|
|
@ -1890,7 +1890,7 @@ static CURLcode gtls_send_earlydata(struct Curl_cfilter *cf,
|
|||
goto out;
|
||||
}
|
||||
else if(!n) {
|
||||
/* gnutls is buggy, it *SHOULD* return the amount of bytes it took in.
|
||||
/* GnuTLS is buggy, it *SHOULD* return the amount of bytes it took in.
|
||||
* Instead it returns 0 if everything was written. */
|
||||
n = (ssize_t)blen;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ static CURLcode mbed_load_cacert(struct Curl_cfilter *cf,
|
|||
}
|
||||
#else
|
||||
/* DER encoded certs do not need to be null terminated because it is a
|
||||
binary format. So if we are not compiling with PEM_PARSE we can avoid
|
||||
binary format. Thus, if we are not compiling with PEM_PARSE we can avoid
|
||||
the extra memory copies altogether. */
|
||||
ret = mbedtls_x509_crt_parse_der(&backend->cacert, ca_info_blob->data,
|
||||
ca_info_blob->len);
|
||||
|
|
@ -631,7 +631,7 @@ static CURLcode mbed_load_clicert(struct Curl_cfilter *cf,
|
|||
}
|
||||
#else
|
||||
/* DER encoded certs do not need to be null terminated because it is a
|
||||
binary format. So if we are not compiling with PEM_PARSE we can avoid
|
||||
binary format. Thus, if we are not compiling with PEM_PARSE we can avoid
|
||||
the extra memory copies altogether. */
|
||||
ret = mbedtls_x509_crt_parse_der(&backend->clicert, ssl_cert_blob->data,
|
||||
ssl_cert_blob->len);
|
||||
|
|
@ -932,8 +932,8 @@ static CURLcode mbed_configure_ssl(struct Curl_cfilter *cf,
|
|||
if(mbedtls_ssl_set_hostname(&backend->ssl, connssl->peer.sni ?
|
||||
connssl->peer.sni : connssl->peer.hostname)) {
|
||||
/* mbedtls_ssl_set_hostname() sets the name to use in CN/SAN checks and
|
||||
the name to set in the SNI extension. So even if curl connects to a
|
||||
host specified as an IP address, this function must be used. */
|
||||
the name to set in the SNI extension. Thus even if curl connects to
|
||||
a host specified as an IP address, this function must be used. */
|
||||
failf(data, "Failed to set SNI");
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
|
@ -1210,7 +1210,7 @@ static CURLcode mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
connssl->io_need = CURL_SSL_IO_NEED_NONE;
|
||||
/* mbedTLS is picky when a mbedtls_ssl_write() was previously blocked.
|
||||
* It requires to be called with the same amount of bytes again, or it
|
||||
* will lose bytes, e.g. reporting all was sent but they were not.
|
||||
* loses bytes, e.g. reporting all was sent but they were not.
|
||||
* Remember the blocked length and use that when set. */
|
||||
if(backend->send_blocked) {
|
||||
DEBUGASSERT(backend->send_blocked_len <= len);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
* <winldap.h>, <iphlpapi.h>, or something else, <wincrypt.h> does this:
|
||||
* #define X509_NAME ((LPCSTR)7)
|
||||
*
|
||||
* And in BoringSSL/AWC-LC's <openssl/base.h> there is:
|
||||
* In BoringSSL/AWC-LC's <openssl/base.h> there is:
|
||||
* typedef struct X509_name_st X509_NAME;
|
||||
* etc.
|
||||
*
|
||||
|
|
@ -661,7 +661,7 @@ static int ossl_bio_cf_in_read(BIO *bio, char *buf, int blen)
|
|||
}
|
||||
|
||||
/* Before returning server replies to the SSL instance, we need
|
||||
* to have setup the x509 store or verification will fail. */
|
||||
* to have setup the x509 store or verification fails. */
|
||||
if(!octx->x509_store_setup) {
|
||||
r2 = Curl_ssl_setup_x509_store(cf, data, octx);
|
||||
if(r2) {
|
||||
|
|
@ -2141,9 +2141,9 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data,
|
|||
case GEN_DNS: /* name/pattern comparison */
|
||||
/* The OpenSSL man page explicitly says: "In general it cannot be
|
||||
assumed that the data returned by ASN1_STRING_data() is null
|
||||
terminated or does not contain embedded nulls." But also that
|
||||
"The actual format of the data will depend on the actual string
|
||||
type itself: for example for an IA5String the data will be ASCII"
|
||||
terminated or does not contain embedded nulls.", but also that
|
||||
"The actual format of the data depends on the actual string
|
||||
type itself: for example for an IA5String the data is ASCII"
|
||||
|
||||
It has been however verified that in 0.9.6 and 0.9.7, IA5String
|
||||
is always null-terminated.
|
||||
|
|
@ -2201,7 +2201,7 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data,
|
|||
i = j;
|
||||
}
|
||||
|
||||
/* we have the name entry and we will now convert this to a string
|
||||
/* we have the name entry and we now convert this to a string
|
||||
that we can use for comparison. Doing this we support BMPstring,
|
||||
UTF8, etc. */
|
||||
|
||||
|
|
@ -2586,7 +2586,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type,
|
|||
ssl_ver >>= 8; /* check the upper 8 bits only below */
|
||||
|
||||
/* SSLv2 does not seem to have TLS record-type headers, so OpenSSL
|
||||
* always pass-up content-type as 0. But the interesting message-type
|
||||
* always pass-up content-type as 0, but the interesting message-type
|
||||
* is at 'buf[0]'.
|
||||
*/
|
||||
if(ssl_ver == SSL3_VERSION_MAJOR && content_type)
|
||||
|
|
@ -2681,7 +2681,7 @@ static CURLcode ossl_set_ssl_version_min_max(struct Curl_cfilter *cf,
|
|||
case CURL_SSLVERSION_MAX_DEFAULT: /* max selected */
|
||||
default:
|
||||
/* SSL_CTX_set_max_proto_version states that: setting the maximum to 0
|
||||
will enable protocol versions up to the highest version supported by
|
||||
enables protocol versions up to the highest version supported by
|
||||
the library */
|
||||
ossl_ssl_version_max = 0;
|
||||
break;
|
||||
|
|
@ -2865,7 +2865,7 @@ static CURLcode ossl_win_load_store(struct Curl_easy *data,
|
|||
hStore = CertOpenSystemStoreA(0, win_store);
|
||||
if(hStore) {
|
||||
PCCERT_CONTEXT pContext = NULL;
|
||||
/* The array of enhanced key usage OIDs will vary per certificate and
|
||||
/* The array of enhanced key usage OIDs varies per certificate and
|
||||
is declared outside of the loop so that rather than malloc/free each
|
||||
iteration we can grow it with realloc, when necessary. */
|
||||
CERT_ENHKEY_USAGE *enhkey_usage = NULL;
|
||||
|
|
@ -3129,7 +3129,7 @@ static CURLcode ossl_load_trust_anchors(struct Curl_cfilter *cf,
|
|||
|
||||
#ifdef CURL_CA_FALLBACK
|
||||
if(octx->store_is_empty) {
|
||||
/* verifying the peer without any CA certificates will not
|
||||
/* verifying the peer without any CA certificates does not
|
||||
work so use OpenSSL's built-in default as fallback */
|
||||
X509_STORE_set_default_paths(store);
|
||||
infof(data, " OpenSSL default paths (fallback)");
|
||||
|
|
@ -3675,7 +3675,7 @@ static CURLcode ossl_init_method(struct Curl_cfilter *cf,
|
|||
case CURL_SSLVERSION_TLSv1_1:
|
||||
case CURL_SSLVERSION_TLSv1_2:
|
||||
case CURL_SSLVERSION_TLSv1_3:
|
||||
/* it will be handled later with the context options */
|
||||
/* it is handled later with the context options */
|
||||
*pmethod = TLS_client_method();
|
||||
break;
|
||||
case CURL_SSLVERSION_SSLv2:
|
||||
|
|
@ -4080,7 +4080,7 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf,
|
|||
#ifdef HAVE_SSL_SET0_WBIO
|
||||
/* with OpenSSL v1.1.1 we get an alternative to SSL_set_bio() that works
|
||||
* without backward compat quirks. Every call takes one reference, so we
|
||||
* up it and pass. SSL* then owns it and will free.
|
||||
* up it and pass. SSL* then owns and frees it.
|
||||
* We check on the function in configure, since LibreSSL and friends
|
||||
* each have their own versions to add support for this. */
|
||||
BIO_up_ref(bio);
|
||||
|
|
@ -4440,7 +4440,7 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509 *cert,
|
|||
/*
|
||||
* These checks are verifying we got back the same values as when we
|
||||
* sized the buffer. it is pretty weak since they should always be the
|
||||
* same. But it gives us something to test.
|
||||
* same, but it gives us something to test.
|
||||
*/
|
||||
if((len1 != len2) || !temp || ((temp - buff1) != len1))
|
||||
break; /* failed */
|
||||
|
|
@ -5088,7 +5088,7 @@ static CURLcode ossl_send(struct Curl_cfilter *cf,
|
|||
memlen = (len > (size_t)INT_MAX) ? INT_MAX : (int)len;
|
||||
if(octx->blocked_ssl_write_len && (octx->blocked_ssl_write_len != memlen)) {
|
||||
/* The previous SSL_write() call was blocked, using that length.
|
||||
* We need to use that again or OpenSSL will freak out. A shorter
|
||||
* We need to use that again or OpenSSL freaks out. A shorter
|
||||
* length should not happen and is a bug in libcurl. */
|
||||
if(octx->blocked_ssl_write_len > memlen) {
|
||||
DEBUGASSERT(0);
|
||||
|
|
@ -5240,7 +5240,7 @@ static CURLcode ossl_recv(struct Curl_cfilter *cf,
|
|||
result = CURLE_RECV_ERROR;
|
||||
}
|
||||
else {
|
||||
/* We should no longer get here nowadays. But handle
|
||||
/* We should no longer get here nowadays, but handle
|
||||
* the error in case of some weirdness in the OSSL stack */
|
||||
int sockerr = SOCKERRNO;
|
||||
if(sockerr)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ extern const struct Curl_ssl Curl_ssl_openssl;
|
|||
|
||||
/**
|
||||
* Setup the OpenSSL X509_STORE in `ssl_ctx` for the cfilter `cf` and
|
||||
* easy handle `data`. Will allow reuse of a shared cache if suitable
|
||||
* easy handle `data`. Allows reuse of a shared cache if suitable
|
||||
* and configured.
|
||||
*/
|
||||
CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf,
|
||||
|
|
|
|||
|
|
@ -297,8 +297,8 @@ static CURLcode cr_flush_out(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
* we get either an error or EAGAIN/EWOULDBLOCK.
|
||||
*
|
||||
* it is okay to call this function with plainbuf == NULL and plainlen == 0.
|
||||
* In that case, it will not read anything into Rustls' plaintext input buffer.
|
||||
* It will only drain Rustls' plaintext output buffer into the socket.
|
||||
* In that case, it does not read anything into Rustls' plaintext input buffer.
|
||||
* It only drains Rustls' plaintext output buffer into the socket.
|
||||
*/
|
||||
static CURLcode cr_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
||||
const void *plainbuf, size_t plainlen,
|
||||
|
|
@ -1120,7 +1120,7 @@ static void cr_set_negotiated_alpn(struct Curl_cfilter *cf,
|
|||
|
||||
/* Given an established network connection, do a TLS handshake.
|
||||
*
|
||||
* This function will set `*done` to true once the handshake is complete.
|
||||
* This function sets `*done` to true once the handshake is complete.
|
||||
* This function never reads the value of `*done*`.
|
||||
*/
|
||||
static CURLcode cr_connect(struct Curl_cfilter *cf, struct Curl_easy *data,
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ static CURLcode acquire_sspi_handle(struct Curl_cfilter *cf,
|
|||
}
|
||||
else {
|
||||
/* Pre-Windows 10 1809 or the user set a legacy algorithm list.
|
||||
Schannel will not negotiate TLS 1.3 when SCHANNEL_CRED is used. */
|
||||
Schannel does not negotiate TLS 1.3 when SCHANNEL_CRED is used. */
|
||||
ALG_ID algIds[NUM_CIPHERS];
|
||||
char *ciphers = conn_config->cipher_list;
|
||||
SCHANNEL_CRED schannel_cred = { 0 };
|
||||
|
|
@ -914,18 +914,18 @@ static CURLcode schannel_connect_step1(struct Curl_cfilter *cf,
|
|||
unsigned short *list_len = NULL;
|
||||
struct alpn_proto_buf proto;
|
||||
|
||||
/* The first four bytes will be an unsigned int indicating number
|
||||
/* The first four bytes is an unsigned int indicating number
|
||||
of bytes of data in the rest of the buffer. */
|
||||
extension_len = (unsigned int *)(void *)(&alpn_buffer[cur]);
|
||||
cur += (int)sizeof(unsigned int);
|
||||
|
||||
/* The next four bytes are an indicator that this buffer will contain
|
||||
/* The next four bytes are an indicator that this buffer contains
|
||||
ALPN data, as opposed to NPN, for example. */
|
||||
*(unsigned int *)(void *)&alpn_buffer[cur] =
|
||||
SecApplicationProtocolNegotiationExt_ALPN;
|
||||
cur += (int)sizeof(unsigned int);
|
||||
|
||||
/* The next two bytes will be an unsigned short indicating the number
|
||||
/* The next two bytes is an unsigned short indicating the number
|
||||
of bytes used to list the preferred protocols. */
|
||||
list_len = (unsigned short *)(void *)(&alpn_buffer[cur]);
|
||||
cur += (int)sizeof(unsigned short);
|
||||
|
|
@ -1394,7 +1394,7 @@ static CURLcode schannel_connect_step2(struct Curl_cfilter *cf,
|
|||
case SEC_I_INCOMPLETE_CREDENTIALS:
|
||||
if(!(backend->req_flags & ISC_REQ_USE_SUPPLIED_CREDS)) {
|
||||
/* If the server has requested a client certificate, attempt to
|
||||
continue the handshake without one. This will allow connections to
|
||||
continue the handshake without one. This allows connections to
|
||||
servers which request a client certificate but do not require
|
||||
it. */
|
||||
backend->req_flags |= ISC_REQ_USE_SUPPLIED_CREDS;
|
||||
|
|
@ -1475,7 +1475,7 @@ static CURLcode schannel_connect_step2(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
/* Verify the hostname manually when certificate verification is disabled,
|
||||
because in that case Schannel will not verify it. */
|
||||
because in that case Schannel does not verify it. */
|
||||
if(!conn_config->verifypeer && conn_config->verifyhost)
|
||||
return Curl_verify_host(cf, data);
|
||||
|
||||
|
|
@ -2028,7 +2028,7 @@ static CURLcode schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
sent. The unwritten encrypted bytes would be the first bytes to
|
||||
send on the next invocation.
|
||||
Here's the catch with this - if we tell the client that all the
|
||||
bytes have been sent, will the client call this method again to
|
||||
bytes have been sent, does the client call this method again to
|
||||
send the buffered data? Looking at who calls this function, it
|
||||
seems the answer is NO.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store,
|
|||
|
||||
/*
|
||||
* Read the CA file completely into memory before parsing it. This
|
||||
* optimizes for the common case where the CA file will be relatively
|
||||
* optimizes for the common case where the CA file is relatively
|
||||
* small ( < 1 MiB ).
|
||||
*/
|
||||
ca_file_handle = curlx_CreateFile(ca_file,
|
||||
|
|
@ -366,7 +366,7 @@ static DWORD cert_get_name_string(struct Curl_easy *data,
|
|||
#ifndef CERT_NAME_SEARCH_ALL_NAMES_FLAG
|
||||
#define CERT_NAME_SEARCH_ALL_NAMES_FLAG 0x2
|
||||
#endif
|
||||
/* CertGetNameString will provide the 8-bit character string without
|
||||
/* CertGetNameString provides the 8-bit character string without
|
||||
* any decoding */
|
||||
DWORD name_flags =
|
||||
CERT_NAME_DISABLE_IE4_UTF8_FLAG | CERT_NAME_SEARCH_ALL_NAMES_FLAG;
|
||||
|
|
@ -572,7 +572,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/* CertGetNameString guarantees that the returned name will not contain
|
||||
/* CertGetNameString guarantees that the returned name does not contain
|
||||
* embedded null bytes. This appears to be undocumented behavior.
|
||||
*/
|
||||
cert_hostname_buff = (LPTSTR)curlx_malloc(len * sizeof(TCHAR));
|
||||
|
|
@ -763,7 +763,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
|
|||
else
|
||||
engine_config.cbSize = sizeof(struct cert_chain_engine_config_win7);
|
||||
|
||||
/* CertCreateCertificateChainEngine will check the expected size of the
|
||||
/* CertCreateCertificateChainEngine checks the expected size of the
|
||||
* CERT_CHAIN_ENGINE_CONFIG structure and fail if the specified size
|
||||
* does not match the expected size. When this occurs, it indicates that
|
||||
* CAINFO is not supported on the version of Windows in use.
|
||||
|
|
|
|||
|
|
@ -869,7 +869,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
/*
|
||||
* Otherwise we will assume it is PEM and try to decode it after placing
|
||||
* Otherwise we assume it is PEM and try to decode it after placing
|
||||
* null-terminator
|
||||
*/
|
||||
pem_read = pubkey_pem_to_der(curlx_dyn_ptr(&buf), &pem_ptr, &pem_len);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ bool Curl_ssl_conn_config_match(struct Curl_easy *data,
|
|||
bool proxy);
|
||||
|
||||
/* Update certain connection SSL config flags after they have
|
||||
* been changed on the easy handle. Will work for `verifypeer`,
|
||||
* been changed on the easy handle. Works for `verifypeer`,
|
||||
* `verifyhost` and `verifystatus`. */
|
||||
void Curl_ssl_conn_config_update(struct Curl_easy *data, bool for_proxy);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void Curl_ssl_scache_destroy(struct Curl_ssl_scache *scache);
|
|||
/* Create a key from peer and TLS configuration information that is
|
||||
* unique for how the connection filter wants to establish a TLS
|
||||
* connection to the peer.
|
||||
* If the filter is a TLS proxy filter, it will use the proxy relevant
|
||||
* If the filter is a TLS proxy filter, it uses the proxy relevant
|
||||
* information.
|
||||
* @param cf the connection filter wanting to use it
|
||||
* @param peer the peer the filter wants to talk to
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@
|
|||
* Availability note:
|
||||
* The TLS 1.3 secret callback (wolfSSL_set_tls13_secret_cb) was added in
|
||||
* wolfSSL 4.4.0, but requires the -DHAVE_SECRET_CALLBACK build option. If that
|
||||
* option is not set, then TLS 1.3 will not be logged.
|
||||
* option is not set, then TLS 1.3 is not logged.
|
||||
* For TLS 1.2 and before, we use wolfSSL_get_keys().
|
||||
* wolfSSL_get_client_random and wolfSSL_get_keys require OPENSSL_EXTRA
|
||||
* (--enable-opensslextra or --enable-all).
|
||||
|
|
@ -1733,7 +1733,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
}
|
||||
else if(DOMAIN_NAME_MISMATCH == detail) {
|
||||
/* There is no easy way to override only the CN matching.
|
||||
* This will enable the override of both mismatching SubjectAltNames
|
||||
* This enables the override of both mismatching SubjectAltNames
|
||||
* as also mismatching CN fields */
|
||||
failf(data, " subject alt name(s) or common name do not match \"%s\"",
|
||||
connssl->peer.dispname);
|
||||
|
|
@ -2145,8 +2145,8 @@ static CURLcode wssl_connect(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
if(ssl_connect_3 == connssl->connecting_state) {
|
||||
/* Once the handshake has errored, it stays in that state and will
|
||||
* error again on every call. */
|
||||
/* Once the handshake has errored, it stays in that state and
|
||||
* errors again on every call. */
|
||||
if(wssl->hs_result) {
|
||||
result = wssl->hs_result;
|
||||
goto out;
|
||||
|
|
|
|||
2
lib/ws.c
2
lib/ws.c
|
|
@ -1426,7 +1426,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data,
|
|||
k->keepon |= KEEP_SEND;
|
||||
}
|
||||
|
||||
/* And pass any additional data to the writers */
|
||||
/* Then pass any additional data to the writers */
|
||||
if(nread) {
|
||||
result = Curl_client_write(data, CLIENTWRITE_BODY, mem, nread);
|
||||
if(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue