mirror of
https://github.com/curl/curl.git
synced 2026-08-26 02:43:31 +03:00
code: language cleanup in comments
Based on the standards and guidelines we use for our documentation. - expand contractions (they're => they are etc) - host name = > hostname - file name => filename - user name = username - man page => manpage - run-time => runtime - set-up => setup - back-end => backend - a HTTP => an HTTP - Two spaces after a period => one space after period Closes #14073
This commit is contained in:
parent
9b683577e1
commit
c074ba64a8
213 changed files with 1719 additions and 1715 deletions
|
|
@ -940,7 +940,7 @@ static CURLcode bearssl_connect_common(struct Curl_cfilter *cf,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(connssl->io_need) {
|
||||
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
* Source file for all GnuTLS-specific code for the TLS/SSL layer. No code
|
||||
* but vtls.c should ever call or use these functions.
|
||||
*
|
||||
* Note: don't use the GnuTLS' *_t variable type names in this source code,
|
||||
* Note: do not use the GnuTLS' *_t variable type names in this source code,
|
||||
* since they were not present in 1.0.X.
|
||||
*/
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ static CURLcode handshake(struct Curl_cfilter *cf,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(connssl->io_need) {
|
||||
int what;
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
@ -394,7 +394,7 @@ set_ssl_version_min_max(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
if(!tls13support) {
|
||||
/* If the running GnuTLS doesn't support TLS 1.3, we must not specify a
|
||||
/* If the running GnuTLS does not support TLS 1.3, we must not specify a
|
||||
prioritylist involving that since it will make GnuTLS return an en
|
||||
error back at us */
|
||||
if((ssl_version_max == CURL_SSLVERSION_MAX_TLSv1_3) ||
|
||||
|
|
@ -884,7 +884,7 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
|
|||
tls13support = gnutls_check_version("3.6.5");
|
||||
|
||||
/* Ensure +SRP comes at the *end* of all relevant strings so that it can be
|
||||
* removed if a run-time error indicates that SRP is not supported by this
|
||||
* removed if a runtime error indicates that SRP is not supported by this
|
||||
* GnuTLS version */
|
||||
|
||||
if(config->version == CURL_SSLVERSION_SSLv2 ||
|
||||
|
|
@ -1158,7 +1158,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data,
|
|||
/* Result is returned to caller */
|
||||
CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
|
||||
|
||||
/* if a path wasn't specified, don't pin */
|
||||
/* if a path was not specified, do not pin */
|
||||
if(!pinnedpubkey)
|
||||
return CURLE_OK;
|
||||
|
||||
|
|
@ -1266,7 +1266,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
|
|||
}
|
||||
#endif
|
||||
}
|
||||
infof(data, " common name: WARNING couldn't obtain");
|
||||
infof(data, " common name: WARNING could not obtain");
|
||||
}
|
||||
|
||||
if(data->set.ssl.certinfo && chainp) {
|
||||
|
|
@ -1474,7 +1474,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
|
|||
peer->sni ? peer->sni :
|
||||
peer->hostname);
|
||||
#if GNUTLS_VERSION_NUMBER < 0x030306
|
||||
/* Before 3.3.6, gnutls_x509_crt_check_hostname() didn't check IP
|
||||
/* Before 3.3.6, gnutls_x509_crt_check_hostname() did not check IP
|
||||
addresses. */
|
||||
if(!rc) {
|
||||
#ifdef USE_IPV6
|
||||
|
|
@ -1500,7 +1500,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
|
|||
size_t certaddrlen = sizeof(certaddr);
|
||||
int ret = gnutls_x509_crt_get_subject_alt_name(x509_cert, i, certaddr,
|
||||
&certaddrlen, NULL);
|
||||
/* If this happens, it wasn't an IP address. */
|
||||
/* If this happens, it was not an IP address. */
|
||||
if(ret == GNUTLS_E_SHORT_MEMORY_BUFFER)
|
||||
continue;
|
||||
if(ret < 0)
|
||||
|
|
@ -1518,7 +1518,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
|
|||
if(!rc) {
|
||||
if(config->verifyhost) {
|
||||
failf(data, "SSL: certificate subject name (%s) does not match "
|
||||
"target host name '%s'", certname, peer->dispname);
|
||||
"target hostname '%s'", certname, peer->dispname);
|
||||
gnutls_x509_crt_deinit(x509_cert);
|
||||
return CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ static bool pmatch(const char *hostname, size_t hostlen,
|
|||
* We use the matching rule described in RFC6125, section 6.4.3.
|
||||
* https://datatracker.ietf.org/doc/html/rfc6125#section-6.4.3
|
||||
*
|
||||
* In addition: ignore trailing dots in the host names and wildcards, so that
|
||||
* In addition: ignore trailing dots in the hostnames and wildcards, so that
|
||||
* the names are used normalized. This is what the browsers do.
|
||||
*
|
||||
* Do not allow wildcard matching on IP numbers. There are apparently
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* returns TRUE if there's a match */
|
||||
/* returns TRUE if there is a match */
|
||||
bool Curl_cert_hostcheck(const char *match_pattern, size_t matchlen,
|
||||
const char *hostname, size_t hostlen);
|
||||
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
MBEDTLS_SSL_SESSION_TICKETS_DISABLED);
|
||||
#endif
|
||||
|
||||
/* Check if there's a cached ID we can/should use here! */
|
||||
/* Check if there is a cached ID we can/should use here! */
|
||||
if(ssl_config->primary.sessionid) {
|
||||
void *old_session = NULL;
|
||||
|
||||
|
|
@ -884,7 +884,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
for(i = 0; i < connssl->alpn->count; ++i) {
|
||||
backend->protocols[i] = connssl->alpn->entries[i];
|
||||
}
|
||||
/* this function doesn't clone the protocols array, which is why we need
|
||||
/* this function does not clone the protocols array, which is why we need
|
||||
to keep it around */
|
||||
if(mbedtls_ssl_conf_alpn_protocols(&backend->config,
|
||||
&backend->protocols[0])) {
|
||||
|
|
@ -1209,7 +1209,7 @@ mbed_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
||||
/* If there's already a matching session in the cache, delete it */
|
||||
/* If there is already a matching session in the cache, delete it */
|
||||
Curl_ssl_sessionid_lock(data);
|
||||
if(!Curl_ssl_getsessionid(cf, data, &connssl->peer,
|
||||
&old_ssl_sessionid, NULL))
|
||||
|
|
@ -1488,7 +1488,7 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
}
|
||||
|
||||
if(ssl_connect_1 == connssl->connecting_state) {
|
||||
/* Find out how much more time we're allowed */
|
||||
/* Find out how much more time we are allowed */
|
||||
timeout_ms = Curl_timeleft(data, NULL, TRUE);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
|
|
@ -1512,7 +1512,7 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(connssl->io_need) {
|
||||
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ typedef int numcert_t;
|
|||
*/
|
||||
#define DEFAULT_CIPHER_SELECTION NULL
|
||||
#else
|
||||
/* ... but it is not the case with old versions of OpenSSL */
|
||||
/* not the case with old versions of OpenSSL */
|
||||
#define DEFAULT_CIPHER_SELECTION \
|
||||
"ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH"
|
||||
#endif
|
||||
|
|
@ -842,7 +842,7 @@ static void ossl_keylog_callback(const SSL *ssl, const char *line)
|
|||
#else
|
||||
/*
|
||||
* ossl_log_tls12_secret is called by libcurl to make the CLIENT_RANDOMs if the
|
||||
* OpenSSL being used doesn't have native support for doing that.
|
||||
* OpenSSL being used does not have native support for doing that.
|
||||
*/
|
||||
static void
|
||||
ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done)
|
||||
|
|
@ -1030,7 +1030,7 @@ static CURLcode ossl_seed(struct Curl_easy *data)
|
|||
fname[0] = 0; /* blank it first */
|
||||
RAND_file_name(fname, sizeof(fname));
|
||||
if(fname[0]) {
|
||||
/* we got a file name to try */
|
||||
/* we got a filename to try */
|
||||
RAND_load_file(fname, RAND_LOAD_LENGTH);
|
||||
if(rand_enough())
|
||||
return CURLE_OK;
|
||||
|
|
@ -1366,7 +1366,7 @@ int cert_stuff(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
if(!params.cert) {
|
||||
failf(data, "ssl engine didn't initialized the certificate "
|
||||
failf(data, "ssl engine did not initialized the certificate "
|
||||
"properly.");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1377,10 +1377,10 @@ int cert_stuff(struct Curl_easy *data,
|
|||
sizeof(error_buffer)));
|
||||
return 0;
|
||||
}
|
||||
X509_free(params.cert); /* we don't need the handle any more... */
|
||||
X509_free(params.cert); /* we do not need the handle any more... */
|
||||
}
|
||||
else {
|
||||
failf(data, "crypto engine not set, can't load certificate");
|
||||
failf(data, "crypto engine not set, cannot load certificate");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1476,7 +1476,7 @@ int cert_stuff(struct Curl_easy *data,
|
|||
* Note that sk_X509_pop() is used below to make sure the cert is
|
||||
* removed from the stack properly before getting passed to
|
||||
* SSL_CTX_add_extra_chain_cert(), which takes ownership. Previously
|
||||
* we used sk_X509_value() instead, but then we'd clean it in the
|
||||
* we used sk_X509_value() instead, but then we would clean it in the
|
||||
* subsequent sk_X509_pop_free() call.
|
||||
*/
|
||||
X509 *x = sk_X509_pop(ca);
|
||||
|
|
@ -1569,10 +1569,10 @@ fail:
|
|||
EVP_PKEY_free(priv_key);
|
||||
return 0;
|
||||
}
|
||||
EVP_PKEY_free(priv_key); /* we don't need the handle any more... */
|
||||
EVP_PKEY_free(priv_key); /* we do not need the handle any more... */
|
||||
}
|
||||
else {
|
||||
failf(data, "crypto engine not set, can't load private key");
|
||||
failf(data, "crypto engine not set, cannot load private key");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1611,8 +1611,8 @@ fail:
|
|||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_IS_BORINGSSL) && \
|
||||
!defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||
{
|
||||
/* If RSA is used, don't check the private key if its flags indicate
|
||||
* it doesn't support it. */
|
||||
/* If RSA is used, do not check the private key if its flags indicate
|
||||
* it does not support it. */
|
||||
EVP_PKEY *priv_key = SSL_get_privatekey(ssl);
|
||||
int pktype;
|
||||
#ifdef HAVE_OPAQUE_EVP_PKEY
|
||||
|
|
@ -1678,7 +1678,7 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size)
|
|||
if((size_t)biomem->length < size)
|
||||
size = biomem->length;
|
||||
else
|
||||
size--; /* don't overwrite the buffer end */
|
||||
size--; /* do not overwrite the buffer end */
|
||||
|
||||
memcpy(buf, biomem->data, size);
|
||||
buf[size] = 0;
|
||||
|
|
@ -2034,7 +2034,7 @@ static void ossl_close_all(struct Curl_easy *data)
|
|||
/* ====================================================== */
|
||||
|
||||
/*
|
||||
* Match subjectAltName against the host name.
|
||||
* Match subjectAltName against the hostname.
|
||||
*/
|
||||
static bool subj_alt_hostcheck(struct Curl_easy *data,
|
||||
const char *match_pattern,
|
||||
|
|
@ -2064,7 +2064,7 @@ static bool subj_alt_hostcheck(struct Curl_easy *data,
|
|||
Certification Authorities are encouraged to use the dNSName instead.
|
||||
|
||||
Matching is performed using the matching rules specified by
|
||||
[RFC2459]. If more than one identity of a given type is present in
|
||||
[RFC2459]. If more than one identity of a given type is present in
|
||||
the certificate (e.g., more than one dNSName name, a match in any one
|
||||
of the set is considered acceptable.) Names may contain the wildcard
|
||||
character * which is considered to match any single domain name
|
||||
|
|
@ -2135,7 +2135,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
|
|||
bool ipmatched = FALSE;
|
||||
|
||||
/* get amount of alternatives, RFC2459 claims there MUST be at least
|
||||
one, but we don't depend on it... */
|
||||
one, but we do not depend on it... */
|
||||
numalts = sk_GENERAL_NAME_num(altnames);
|
||||
|
||||
/* loop through all alternatives - until a dnsmatch */
|
||||
|
|
@ -2156,7 +2156,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
|
|||
|
||||
switch(target) {
|
||||
case GEN_DNS: /* name/pattern comparison */
|
||||
/* The OpenSSL man page explicitly says: "In general it cannot be
|
||||
/* The OpenSSL manpage 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
|
||||
|
|
@ -2166,7 +2166,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
|
|||
is always null-terminated.
|
||||
*/
|
||||
if((altlen == strlen(altptr)) &&
|
||||
/* if this isn't true, there was an embedded zero in the name
|
||||
/* if this is not true, there was an embedded zero in the name
|
||||
string and we cannot match it. */
|
||||
subj_alt_hostcheck(data, altptr, altlen,
|
||||
peer->hostname, hostlen,
|
||||
|
|
@ -2198,7 +2198,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
|
|||
/* an alternative name matched */
|
||||
;
|
||||
else if(dNSName || iPAddress) {
|
||||
const char *tname = (peer->type == CURL_SSL_PEER_DNS) ? "host name" :
|
||||
const char *tname = (peer->type == CURL_SSL_PEER_DNS) ? "hostname" :
|
||||
(peer->type == CURL_SSL_PEER_IPV4) ?
|
||||
"ipv4 address" : "ipv6 address";
|
||||
infof(data, " subjectAltName does not match %s %s", tname, peer->dispname);
|
||||
|
|
@ -2269,7 +2269,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
|
|||
else if(!Curl_cert_hostcheck((const char *)peer_CN,
|
||||
peerlen, peer->hostname, hostlen)) {
|
||||
failf(data, "SSL: certificate subject name '%s' does not match "
|
||||
"target host name '%s'", peer_CN, peer->dispname);
|
||||
"target hostname '%s'", peer_CN, peer->dispname);
|
||||
result = CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
else {
|
||||
|
|
@ -2352,8 +2352,8 @@ static CURLcode verifystatus(struct Curl_cfilter *cf,
|
|||
(defined(LIBRESSL_VERSION_NUMBER) && \
|
||||
LIBRESSL_VERSION_NUMBER <= 0x2040200fL))
|
||||
/* The authorized responder cert in the OCSP response MUST be signed by the
|
||||
peer cert's issuer (see RFC6960 section 4.2.2.2). If that's a root cert,
|
||||
no problem, but if it's an intermediate cert OpenSSL has a bug where it
|
||||
peer cert's issuer (see RFC6960 section 4.2.2.2). If that is a root cert,
|
||||
no problem, but if it is an intermediate cert OpenSSL has a bug where it
|
||||
expects this issuer to be present in the chain embedded in the OCSP
|
||||
response. So we add it if necessary. */
|
||||
|
||||
|
|
@ -2452,7 +2452,7 @@ end:
|
|||
|
||||
#endif /* USE_OPENSSL */
|
||||
|
||||
/* The SSL_CTRL_SET_MSG_CALLBACK doesn't exist in ancient OpenSSL versions
|
||||
/* The SSL_CTRL_SET_MSG_CALLBACK does not exist in ancient OpenSSL versions
|
||||
and thus this cannot be done there. */
|
||||
#ifdef SSL_CTRL_SET_MSG_CALLBACK
|
||||
|
||||
|
|
@ -2637,7 +2637,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type,
|
|||
|
||||
ssl_ver >>= 8; /* check the upper 8 bits only below */
|
||||
|
||||
/* SSLv2 doesn't seem to have TLS record-type headers, so OpenSSL
|
||||
/* SSLv2 does not seem to have TLS record-type headers, so OpenSSL
|
||||
* always pass-up content-type as 0. But the interesting message-type
|
||||
* is at 'buf[0]'.
|
||||
*/
|
||||
|
|
@ -2724,7 +2724,7 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx)
|
|||
}
|
||||
|
||||
/* CURL_SSLVERSION_DEFAULT means that no option was selected.
|
||||
We don't want to pass 0 to SSL_CTX_set_min_proto_version as
|
||||
We do not want to pass 0 to SSL_CTX_set_min_proto_version as
|
||||
it would enable all versions down to the lowest supported by
|
||||
the library.
|
||||
So we skip this, and stay with the library default
|
||||
|
|
@ -2794,7 +2794,7 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options,
|
|||
long ssl_version = conn_config->version;
|
||||
long ssl_version_max = conn_config->version_max;
|
||||
|
||||
(void) data; /* In case it's unused. */
|
||||
(void) data; /* In case it is unused. */
|
||||
|
||||
switch(ssl_version) {
|
||||
case CURL_SSLVERSION_TLSv1_3:
|
||||
|
|
@ -2973,7 +2973,7 @@ static CURLcode load_cacert_from_memory(X509_STORE *store,
|
|||
sk_X509_INFO_pop_free(inf, X509_INFO_free);
|
||||
BIO_free(cbio);
|
||||
|
||||
/* if we didn't end up importing anything, treat that as an error */
|
||||
/* if we did not end up importing anything, treat that as an error */
|
||||
return (count > 0) ? CURLE_OK : CURLE_SSL_CACERT_BADFILE;
|
||||
}
|
||||
|
||||
|
|
@ -3232,7 +3232,7 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf,
|
|||
#ifdef CURL_CA_FALLBACK
|
||||
if(!ssl_cafile && !ssl_capath &&
|
||||
!imported_native_ca && !imported_ca_info_blob) {
|
||||
/* verifying the peer without any CA certificates won't
|
||||
/* verifying the peer without any CA certificates will not
|
||||
work so use openssl's built-in default as fallback */
|
||||
X509_STORE_set_default_paths(store);
|
||||
}
|
||||
|
|
@ -3258,7 +3258,7 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf,
|
|||
|
||||
if(verifypeer) {
|
||||
/* Try building a chain using issuers in the trusted store first to avoid
|
||||
problems with server-sent legacy intermediates. Newer versions of
|
||||
problems with server-sent legacy intermediates. Newer versions of
|
||||
OpenSSL do alternate chain checking by default but we do not know how to
|
||||
determine that in a reliable manner.
|
||||
https://rt.openssl.org/Ticket/Display.html?id=3621&user=guest&pass=guest
|
||||
|
|
@ -3486,7 +3486,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
|
||||
switch(transport) {
|
||||
case TRNSPRT_TCP:
|
||||
/* check to see if we've been told to use an explicit SSL/TLS version */
|
||||
/* check to see if we have been told to use an explicit SSL/TLS version */
|
||||
switch(ssl_version_min) {
|
||||
case CURL_SSLVERSION_DEFAULT:
|
||||
case CURL_SSLVERSION_TLSv1:
|
||||
|
|
@ -3537,7 +3537,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
octx->ssl_ctx = SSL_CTX_new(req_method);
|
||||
|
||||
if(!octx->ssl_ctx) {
|
||||
failf(data, "SSL: couldn't create a context: %s",
|
||||
failf(data, "SSL: could not create a context: %s",
|
||||
ossl_strerror(ERR_peek_error(), error_buffer, sizeof(error_buffer)));
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
|
@ -3558,12 +3558,12 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
|
||||
/* OpenSSL contains code to work around lots of bugs and flaws in various
|
||||
SSL-implementations. SSL_CTX_set_options() is used to enabled those
|
||||
work-arounds. The man page for this option states that SSL_OP_ALL enables
|
||||
work-arounds. The manpage for this option states that SSL_OP_ALL enables
|
||||
all the work-arounds and that "It is usually safe to use SSL_OP_ALL to
|
||||
enable the bug workaround options if compatibility with somewhat broken
|
||||
implementations is desired."
|
||||
|
||||
The "-no_ticket" option was introduced in OpenSSL 0.9.8j. It's a flag to
|
||||
The "-no_ticket" option was introduced in OpenSSL 0.9.8j. it is a flag to
|
||||
disable "rfc4507bis session ticket support". rfc4507bis was later turned
|
||||
into the proper RFC5077: https://datatracker.ietf.org/doc/html/rfc5077
|
||||
|
||||
|
|
@ -3716,7 +3716,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
infof(data, "Using TLS-SRP username: %s", ssl_username);
|
||||
|
||||
if(!SSL_CTX_set_srp_username(octx->ssl_ctx, ssl_username)) {
|
||||
failf(data, "Unable to set SRP user name");
|
||||
failf(data, "Unable to set SRP username");
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
if(!SSL_CTX_set_srp_password(octx->ssl_ctx, ssl_password)) {
|
||||
|
|
@ -3749,7 +3749,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
#endif
|
||||
|
||||
if(cb_new_session) {
|
||||
/* Enable the session cache because it's a prerequisite for the
|
||||
/* Enable the session cache because it is a prerequisite for the
|
||||
* "new session" callback. Use the "external storage" mode to prevent
|
||||
* OpenSSL from creating an internal session cache.
|
||||
*/
|
||||
|
|
@ -3785,7 +3785,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
SSL_free(octx->ssl);
|
||||
octx->ssl = SSL_new(octx->ssl_ctx);
|
||||
if(!octx->ssl) {
|
||||
failf(data, "SSL: couldn't create a context (handle)");
|
||||
failf(data, "SSL: could not create a context (handle)");
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
|
@ -3840,7 +3840,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
ech_config_len = 2 * strlen(b64);
|
||||
result = Curl_base64_decode(b64, &ech_config, &ech_config_len);
|
||||
if(result || !ech_config) {
|
||||
infof(data, "ECH: can't base64 decode ECHConfig from command line");
|
||||
infof(data, "ECH: cannot base64 decode ECHConfig from command line");
|
||||
if(data->set.tls_ech & CURLECH_HARD)
|
||||
return result;
|
||||
}
|
||||
|
|
@ -3936,7 +3936,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
|
|||
# endif /* not BORING */
|
||||
if(trying_ech_now
|
||||
&& SSL_set_min_proto_version(octx->ssl, TLS1_3_VERSION) != 1) {
|
||||
infof(data, "ECH: Can't force TLSv1.3 [ERROR]");
|
||||
infof(data, "ECH: cannot force TLSv1.3 [ERROR]");
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
@ -4159,7 +4159,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
|
|||
int lib;
|
||||
int reason;
|
||||
|
||||
/* the connection failed, we're not waiting for anything else. */
|
||||
/* the connection failed, we are not waiting for anything else. */
|
||||
connssl->connecting_state = ssl_connect_2;
|
||||
|
||||
/* Get the earliest error code from the thread's error queue and remove
|
||||
|
|
@ -4220,7 +4220,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
|
|||
|
||||
/* detail is already set to the SSL error above */
|
||||
|
||||
/* If we e.g. use SSLv2 request-method and the server doesn't like us
|
||||
/* If we e.g. use SSLv2 request-method and the server does not like us
|
||||
* (RST connection, etc.), OpenSSL gives no explanation whatsoever and
|
||||
* the SO_ERROR is also lost.
|
||||
*/
|
||||
|
|
@ -4246,7 +4246,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
|
|||
int psigtype_nid = NID_undef;
|
||||
const char *negotiated_group_name = NULL;
|
||||
|
||||
/* we connected fine, we're not waiting for anything else. */
|
||||
/* we connected fine, we are not waiting for anything else. */
|
||||
connssl->connecting_state = ssl_connect_3;
|
||||
|
||||
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
|
||||
|
|
@ -4359,7 +4359,7 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert,
|
|||
/* Result is returned to caller */
|
||||
CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
|
||||
|
||||
/* if a path wasn't specified, don't pin */
|
||||
/* if a path was not specified, do not pin */
|
||||
if(!pinnedpubkey)
|
||||
return CURLE_OK;
|
||||
|
||||
|
|
@ -4385,7 +4385,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's pretty weak since they should always be the
|
||||
* sized the buffer. it is pretty weak since they should always be the
|
||||
* same. But it gives us something to test.
|
||||
*/
|
||||
if((len1 != len2) || !temp || ((temp - buff1) != len1))
|
||||
|
|
@ -4512,7 +4512,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
|
|||
if(!strict)
|
||||
return CURLE_OK;
|
||||
|
||||
failf(data, "SSL: couldn't get peer certificate");
|
||||
failf(data, "SSL: could not get peer certificate");
|
||||
return CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
|
||||
|
|
@ -4553,7 +4553,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
|
|||
buffer, sizeof(buffer));
|
||||
if(rc) {
|
||||
if(strict)
|
||||
failf(data, "SSL: couldn't get X509-issuer name");
|
||||
failf(data, "SSL: could not get X509-issuer name");
|
||||
result = CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
else {
|
||||
|
|
@ -4656,7 +4656,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
|
|||
#if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_TLSEXT) && \
|
||||
!defined(OPENSSL_NO_OCSP)
|
||||
if(conn_config->verifystatus && !octx->reused_session) {
|
||||
/* don't do this after Session ID reuse */
|
||||
/* do not do this after Session ID reuse */
|
||||
result = verifystatus(cf, data, octx);
|
||||
if(result) {
|
||||
/* when verifystatus failed, remove the session id from the cache again
|
||||
|
|
@ -4682,7 +4682,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
|
|||
#endif
|
||||
|
||||
if(!strict)
|
||||
/* when not strict, we don't bother about the verify cert problems */
|
||||
/* when not strict, we do not bother about the verify cert problems */
|
||||
result = CURLE_OK;
|
||||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
|
|
@ -4715,7 +4715,7 @@ static CURLcode ossl_connect_step3(struct Curl_cfilter *cf,
|
|||
|
||||
/*
|
||||
* We check certificates to authenticate the server; otherwise we risk
|
||||
* man-in-the-middle attack; NEVERTHELESS, if we're told explicitly not to
|
||||
* man-in-the-middle attack; NEVERTHELESS, if we are told explicitly not to
|
||||
* verify the peer, ignore faults and failures from the server cert
|
||||
* operations.
|
||||
*/
|
||||
|
|
@ -4744,7 +4744,7 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
if(ssl_connect_1 == connssl->connecting_state) {
|
||||
/* Find out how much more time we're allowed */
|
||||
/* Find out how much more time we are allowed */
|
||||
const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
|
|
@ -4770,7 +4770,7 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(!nonblocking && connssl->io_need) {
|
||||
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
@ -4985,7 +4985,7 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf,
|
|||
break;
|
||||
case SSL_ERROR_WANT_READ:
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
/* there's data pending, re-invoke SSL_read() */
|
||||
/* there is data pending, re-invoke SSL_read() */
|
||||
*curlcode = CURLE_AGAIN;
|
||||
nread = -1;
|
||||
goto out;
|
||||
|
|
@ -5019,7 +5019,7 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf,
|
|||
/* For debug builds be a little stricter and error on any
|
||||
SSL_ERROR_SYSCALL. For example a server may have closed the connection
|
||||
abruptly without a close_notify alert. For compatibility with older
|
||||
peers we don't do this by default. #4624
|
||||
peers we do not do this by default. #4624
|
||||
|
||||
We can use this to gauge how many users may be affected, and
|
||||
if it goes ok eventually transition to allow in dev and release with
|
||||
|
|
@ -5135,7 +5135,7 @@ static CURLcode ossl_random(struct Curl_easy *data,
|
|||
int rc;
|
||||
if(data) {
|
||||
if(ossl_seed(data)) /* Initiate the seed if not already done */
|
||||
return CURLE_FAILED_INIT; /* couldn't seed for some reason */
|
||||
return CURLE_FAILED_INIT; /* could not seed for some reason */
|
||||
}
|
||||
else {
|
||||
if(!rand_enough())
|
||||
|
|
|
|||
|
|
@ -179,10 +179,10 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf,
|
|||
* - Read out as many plaintext bytes from rustls as possible, until hitting
|
||||
* error, EOF, or EAGAIN/EWOULDBLOCK, or plainbuf/plainlen is filled up.
|
||||
*
|
||||
* It's okay to call this function with plainbuf == NULL and plainlen == 0.
|
||||
* In that case, it will copy bytes from the socket into rustls' TLS input
|
||||
* buffer, and process packets, but won't consume bytes from rustls' plaintext
|
||||
* output buffer.
|
||||
* it is okay to call this function with plainbuf == NULL and plainlen == 0. In
|
||||
* that case, it will copy bytes from the socket into rustls' TLS input
|
||||
* buffer, and process packets, but will not consume bytes from rustls'
|
||||
* plaintext output buffer.
|
||||
*/
|
||||
static ssize_t
|
||||
cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
|
||||
|
|
@ -227,7 +227,7 @@ cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
goto out;
|
||||
}
|
||||
else if(rresult != RUSTLS_RESULT_OK) {
|
||||
/* n always equals 0 in this case, don't need to check it */
|
||||
/* n always equals 0 in this case, do not need to check it */
|
||||
char errorbuf[255];
|
||||
size_t errorlen;
|
||||
rustls_error(rresult, errorbuf, sizeof(errorbuf), &errorlen);
|
||||
|
|
@ -309,8 +309,8 @@ static CURLcode cr_flush_out(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
* - Fully drain rustls' plaintext output buffer into the socket until
|
||||
* we get either an error or EAGAIN/EWOULDBLOCK.
|
||||
*
|
||||
* It's okay to call this function with plainbuf == NULL and plainlen == 0.
|
||||
* In that case, it won't read anything into rustls' plaintext input buffer.
|
||||
* 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.
|
||||
*/
|
||||
static ssize_t
|
||||
|
|
@ -462,7 +462,7 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
if(!verifypeer) {
|
||||
rustls_client_config_builder_dangerous_set_certificate_verifier(
|
||||
config_builder, cr_verify_none);
|
||||
/* rustls doesn't support IP addresses (as of 0.19.0), and will reject
|
||||
/* rustls does not support IP addresses (as of 0.19.0), and will reject
|
||||
* connections created with an IP address, even when certificate
|
||||
* verification is turned off. Set a placeholder hostname and disable
|
||||
* SNI. */
|
||||
|
|
@ -475,7 +475,7 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
roots_builder = rustls_root_cert_store_builder_new();
|
||||
|
||||
if(ca_info_blob) {
|
||||
/* Enable strict parsing only if verification isn't disabled. */
|
||||
/* Enable strict parsing only if verification is not disabled. */
|
||||
result = rustls_root_cert_store_builder_add_pem(roots_builder,
|
||||
ca_info_blob->data,
|
||||
ca_info_blob->len,
|
||||
|
|
@ -489,7 +489,7 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
}
|
||||
}
|
||||
else if(ssl_cafile) {
|
||||
/* Enable strict parsing only if verification isn't disabled. */
|
||||
/* Enable strict parsing only if verification is not disabled. */
|
||||
result = rustls_root_cert_store_builder_load_roots_from_file(
|
||||
roots_builder, ssl_cafile, verifypeer);
|
||||
if(result != RUSTLS_RESULT_OK) {
|
||||
|
|
@ -700,7 +700,7 @@ cr_connect_common(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
/* We should never fall through the loop. We should return either because
|
||||
the handshake is done or because we can't read/write without blocking. */
|
||||
the handshake is done or because we cannot read/write without blocking. */
|
||||
DEBUGASSERT(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#ifdef USE_SCHANNEL
|
||||
|
||||
#ifndef USE_WINDOWS_SSPI
|
||||
# error "Can't compile SCHANNEL support without SSPI."
|
||||
# error "cannot compile SCHANNEL support without SSPI."
|
||||
#endif
|
||||
|
||||
#include "schannel.h"
|
||||
|
|
@ -976,7 +976,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
|
|||
}
|
||||
else {
|
||||
/* Pre-Windows 10 1809 or the user set a legacy algorithm list. Although MS
|
||||
doesn't document it, currently Schannel will not negotiate TLS 1.3 when
|
||||
does not document it, currently Schannel will not negotiate TLS 1.3 when
|
||||
SCHANNEL_CRED is used. */
|
||||
ALG_ID algIds[NUM_CIPHERS];
|
||||
char *ciphers = conn_config->cipher_list;
|
||||
|
|
@ -1083,7 +1083,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
|
||||
#ifdef HAS_ALPN
|
||||
/* ALPN is only supported on Windows 8.1 / Server 2012 R2 and above.
|
||||
Also it doesn't seem to be supported for Wine, see curl bug #983. */
|
||||
Also it does not seem to be supported for Wine, see curl bug #983. */
|
||||
backend->use_alpn = connssl->alpn &&
|
||||
!GetProcAddress(GetModuleHandle(TEXT("ntdll")),
|
||||
"wine_get_version") &&
|
||||
|
|
@ -1095,7 +1095,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
|
||||
#ifdef _WIN32_WCE
|
||||
#ifdef HAS_MANUAL_VERIFY_API
|
||||
/* certificate validation on CE doesn't seem to work right; we'll
|
||||
/* certificate validation on CE does not seem to work right; we will
|
||||
* do it following a more manual process. */
|
||||
backend->use_manual_cred_validation = true;
|
||||
#else
|
||||
|
|
@ -1241,7 +1241,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
/* Schannel InitializeSecurityContext:
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375924.aspx
|
||||
|
||||
At the moment we don't pass inbuf unless we're using ALPN since we only
|
||||
At the moment we do not pass inbuf unless we are using ALPN since we only
|
||||
use it for that, and Wine (for which we currently disable ALPN) is giving
|
||||
us problems with inbuf regardless. https://github.com/curl/curl/issues/983
|
||||
*/
|
||||
|
|
@ -1531,7 +1531,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
inbuf[1].cbBuffer));
|
||||
/*
|
||||
There are two cases where we could be getting extra data here:
|
||||
1) If we're renegotiating a connection and the handshake is already
|
||||
1) If we are renegotiating a connection and the handshake is already
|
||||
complete (from the server perspective), it can encrypted app data
|
||||
(not handshake data) in an extra buffer at this point.
|
||||
2) (sspi_status == SEC_I_CONTINUE_NEEDED) We are negotiating a
|
||||
|
|
@ -1593,7 +1593,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
#endif
|
||||
|
||||
/* Verify the hostname manually when certificate verification is disabled,
|
||||
because in that case Schannel won't verify it. */
|
||||
because in that case Schannel will not verify it. */
|
||||
if(!conn_config->verifypeer && conn_config->verifyhost)
|
||||
return Curl_verify_host(cf, data);
|
||||
|
||||
|
|
@ -1783,7 +1783,8 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
if(old_cred != backend->cred) {
|
||||
DEBUGF(infof(data,
|
||||
"schannel: old credential handle is stale, removing"));
|
||||
/* we're not taking old_cred ownership here, no refcount++ is needed */
|
||||
/* we are not taking old_cred ownership here, no refcount++ is
|
||||
needed */
|
||||
Curl_ssl_delsessionid(data, (void *)old_cred);
|
||||
incache = FALSE;
|
||||
}
|
||||
|
|
@ -1853,7 +1854,7 @@ schannel_connect_common(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
if(ssl_connect_1 == connssl->connecting_state) {
|
||||
/* check out how much more time we're allowed */
|
||||
/* check out how much more time we are allowed */
|
||||
timeout_ms = Curl_timeleft(data, NULL, TRUE);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
|
|
@ -1869,7 +1870,7 @@ schannel_connect_common(struct Curl_cfilter *cf,
|
|||
|
||||
while(ssl_connect_2 == connssl->connecting_state) {
|
||||
|
||||
/* check out how much more time we're allowed */
|
||||
/* check out how much more time we are allowed */
|
||||
timeout_ms = Curl_timeleft(data, NULL, TRUE);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
|
|
@ -1878,7 +1879,7 @@ schannel_connect_common(struct Curl_cfilter *cf,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(connssl->io_need) {
|
||||
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
@ -2023,10 +2024,10 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
len = outbuf[0].cbBuffer + outbuf[1].cbBuffer + outbuf[2].cbBuffer;
|
||||
|
||||
/*
|
||||
It's important to send the full message which includes the header,
|
||||
encrypted payload, and trailer. Until the client receives all the
|
||||
it is important to send the full message which includes the header,
|
||||
encrypted payload, and trailer. Until the client receives all the
|
||||
data a coherent message has not been delivered and the client
|
||||
can't read any of it.
|
||||
cannot read any of it.
|
||||
|
||||
If we wanted to buffer the unwritten encrypted bytes, we would
|
||||
tell the client that all data it has requested to be sent has been
|
||||
|
|
@ -2123,8 +2124,9 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
DEBUGASSERT(backend);
|
||||
|
||||
/****************************************************************************
|
||||
* Don't return or set backend->recv_unrecoverable_err unless in the cleanup.
|
||||
* The pattern for return error is set *err, optional infof, goto cleanup.
|
||||
* Do not return or set backend->recv_unrecoverable_err unless in the
|
||||
* cleanup. The pattern for return error is set *err, optional infof, goto
|
||||
* cleanup.
|
||||
*
|
||||
* Our priority is to always return as much decrypted data to the caller as
|
||||
* possible, even if an error occurs. The state of the decrypted buffer must
|
||||
|
|
@ -2149,7 +2151,7 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
infof(data, "schannel: server indicated shutdown in a prior call");
|
||||
goto cleanup;
|
||||
}
|
||||
/* It's debatable what to return when !len. Regardless we can't return
|
||||
/* it is debatable what to return when !len. Regardless we cannot return
|
||||
immediately because there may be data to decrypt (in the case we want to
|
||||
decrypt all encrypted cached data) so handle !len later in cleanup.
|
||||
*/
|
||||
|
|
@ -2307,7 +2309,7 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
if(sspi_status == SEC_I_RENEGOTIATE) {
|
||||
infof(data, "schannel: remote party requests renegotiation");
|
||||
if(*err && *err != CURLE_AGAIN) {
|
||||
infof(data, "schannel: can't renegotiate, an error is pending");
|
||||
infof(data, "schannel: cannot renegotiate, an error is pending");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -2372,13 +2374,13 @@ cleanup:
|
|||
|
||||
/* Error if the connection has closed without a close_notify.
|
||||
|
||||
The behavior here is a matter of debate. We don't want to be vulnerable
|
||||
to a truncation attack however there's some browser precedent for
|
||||
The behavior here is a matter of debate. We do not want to be vulnerable
|
||||
to a truncation attack however there is some browser precedent for
|
||||
ignoring the close_notify for compatibility reasons.
|
||||
|
||||
Additionally, Windows 2000 (v5.0) is a special case since it seems it
|
||||
doesn't return close_notify. In that case if the connection was closed we
|
||||
assume it was graceful (close_notify) since there doesn't seem to be a
|
||||
does not return close_notify. In that case if the connection was closed we
|
||||
assume it was graceful (close_notify) since there does not seem to be a
|
||||
way to tell.
|
||||
*/
|
||||
if(len && !backend->decdata_offset && backend->recv_connection_closed &&
|
||||
|
|
@ -2415,7 +2417,7 @@ cleanup:
|
|||
if(!*err && !backend->recv_connection_closed)
|
||||
*err = CURLE_AGAIN;
|
||||
|
||||
/* It's debatable what to return when !len. We could return whatever error
|
||||
/* it is debatable what to return when !len. We could return whatever error
|
||||
we got from decryption but instead we override here so the return is
|
||||
consistent.
|
||||
*/
|
||||
|
|
@ -2687,7 +2689,7 @@ static CURLcode schannel_pkp_pin_peer_pubkey(struct Curl_cfilter *cf,
|
|||
|
||||
DEBUGASSERT(backend);
|
||||
|
||||
/* if a path wasn't specified, don't pin */
|
||||
/* if a path was not specified, do not pin */
|
||||
if(!pinnedpubkey)
|
||||
return CURLE_OK;
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ struct schannel_ssl_backend_data {
|
|||
size_t encdata_offset, decdata_offset;
|
||||
unsigned char *encdata_buffer, *decdata_buffer;
|
||||
/* encdata_is_incomplete: if encdata contains only a partial record that
|
||||
can't be decrypted without another recv() (that is, status is
|
||||
cannot be decrypted without another recv() (that is, status is
|
||||
SEC_E_INCOMPLETE_MESSAGE) then set this true. after an recv() adds
|
||||
more bytes into encdata then set this back to false. */
|
||||
bool encdata_is_incomplete;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#ifdef USE_SCHANNEL
|
||||
#ifndef USE_WINDOWS_SSPI
|
||||
# error "Can't compile SCHANNEL support without SSPI."
|
||||
# error "cannot compile SCHANNEL support without SSPI."
|
||||
#endif
|
||||
|
||||
#include "schannel.h"
|
||||
|
|
@ -82,7 +82,7 @@ static int is_cr_or_lf(char c)
|
|||
}
|
||||
|
||||
/* Search the substring needle,needlelen into string haystack,haystacklen
|
||||
* Strings don't need to be terminated by a '\0'.
|
||||
* Strings do not need to be terminated by a '\0'.
|
||||
* Similar of OSX/Linux memmem (not available on Visual Studio).
|
||||
* Return position of beginning of first occurrence or NULL if not found
|
||||
*/
|
||||
|
|
@ -335,7 +335,7 @@ cleanup:
|
|||
|
||||
/*
|
||||
* Returns the number of characters necessary to populate all the host_names.
|
||||
* If host_names is not NULL, populate it with all the host names. Each string
|
||||
* If host_names is not NULL, populate it with all the hostnames. Each string
|
||||
* in the host_names is null-terminated and the last string is double
|
||||
* null-terminated. If no DNS names are found, a single null-terminated empty
|
||||
* string is returned.
|
||||
|
|
@ -447,11 +447,11 @@ static DWORD cert_get_name_string(struct Curl_easy *data,
|
|||
}
|
||||
/* Sanity check to prevent buffer overrun. */
|
||||
if((actual_length + current_length) > length) {
|
||||
failf(data, "schannel: Not enough memory to list all host names.");
|
||||
failf(data, "schannel: Not enough memory to list all hostnames.");
|
||||
break;
|
||||
}
|
||||
dns_w = entry->pwszDNSName;
|
||||
/* pwszDNSName is in ia5 string format and hence doesn't contain any
|
||||
/* pwszDNSName is in ia5 string format and hence does not contain any
|
||||
* non-ascii characters. */
|
||||
while(*dns_w != '\0') {
|
||||
*current_pos++ = (TCHAR)(*dns_w++);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||
#error "The Secure Transport back-end requires Leopard or later."
|
||||
#error "The Secure Transport backend requires Leopard or later."
|
||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1050 */
|
||||
|
||||
#define CURL_BUILD_IOS 0
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
#define CURL_SUPPORT_MAC_10_9 0
|
||||
|
||||
#else
|
||||
#error "The Secure Transport back-end requires iOS or macOS."
|
||||
#error "The Secure Transport backend requires iOS or macOS."
|
||||
#endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */
|
||||
|
||||
#if CURL_BUILD_MAC
|
||||
|
|
@ -145,7 +145,8 @@
|
|||
#include "memdebug.h"
|
||||
|
||||
|
||||
/* From MacTypes.h (which we can't include because it isn't present in iOS: */
|
||||
/* From MacTypes.h (which we cannot include because it is not present in
|
||||
iOS: */
|
||||
#define ioErr -36
|
||||
#define paramErr -50
|
||||
|
||||
|
|
@ -241,7 +242,7 @@ static const unsigned char rsa2048SpkiHeader[] = {
|
|||
0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
|
||||
0x00, 0x03, 0x82, 0x01, 0x0f, 0x00};
|
||||
#ifdef SECTRANSP_PINNEDPUBKEY_V1
|
||||
/* the *new* version doesn't return DER encoded ecdsa certs like the old... */
|
||||
/* the *new* version does not return DER encoded ecdsa certs like the old... */
|
||||
static const unsigned char ecDsaSecp256r1SpkiHeader[] = {
|
||||
0x30, 0x59, 0x30, 0x13, 0x06, 0x07,
|
||||
0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
|
||||
|
|
@ -363,15 +364,15 @@ CF_INLINE void GetDarwinVersionNumber(int *major, int *minor)
|
|||
#endif /* CURL_BUILD_MAC */
|
||||
|
||||
/* Apple provides a myriad of ways of getting information about a certificate
|
||||
into a string. Some aren't available under iOS or newer cats. So here's
|
||||
a unified function for getting a string describing the certificate that
|
||||
ought to work in all cats starting with Leopard. */
|
||||
into a string. Some are not available under iOS or newer cats. Here's a
|
||||
unified function for getting a string describing the certificate that ought
|
||||
to work in all cats starting with Leopard. */
|
||||
CF_INLINE CFStringRef getsubject(SecCertificateRef cert)
|
||||
{
|
||||
CFStringRef server_cert_summary = CFSTR("(null)");
|
||||
|
||||
#if CURL_BUILD_IOS
|
||||
/* iOS: There's only one way to do this. */
|
||||
/* iOS: There is only one way to do this. */
|
||||
server_cert_summary = SecCertificateCopySubjectSummary(cert);
|
||||
#else
|
||||
#if CURL_BUILD_MAC_10_7
|
||||
|
|
@ -431,7 +432,7 @@ static CURLcode CopyCertSubject(struct Curl_easy *data,
|
|||
*certp = cbuf;
|
||||
}
|
||||
else {
|
||||
failf(data, "SSL: couldn't allocate %zu bytes of memory", cbuf_size);
|
||||
failf(data, "SSL: could not allocate %zu bytes of memory", cbuf_size);
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
|
@ -443,7 +444,7 @@ static CURLcode CopyCertSubject(struct Curl_easy *data,
|
|||
|
||||
#if CURL_SUPPORT_MAC_10_6
|
||||
/* The SecKeychainSearch API was deprecated in Lion, and using it will raise
|
||||
deprecation warnings, so let's not compile this unless it's necessary: */
|
||||
deprecation warnings, so let's not compile this unless it is necessary: */
|
||||
static OSStatus CopyIdentityWithLabelOldSchool(char *label,
|
||||
SecIdentityRef *out_c_a_k)
|
||||
{
|
||||
|
|
@ -514,7 +515,7 @@ static OSStatus CopyIdentityWithLabel(char *label,
|
|||
/* identity searches need a SecPolicyRef in order to work */
|
||||
values[3] = SecPolicyCreateSSL(false, NULL);
|
||||
keys[3] = kSecMatchPolicy;
|
||||
/* match the name of the certificate (doesn't work in macOS 10.12.1) */
|
||||
/* match the name of the certificate (does not work in macOS 10.12.1) */
|
||||
values[4] = label_cf;
|
||||
keys[4] = kSecAttrLabel;
|
||||
query_dict = CFDictionaryCreate(NULL, (const void **)keys,
|
||||
|
|
@ -526,7 +527,7 @@ static OSStatus CopyIdentityWithLabel(char *label,
|
|||
/* Do we have a match? */
|
||||
status = SecItemCopyMatching(query_dict, (CFTypeRef *) &keys_list);
|
||||
|
||||
/* Because kSecAttrLabel matching doesn't work with kSecClassIdentity,
|
||||
/* Because kSecAttrLabel matching does not work with kSecClassIdentity,
|
||||
* we need to find the correct identity ourselves */
|
||||
if(status == noErr) {
|
||||
keys_list_count = CFArrayGetCount(keys_list);
|
||||
|
|
@ -638,7 +639,7 @@ static OSStatus CopyIdentityFromPKCS12File(const char *cPath,
|
|||
/* On macOS SecPKCS12Import will always add the client certificate to
|
||||
* the Keychain.
|
||||
*
|
||||
* As this doesn't match iOS, and apps may not want to see their client
|
||||
* As this does not match iOS, and apps may not want to see their client
|
||||
* certificate saved in the user's keychain, we use SecItemImport
|
||||
* with a NULL keychain to avoid importing it.
|
||||
*
|
||||
|
|
@ -923,7 +924,7 @@ static SSLCipherSuite * sectransp_get_supported_ciphers(SSLContextRef ssl_ctx,
|
|||
{
|
||||
int maj = 0, min = 0;
|
||||
GetDarwinVersionNumber(&maj, &min);
|
||||
/* There's a known bug in early versions of Mountain Lion where ST's ECC
|
||||
/* There is a known bug in early versions of Mountain Lion where ST's ECC
|
||||
ciphers (cipher suite 0xC001 through 0xC032) simply do not work.
|
||||
Work around the problem here by disabling those ciphers if we are
|
||||
running in an affected version of OS X. */
|
||||
|
|
@ -1062,7 +1063,7 @@ static void sectransp_session_free(void *sessionid, size_t idsize)
|
|||
{
|
||||
/* ST, as of iOS 5 and Mountain Lion, has no public method of deleting a
|
||||
cached session ID inside the Security framework. There is a private
|
||||
function that does this, but I don't want to have to explain to you why I
|
||||
function that does this, but I do not want to have to explain to you why I
|
||||
got your application rejected from the App Store due to the use of a
|
||||
private API, so the best we can do is free up our own char array that we
|
||||
created way back in sectransp_connect_step1... */
|
||||
|
|
@ -1103,18 +1104,18 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
CFRelease(backend->ssl_ctx);
|
||||
backend->ssl_ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType);
|
||||
if(!backend->ssl_ctx) {
|
||||
failf(data, "SSL: couldn't create a context");
|
||||
failf(data, "SSL: could not create a context");
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* The old ST API does not exist under iOS, so don't compile it: */
|
||||
/* The old ST API does not exist under iOS, so do not compile it: */
|
||||
#if CURL_SUPPORT_MAC_10_8
|
||||
if(backend->ssl_ctx)
|
||||
(void)SSLDisposeContext(backend->ssl_ctx);
|
||||
err = SSLNewContext(false, &(backend->ssl_ctx));
|
||||
if(err != noErr) {
|
||||
failf(data, "SSL: couldn't create a context: OSStatus %d", err);
|
||||
failf(data, "SSL: could not create a context: OSStatus %d", err);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
#endif /* CURL_SUPPORT_MAC_10_8 */
|
||||
|
|
@ -1124,13 +1125,13 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
(void)SSLDisposeContext(backend->ssl_ctx);
|
||||
err = SSLNewContext(false, &(backend->ssl_ctx));
|
||||
if(err != noErr) {
|
||||
failf(data, "SSL: couldn't create a context: OSStatus %d", err);
|
||||
failf(data, "SSL: could not create a context: OSStatus %d", err);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
#endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */
|
||||
backend->ssl_write_buffered_length = 0UL; /* reset buffered write length */
|
||||
|
||||
/* check to see if we've been told to use an explicit SSL/TLS version */
|
||||
/* check to see if we have been told to use an explicit SSL/TLS version */
|
||||
#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS
|
||||
if(SSLSetProtocolVersionMax) {
|
||||
switch(conn_config->version) {
|
||||
|
|
@ -1348,11 +1349,11 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
cert_showfilename_error);
|
||||
break;
|
||||
case errSecItemNotFound:
|
||||
failf(data, "SSL: Can't find the certificate \"%s\" and its private "
|
||||
failf(data, "SSL: cannot find the certificate \"%s\" and its private "
|
||||
"key in the Keychain.", cert_showfilename_error);
|
||||
break;
|
||||
default:
|
||||
failf(data, "SSL: Can't load the certificate \"%s\" and its private "
|
||||
failf(data, "SSL: cannot load the certificate \"%s\" and its private "
|
||||
"key: OSStatus %d", cert_showfilename_error, err);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1367,7 +1368,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
#if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS
|
||||
/* Snow Leopard introduced the SSLSetSessionOption() function, but due to
|
||||
a library bug with the way the kSSLSessionOptionBreakOnServerAuth flag
|
||||
works, it doesn't work as expected under Snow Leopard, Lion or
|
||||
works, it does not work as expected under Snow Leopard, Lion or
|
||||
Mountain Lion.
|
||||
So we need to call SSLSetEnableCertVerify() on those older cats in order
|
||||
to disable certificate validation if the user turned that off.
|
||||
|
|
@ -1419,7 +1420,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
bool is_cert_file = (!is_cert_data) && is_file(ssl_cafile);
|
||||
|
||||
if(!(is_cert_file || is_cert_data)) {
|
||||
failf(data, "SSL: can't load CA certificate file %s",
|
||||
failf(data, "SSL: cannot load CA certificate file %s",
|
||||
ssl_cafile ? ssl_cafile : "(blob memory)");
|
||||
return CURLE_SSL_CACERT_BADFILE;
|
||||
}
|
||||
|
|
@ -1463,7 +1464,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
|
||||
#if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7
|
||||
/* We want to enable 1/n-1 when using a CBC cipher unless the user
|
||||
specifically doesn't want us doing that: */
|
||||
specifically does not want us doing that: */
|
||||
if(SSLSetSessionOption) {
|
||||
SSLSetSessionOption(backend->ssl_ctx, kSSLSessionOptionSendOneByteRecord,
|
||||
!ssl_config->enable_beast);
|
||||
|
|
@ -1472,7 +1473,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
}
|
||||
#endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */
|
||||
|
||||
/* Check if there's a cached ID we can/should use here! */
|
||||
/* Check if there is a cached ID we can/should use here! */
|
||||
if(ssl_config->primary.sessionid) {
|
||||
char *ssl_sessionid;
|
||||
size_t ssl_sessionid_len;
|
||||
|
|
@ -1490,7 +1491,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
/* Informational message */
|
||||
infof(data, "SSL reusing session ID");
|
||||
}
|
||||
/* If there isn't one, then let's make one up! This has to be done prior
|
||||
/* If there is not one, then let's make one up! This has to be done prior
|
||||
to starting the handshake. */
|
||||
else {
|
||||
ssl_sessionid =
|
||||
|
|
@ -1838,7 +1839,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data,
|
|||
/* Result is returned to caller */
|
||||
CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
|
||||
|
||||
/* if a path wasn't specified, don't pin */
|
||||
/* if a path was not specified, do not pin */
|
||||
if(!pinnedpubkey)
|
||||
return CURLE_OK;
|
||||
|
||||
|
|
@ -1960,12 +1961,12 @@ check_handshake:
|
|||
|
||||
if(err != noErr) {
|
||||
switch(err) {
|
||||
case errSSLWouldBlock: /* they're not done with us yet */
|
||||
case errSSLWouldBlock: /* they are not done with us yet */
|
||||
connssl->io_need = backend->ssl_direction ?
|
||||
CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV;
|
||||
return CURLE_OK;
|
||||
|
||||
/* The below is errSSLServerAuthCompleted; it's not defined in
|
||||
/* The below is errSSLServerAuthCompleted; it is not defined in
|
||||
Leopard's headers */
|
||||
case -9841:
|
||||
if((conn_config->CAfile || conn_config->ca_info_blob) &&
|
||||
|
|
@ -2075,8 +2076,8 @@ check_handshake:
|
|||
"authority");
|
||||
break;
|
||||
|
||||
/* This error is raised if the server's cert didn't match the server's
|
||||
host name: */
|
||||
/* This error is raised if the server's cert did not match the server's
|
||||
hostname: */
|
||||
case errSSLHostNameMismatch:
|
||||
failf(data, "SSL certificate peer verification failed, the "
|
||||
"certificate did not match \"%s\"\n", connssl->peer.dispname);
|
||||
|
|
@ -2178,7 +2179,7 @@ check_handshake:
|
|||
}
|
||||
else {
|
||||
char cipher_str[64];
|
||||
/* we have been connected fine, we're not waiting for anything else. */
|
||||
/* we have been connected fine, we are not waiting for anything else. */
|
||||
connssl->connecting_state = ssl_connect_3;
|
||||
|
||||
#ifdef SECTRANSP_PINNEDPUBKEY
|
||||
|
|
@ -2255,7 +2256,7 @@ check_handshake:
|
|||
BUNDLE_MULTIPLEX : BUNDLE_NO_MULTIUSE);
|
||||
|
||||
/* chosenProtocol is a reference to the string within alpnArr
|
||||
and doesn't need to be freed separately */
|
||||
and does not need to be freed separately */
|
||||
if(alpnArr)
|
||||
CFRelease(alpnArr);
|
||||
}
|
||||
|
|
@ -2357,7 +2358,7 @@ static CURLcode collect_server_cert(struct Curl_cfilter *cf,
|
|||
/* SSLCopyPeerCertificates() is deprecated as of Mountain Lion.
|
||||
The function SecTrustGetCertificateAtIndex() is officially present
|
||||
in Lion, but it is unfortunately also present in Snow Leopard as
|
||||
private API and doesn't work as expected. So we have to look for
|
||||
private API and does not work as expected. So we have to look for
|
||||
a different symbol to make sure this code is only executed under
|
||||
Lion or later. */
|
||||
if(SecTrustCopyPublicKey) {
|
||||
|
|
@ -2446,7 +2447,7 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
}
|
||||
|
||||
if(ssl_connect_1 == connssl->connecting_state) {
|
||||
/* Find out how much more time we're allowed */
|
||||
/* Find out how much more time we are allowed */
|
||||
const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
|
|
@ -2471,7 +2472,7 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(connssl->io_need) {
|
||||
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
@ -2699,7 +2700,7 @@ static bool sectransp_data_pending(struct Curl_cfilter *cf,
|
|||
static CURLcode sectransp_random(struct Curl_easy *data UNUSED_PARAM,
|
||||
unsigned char *entropy, size_t length)
|
||||
{
|
||||
/* arc4random_buf() isn't available on cats older than Lion, so let's
|
||||
/* arc4random_buf() is not available on cats older than Lion, so let's
|
||||
do this manually for the benefit of the older cats. */
|
||||
size_t i;
|
||||
u_int32_t random_number = 0;
|
||||
|
|
@ -2757,7 +2758,7 @@ static ssize_t sectransp_send(struct Curl_cfilter *cf,
|
|||
|
||||
Now, one could interpret that as "written to the socket," but actually,
|
||||
it returns the amount of data that was written to a buffer internal to
|
||||
the SSLContextRef instead. So it's possible for SSLWrite() to return
|
||||
the SSLContextRef instead. So it is possible for SSLWrite() to return
|
||||
errSSLWouldBlock and a number of bytes "written" because those bytes were
|
||||
encrypted and written to a buffer, not to the socket.
|
||||
|
||||
|
|
@ -2770,7 +2771,7 @@ static ssize_t sectransp_send(struct Curl_cfilter *cf,
|
|||
err = SSLWrite(backend->ssl_ctx, NULL, 0UL, &processed);
|
||||
switch(err) {
|
||||
case noErr:
|
||||
/* processed is always going to be 0 because we didn't write to
|
||||
/* processed is always going to be 0 because we did not write to
|
||||
the buffer, so return how much was written to the socket */
|
||||
processed = backend->ssl_write_buffered_length;
|
||||
backend->ssl_write_buffered_length = 0UL;
|
||||
|
|
@ -2785,7 +2786,7 @@ static ssize_t sectransp_send(struct Curl_cfilter *cf,
|
|||
}
|
||||
}
|
||||
else {
|
||||
/* We've got new data to write: */
|
||||
/* We have got new data to write: */
|
||||
err = SSLWrite(backend->ssl_ctx, mem, len, &processed);
|
||||
if(err != noErr) {
|
||||
switch(err) {
|
||||
|
|
@ -2842,7 +2843,7 @@ again:
|
|||
*curlcode = CURLE_OK;
|
||||
return 0;
|
||||
|
||||
/* The below is errSSLPeerAuthCompleted; it's not defined in
|
||||
/* The below is errSSLPeerAuthCompleted; it is not defined in
|
||||
Leopard's headers */
|
||||
case -9841:
|
||||
if((conn_config->CAfile || conn_config->ca_info_blob) &&
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ static CURLcode blobdup(struct curl_blob **dest,
|
|||
DEBUGASSERT(dest);
|
||||
DEBUGASSERT(!*dest);
|
||||
if(src) {
|
||||
/* only if there's data to dupe! */
|
||||
/* only if there is data to dupe! */
|
||||
struct curl_blob *d;
|
||||
d = malloc(sizeof(struct curl_blob) + src->len);
|
||||
if(!d)
|
||||
|
|
@ -154,7 +154,7 @@ static const struct alpn_spec *alpn_get_spec(int httpwant, bool use_alpn)
|
|||
(void)httpwant;
|
||||
#endif
|
||||
/* Use the ALPN protocol "http/1.1" for HTTP/1.x.
|
||||
Avoid "http/1.0" because some servers don't support it. */
|
||||
Avoid "http/1.0" because some servers do not support it. */
|
||||
return &ALPN_SPEC_H11;
|
||||
}
|
||||
#endif /* USE_SSL */
|
||||
|
|
@ -531,8 +531,8 @@ void Curl_ssl_sessionid_unlock(struct Curl_easy *data)
|
|||
}
|
||||
|
||||
/*
|
||||
* Check if there's a session ID for the given connection in the cache, and if
|
||||
* there's one suitable, it is provided. Returns TRUE when no entry matched.
|
||||
* Check if there is a session ID for the given connection in the cache, and if
|
||||
* there is one suitable, it is provided. Returns TRUE when no entry matched.
|
||||
*/
|
||||
bool Curl_ssl_getsessionid(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data,
|
||||
|
|
@ -592,7 +592,7 @@ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
DEBUGF(infof(data, "%s Session ID in cache for %s %s://%s:%d",
|
||||
no_match? "Didn't find": "Found",
|
||||
no_match? "Did not find": "Found",
|
||||
Curl_ssl_cf_is_proxy(cf) ? "proxy" : "host",
|
||||
cf->conn->handler->scheme, peer->hostname, peer->port));
|
||||
return no_match;
|
||||
|
|
@ -689,7 +689,7 @@ CURLcode Curl_ssl_addsessionid(struct Curl_cfilter *cf,
|
|||
else
|
||||
conn_to_port = -1;
|
||||
|
||||
/* Now we should add the session ID and the host name to the cache, (remove
|
||||
/* Now we should add the session ID and the hostname to the cache, (remove
|
||||
the oldest if necessary) */
|
||||
|
||||
/* If using shared SSL session, lock! */
|
||||
|
|
@ -724,12 +724,12 @@ CURLcode Curl_ssl_addsessionid(struct Curl_cfilter *cf,
|
|||
store->idsize = idsize;
|
||||
store->sessionid_free = sessionid_free_cb;
|
||||
store->age = *general_age; /* set current age */
|
||||
/* free it if there's one already present */
|
||||
/* free it if there is one already present */
|
||||
free(store->name);
|
||||
free(store->conn_to_host);
|
||||
store->name = clone_host; /* clone host name */
|
||||
store->name = clone_host; /* clone hostname */
|
||||
clone_host = NULL;
|
||||
store->conn_to_host = clone_conn_to_host; /* clone connect to host name */
|
||||
store->conn_to_host = clone_conn_to_host; /* clone connect to hostname */
|
||||
clone_conn_to_host = NULL;
|
||||
store->conn_to_port = conn_to_port; /* connect to port number */
|
||||
/* port number */
|
||||
|
|
@ -997,7 +997,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
|||
(void)data;
|
||||
#endif
|
||||
|
||||
/* if a path wasn't specified, don't pin */
|
||||
/* if a path was not specified, do not pin */
|
||||
if(!pinnedpubkey)
|
||||
return CURLE_OK;
|
||||
if(!pubkey || !pubkeylen)
|
||||
|
|
@ -1045,7 +1045,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
|||
end_pos = strstr(begin_pos, ";sha256//");
|
||||
/*
|
||||
* if there is an end_pos, null terminate,
|
||||
* otherwise it'll go to the end of the original string
|
||||
* otherwise it will go to the end of the original string
|
||||
*/
|
||||
if(end_pos)
|
||||
end_pos[0] = '\0';
|
||||
|
|
@ -1091,7 +1091,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
|||
|
||||
/*
|
||||
* if the size of our certificate is bigger than the file
|
||||
* size then it can't match
|
||||
* size then it cannot match
|
||||
*/
|
||||
size = curlx_sotouz((curl_off_t) filesize);
|
||||
if(pubkeylen > size)
|
||||
|
|
@ -1109,7 +1109,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
|||
if((int) fread(buf, size, 1, fp) != 1)
|
||||
break;
|
||||
|
||||
/* If the sizes are the same, it can't be base64 encoded, must be der */
|
||||
/* If the sizes are the same, it cannot be base64 encoded, must be der */
|
||||
if(pubkeylen == size) {
|
||||
if(!memcmp(pubkey, buf, pubkeylen))
|
||||
result = CURLE_OK;
|
||||
|
|
@ -1117,18 +1117,18 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
/*
|
||||
* Otherwise we will assume it's PEM and try to decode it
|
||||
* Otherwise we will assume it is PEM and try to decode it
|
||||
* after placing null terminator
|
||||
*/
|
||||
buf[size] = '\0';
|
||||
pem_read = pubkey_pem_to_der((const char *)buf, &pem_ptr, &pem_len);
|
||||
/* if it wasn't read successfully, exit */
|
||||
/* if it was not read successfully, exit */
|
||||
if(pem_read)
|
||||
break;
|
||||
|
||||
/*
|
||||
* if the size of our certificate doesn't match the size of
|
||||
* the decoded file, they can't be the same, otherwise compare
|
||||
* if the size of our certificate does not match the size of
|
||||
* the decoded file, they cannot be the same, otherwise compare
|
||||
*/
|
||||
if(pubkeylen == pem_len && !memcmp(pubkey, pem_ptr, pubkeylen))
|
||||
result = CURLE_OK;
|
||||
|
|
@ -1566,10 +1566,10 @@ CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, struct Curl_cfilter *cf,
|
|||
const char *ehostname, *edispname;
|
||||
int eport;
|
||||
|
||||
/* We need the hostname for SNI negotiation. Once handshaked, this
|
||||
* remains the SNI hostname for the TLS connection. But when the
|
||||
* connection is reused, the settings in cf->conn might change.
|
||||
* So we keep a copy of the hostname we use for SNI.
|
||||
/* We need the hostname for SNI negotiation. Once handshaked, this remains
|
||||
* the SNI hostname for the TLS connection. When the connection is reused,
|
||||
* the settings in cf->conn might change. We keep a copy of the hostname we
|
||||
* use for SNI.
|
||||
*/
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
if(Curl_ssl_cf_is_proxy(cf)) {
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
||||
/* check to see if we've been told to use an explicit SSL/TLS version */
|
||||
/* check to see if we have been told to use an explicit SSL/TLS version */
|
||||
switch(conn_config->version) {
|
||||
case CURL_SSLVERSION_DEFAULT:
|
||||
case CURL_SSLVERSION_TLSv1:
|
||||
|
|
@ -688,7 +688,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
}
|
||||
|
||||
if(!req_method) {
|
||||
failf(data, "SSL: couldn't create a method");
|
||||
failf(data, "SSL: could not create a method");
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
|
@ -697,7 +697,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
backend->ctx = wolfSSL_CTX_new(req_method);
|
||||
|
||||
if(!backend->ctx) {
|
||||
failf(data, "SSL: couldn't create a context");
|
||||
failf(data, "SSL: could not create a context");
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
|
@ -718,7 +718,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
&& (wolfSSL_CTX_SetMinVersion(backend->ctx, WOLFSSL_TLSV1_3) != 1)
|
||||
#endif
|
||||
) {
|
||||
failf(data, "SSL: couldn't set the minimum protocol version");
|
||||
failf(data, "SSL: could not set the minimum protocol version");
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -830,7 +830,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
}
|
||||
#ifdef NO_FILESYSTEM
|
||||
else if(conn_config->verifypeer) {
|
||||
failf(data, "SSL: Certificates can't be loaded because wolfSSL was built"
|
||||
failf(data, "SSL: Certificates cannot be loaded because wolfSSL was built"
|
||||
" with \"no filesystem\". Either disable peer verification"
|
||||
" (insecure) or if you are building an application with libcurl you"
|
||||
" can load certificates via CURLOPT_SSL_CTX_FUNCTION.");
|
||||
|
|
@ -843,7 +843,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
wolfSSL_free(backend->handle);
|
||||
backend->handle = wolfSSL_new(backend->ctx);
|
||||
if(!backend->handle) {
|
||||
failf(data, "SSL: couldn't create a handle");
|
||||
failf(data, "SSL: could not create a handle");
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
|
@ -890,7 +890,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
}
|
||||
#endif /* HAVE_SECURE_RENEGOTIATION */
|
||||
|
||||
/* Check if there's a cached ID we can/should use here! */
|
||||
/* Check if there is a cached ID we can/should use here! */
|
||||
if(ssl_config->primary.sessionid) {
|
||||
void *ssl_sessionid = NULL;
|
||||
|
||||
|
|
@ -900,7 +900,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
/* we got a session id, use it! */
|
||||
if(!SSL_set_session(backend->handle, ssl_sessionid)) {
|
||||
Curl_ssl_delsessionid(data, ssl_sessionid);
|
||||
infof(data, "Can't use session ID, going on without");
|
||||
infof(data, "cannot use session ID, going on without");
|
||||
}
|
||||
else
|
||||
infof(data, "SSL reusing session ID");
|
||||
|
|
@ -977,7 +977,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
|
||||
if(trying_ech_now
|
||||
&& SSL_set_min_proto_version(backend->handle, TLS1_3_VERSION) != 1) {
|
||||
infof(data, "ECH: Can't force TLSv1.3 [ERROR]");
|
||||
infof(data, "ECH: cannot force TLSv1.3 [ERROR]");
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -1141,7 +1141,7 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
word32 echConfigsLen = 1000;
|
||||
int rv = 0;
|
||||
|
||||
/* this currently doesn't produce the retry_configs */
|
||||
/* this currently does not produce the retry_configs */
|
||||
rv = wolfSSL_GetEchConfigs(backend->handle, echConfigs,
|
||||
&echConfigsLen);
|
||||
if(rv != WOLFSSL_SUCCESS) {
|
||||
|
|
@ -1324,7 +1324,7 @@ static ssize_t wolfssl_send(struct Curl_cfilter *cf,
|
|||
switch(err) {
|
||||
case SSL_ERROR_WANT_READ:
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
/* there's data pending, re-invoke SSL_write() */
|
||||
/* there is data pending, re-invoke SSL_write() */
|
||||
CURL_TRC_CF(data, cf, "wolfssl_send(len=%zu) -> AGAIN", len);
|
||||
*curlcode = CURLE_AGAIN;
|
||||
return -1;
|
||||
|
|
@ -1489,7 +1489,7 @@ static ssize_t wolfssl_recv(struct Curl_cfilter *cf,
|
|||
case SSL_ERROR_NONE:
|
||||
case SSL_ERROR_WANT_READ:
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
/* there's data pending, re-invoke wolfSSL_read() */
|
||||
/* there is data pending, re-invoke wolfSSL_read() */
|
||||
CURL_TRC_CF(data, cf, "wolfssl_recv(len=%zu) -> AGAIN", blen);
|
||||
*curlcode = CURLE_AGAIN;
|
||||
return -1;
|
||||
|
|
@ -1578,7 +1578,7 @@ wolfssl_connect_common(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
if(ssl_connect_1 == connssl->connecting_state) {
|
||||
/* Find out how much more time we're allowed */
|
||||
/* Find out how much more time we are allowed */
|
||||
const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
|
|
@ -1603,7 +1603,7 @@ wolfssl_connect_common(struct Curl_cfilter *cf,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
/* if ssl is expecting something, check if it is available. */
|
||||
if(connssl->io_need) {
|
||||
|
||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue