mirror of
https://github.com/curl/curl.git
synced 2026-07-25 02:47:17 +03:00
parent
7a1e99eefa
commit
0476e4fc65
149 changed files with 1381 additions and 1376 deletions
|
|
@ -102,7 +102,7 @@ const char *Curl_bufref_ptr(const struct bufref *br)
|
|||
DEBUGASSERT(br->signature == SIGNATURE);
|
||||
DEBUGASSERT(br->ptr || !br->len);
|
||||
|
||||
return (const char *) br->ptr;
|
||||
return (const char *)br->ptr;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1036,7 +1036,7 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||
/* Only show this when NOT reading the cookies from a file */
|
||||
infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, "
|
||||
"expire %" FMT_OFF_T,
|
||||
replaces ? "Replaced":"Added", co->name, co->value,
|
||||
replaces ? "Replaced" : "Added", co->name, co->value,
|
||||
co->domain, co->path, co->expires);
|
||||
|
||||
if(!replaces)
|
||||
|
|
|
|||
|
|
@ -238,8 +238,7 @@ static CURLcode Curl_sha512_256_update(void *context,
|
|||
# bytes
|
||||
* @return always CURLE_OK
|
||||
*/
|
||||
static CURLcode Curl_sha512_256_finish(unsigned char *digest,
|
||||
void *context)
|
||||
static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
|
||||
{
|
||||
Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
|
||||
|
||||
|
|
@ -453,19 +452,19 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
|
|||
|
||||
/* 'Ch' and 'Maj' macro functions are defined with widely-used optimization.
|
||||
See FIPS PUB 180-4 formulae 4.8, 4.9. */
|
||||
#define Sha512_Ch(x, y, z) ( (z) ^ ((x) & ((y) ^ (z))) )
|
||||
#define Sha512_Maj(x, y, z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) )
|
||||
#define Sha512_Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
|
||||
#define Sha512_Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y))))
|
||||
|
||||
/* Four 'Sigma' macro functions.
|
||||
See FIPS PUB 180-4 formulae 4.10, 4.11, 4.12, 4.13. */
|
||||
#define SIG0(x) \
|
||||
( Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39) )
|
||||
(Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39))
|
||||
#define SIG1(x) \
|
||||
( Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41) )
|
||||
(Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41))
|
||||
#define sig0(x) \
|
||||
( Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7) )
|
||||
(Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7))
|
||||
#define sig1(x) \
|
||||
( Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6) )
|
||||
(Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6))
|
||||
|
||||
if(1) {
|
||||
unsigned int t;
|
||||
|
|
@ -628,9 +627,7 @@ static CURLcode Curl_sha512_256_update(void *context,
|
|||
if(length >= bytes_left) {
|
||||
/* Combine new data with data in the buffer and process the full
|
||||
block. */
|
||||
memcpy(((unsigned char *)ctx_buf) + bytes_have,
|
||||
data,
|
||||
bytes_left);
|
||||
memcpy(((unsigned char *)ctx_buf) + bytes_have, data, bytes_left);
|
||||
data += bytes_left;
|
||||
length -= bytes_left;
|
||||
Curl_sha512_256_transform(ctx->H, ctx->buffer);
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form,
|
|||
(form->flags & HTTPPOST_BUFFER)) &&
|
||||
!Curl_bufref_ptr(&form->contenttype)) {
|
||||
const char *f = Curl_bufref_ptr((form->flags & HTTPPOST_BUFFER) ?
|
||||
&form->showfilename : &form->value);
|
||||
&form->showfilename : &form->value);
|
||||
const char *type = Curl_mime_contenttype(f);
|
||||
if(!type)
|
||||
type = prevtype;
|
||||
|
|
@ -276,7 +276,7 @@ static CURLFORMcode FormAddCheck(struct FormInfo *first_form,
|
|||
if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE |
|
||||
HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER |
|
||||
HTTPPOST_CALLBACK))) {
|
||||
if(FormInfoCopyField(&form->value, (size_t) form->contentslength))
|
||||
if(FormInfoCopyField(&form->value, (size_t)form->contentslength))
|
||||
return CURL_FORMADD_MEMORY;
|
||||
}
|
||||
post = AddHttpPost(form, post, httppost, last_post);
|
||||
|
|
@ -315,11 +315,11 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
struct curl_httppost *newchain = NULL;
|
||||
struct curl_httppost *lastnode = NULL;
|
||||
|
||||
#define form_ptr_arg(t) (forms ? (t) (void *) avalue : va_arg(params, t))
|
||||
#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
|
||||
#ifdef HAVE_STDINT_H
|
||||
#define form_int_arg(t) (forms ? (t) (uintptr_t) avalue : va_arg(params, t))
|
||||
#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
|
||||
#else
|
||||
#define form_int_arg(t) (forms ? (t) (void *) avalue : va_arg(params, t))
|
||||
#define form_int_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -391,7 +391,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
if(curr->namelength)
|
||||
retval = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
curr->namelength = (size_t) form_int_arg(long);
|
||||
curr->namelength = (size_t)form_int_arg(long);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
|
@ -412,7 +412,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
}
|
||||
break;
|
||||
case CURLFORM_CONTENTSLENGTH:
|
||||
curr->contentslength = (curl_off_t)(size_t) form_int_arg(long);
|
||||
curr->contentslength = (curl_off_t)(size_t)form_int_arg(long);
|
||||
break;
|
||||
|
||||
case CURLFORM_CONTENTLEN:
|
||||
|
|
@ -493,7 +493,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
if(curr->bufferlength)
|
||||
retval = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
curr->bufferlength = (size_t) form_int_arg(long);
|
||||
curr->bufferlength = (size_t)form_int_arg(long);
|
||||
break;
|
||||
|
||||
case CURLFORM_STREAM:
|
||||
|
|
@ -521,7 +521,7 @@ static CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
if(avalue) {
|
||||
form = NewFormInfo();
|
||||
if(!form || Curl_bufref_memdup0(&form->contenttype, avalue,
|
||||
strlen(avalue))) {
|
||||
strlen(avalue))) {
|
||||
curlx_free(form);
|
||||
retval = CURL_FORMADD_MEMORY;
|
||||
}
|
||||
|
|
@ -793,10 +793,10 @@ CURLcode Curl_getformdata(CURL *data,
|
|||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
|
||||
#endif
|
||||
result = curl_mime_data_cb(part, (curl_off_t) -1,
|
||||
(curl_read_callback) fread,
|
||||
result = curl_mime_data_cb(part, (curl_off_t)-1,
|
||||
(curl_read_callback)fread,
|
||||
curlx_fseek,
|
||||
NULL, (void *) stdin);
|
||||
NULL, (void *)stdin);
|
||||
#if defined(__clang__) && __clang_major__ >= 16
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@
|
|||
|
||||
/* macro to check for a three-digit ftp status code at the start of the
|
||||
given string */
|
||||
#define STATUSCODE(line) (ISDIGIT(line[0]) && ISDIGIT(line[1]) && \
|
||||
ISDIGIT(line[2]))
|
||||
#define STATUSCODE(line) \
|
||||
(ISDIGIT(line[0]) && ISDIGIT(line[1]) && ISDIGIT(line[2]))
|
||||
|
||||
/* macro to check for the last line in an FTP server response */
|
||||
#define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3]))
|
||||
|
|
@ -1749,8 +1749,7 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data,
|
|||
return result;
|
||||
}
|
||||
|
||||
static CURLcode ftp_control_addr_dup(struct Curl_easy *data,
|
||||
char **newhostp)
|
||||
static CURLcode ftp_control_addr_dup(struct Curl_easy *data, char **newhostp)
|
||||
{
|
||||
struct connectdata *conn = data->conn;
|
||||
struct ip_quadruple ipquad;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ static timediff_t dnscache_prune(struct Curl_hash *hostcache,
|
|||
user.oldest_ms = 0;
|
||||
|
||||
Curl_hash_clean_with_criterium(hostcache,
|
||||
(void *) &user,
|
||||
(void *)&user,
|
||||
dnscache_entry_is_stale);
|
||||
|
||||
return user.oldest_ms;
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ static CURLcode calc_payload_hash(struct Curl_easy *data,
|
|||
else
|
||||
post_data_len = (size_t)data->set.postfieldsize;
|
||||
}
|
||||
result = Curl_sha256it(sha_hash, (const unsigned char *) post_data,
|
||||
result = Curl_sha256it(sha_hash, (const unsigned char *)post_data,
|
||||
post_data_len);
|
||||
if(!result)
|
||||
sha256_to_hex(sha_hex, sha_hash);
|
||||
|
|
|
|||
10
lib/ldap.c
10
lib/ldap.c
|
|
@ -143,11 +143,11 @@ static void ldap_free_urldesc_low(LDAPURLDesc *ludp);
|
|||
#endif /* !HAVE_LDAP_URL_PARSE */
|
||||
|
||||
#ifdef DEBUG_LDAP
|
||||
#define LDAP_TRACE(x) \
|
||||
do { \
|
||||
ldap_trace_low("%u: ", __LINE__); \
|
||||
ldap_trace_low x; \
|
||||
} while(0)
|
||||
#define LDAP_TRACE(x) \
|
||||
do { \
|
||||
ldap_trace_low("%u: ", __LINE__); \
|
||||
ldap_trace_low x; \
|
||||
} while(0)
|
||||
|
||||
static void ldap_trace_low(const char *fmt, ...) CURL_PRINTF(1, 2);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -1769,7 +1769,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||
if(!use_set_uh) {
|
||||
char *newurl;
|
||||
uc = curl_url_set(uh, CURLUPART_URL, Curl_bufref_ptr(&data->state.url),
|
||||
(unsigned int) (CURLU_GUESS_SCHEME |
|
||||
(unsigned int)(CURLU_GUESS_SCHEME |
|
||||
CURLU_NON_SUPPORT_SCHEME |
|
||||
(data->set.disallow_username_in_url ?
|
||||
CURLU_DISALLOW_USER : 0) |
|
||||
|
|
@ -3199,7 +3199,7 @@ static CURLcode resolve_server(struct Curl_easy *data,
|
|||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
if(!unix_path && CONN_IS_PROXIED(conn) && conn->socks_proxy.host.name &&
|
||||
!strncmp(UNIX_SOCKET_PREFIX"/",
|
||||
!strncmp(UNIX_SOCKET_PREFIX "/",
|
||||
conn->socks_proxy.host.name, sizeof(UNIX_SOCKET_PREFIX)))
|
||||
unix_path = conn->socks_proxy.host.name + sizeof(UNIX_SOCKET_PREFIX) - 1;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -452,10 +452,10 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||
chlg_buf[0].cbBuffer = 0;
|
||||
chlg_buf[1].BufferType = SECBUFFER_PKG_PARAMS;
|
||||
chlg_buf[1].pvBuffer = CURL_UNCONST(request);
|
||||
chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *) request));
|
||||
chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *)request));
|
||||
chlg_buf[2].BufferType = SECBUFFER_PKG_PARAMS;
|
||||
chlg_buf[2].pvBuffer = CURL_UNCONST(uripath);
|
||||
chlg_buf[2].cbBuffer = curlx_uztoul(strlen((const char *) uripath));
|
||||
chlg_buf[2].cbBuffer = curlx_uztoul(strlen((const char *)uripath));
|
||||
chlg_buf[3].BufferType = SECBUFFER_PKG_PARAMS;
|
||||
chlg_buf[3].pvBuffer = NULL;
|
||||
chlg_buf[3].cbBuffer = 0;
|
||||
|
|
@ -495,7 +495,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
/* Populate our identity domain */
|
||||
if(Curl_override_sspi_http_realm((const char *) digest->input_token,
|
||||
if(Curl_override_sspi_http_realm((const char *)digest->input_token,
|
||||
&identity)) {
|
||||
Curl_sspi_free_identity(&identity);
|
||||
curlx_free(output_token);
|
||||
|
|
@ -552,7 +552,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||
chlg_buf[0].cbBuffer = curlx_uztoul(digest->input_token_len);
|
||||
chlg_buf[1].BufferType = SECBUFFER_PKG_PARAMS;
|
||||
chlg_buf[1].pvBuffer = CURL_UNCONST(request);
|
||||
chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *) request));
|
||||
chlg_buf[1].cbBuffer = curlx_uztoul(strlen((const char *)request));
|
||||
chlg_buf[2].BufferType = SECBUFFER_PKG_PARAMS;
|
||||
chlg_buf[2].pvBuffer = NULL;
|
||||
chlg_buf[2].cbBuffer = 0;
|
||||
|
|
@ -565,7 +565,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||
resp_buf.pvBuffer = output_token;
|
||||
resp_buf.cbBuffer = curlx_uztoul(token_max);
|
||||
|
||||
spn = curlx_convert_UTF8_to_tchar((const char *) uripath);
|
||||
spn = curlx_convert_UTF8_to_tchar((const char *)uripath);
|
||||
if(!spn) {
|
||||
Curl_pSecFn->FreeCredentialsHandle(&credentials);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
#include "../curlx/warnless.h"
|
||||
|
||||
|
||||
#define QUIC_MAX_STREAMS (256 * 1024)
|
||||
#define QUIC_MAX_STREAMS (256 * 1024)
|
||||
#define QUIC_HANDSHAKE_TIMEOUT (10 * NGTCP2_SECONDS)
|
||||
|
||||
/* A stream window is the maximum amount we need to buffer for
|
||||
|
|
@ -91,12 +91,11 @@
|
|||
* spares. Memory consumption goes down when streams run empty,
|
||||
* have a large upload done, etc. */
|
||||
#define H3_STREAM_POOL_SPARES \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2
|
||||
/* Receive and Send max number of chunks just follows from the
|
||||
* chunk size and window size */
|
||||
#define H3_STREAM_SEND_CHUNKS \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
|
||||
/*
|
||||
* Store ngtcp2 version info in this buffer.
|
||||
|
|
@ -959,7 +958,7 @@ static CURLcode cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf,
|
|||
|
||||
CF_DATA_SAVE(save, cf, data);
|
||||
c_exhaust = want_send && (!ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
|
||||
!ngtcp2_conn_get_max_data_left(ctx->qconn));
|
||||
!ngtcp2_conn_get_max_data_left(ctx->qconn));
|
||||
s_exhaust = want_send && stream && stream->id >= 0 &&
|
||||
stream->quic_flow_blocked;
|
||||
want_recv = (want_recv || c_exhaust || s_exhaust);
|
||||
|
|
@ -2513,7 +2512,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf,
|
|||
CURLcode result;
|
||||
const struct Curl_sockaddr_ex *sockaddr = NULL;
|
||||
int qfd;
|
||||
static const struct alpn_spec ALPN_SPEC_H3 = {{ "h3", "h3-29" }, 2};
|
||||
static const struct alpn_spec ALPN_SPEC_H3 = { { "h3", "h3-29" }, 2 };
|
||||
|
||||
DEBUGASSERT(ctx->initialized);
|
||||
ctx->dcid.datalen = NGTCP2_MAX_CIDLEN;
|
||||
|
|
|
|||
|
|
@ -70,13 +70,13 @@
|
|||
* spares. Memory consumption goes down when streams run empty,
|
||||
* have a large upload done, etc. */
|
||||
#define H3_STREAM_POOL_SPARES \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2
|
||||
/* Receive and Send max number of chunks just follows from the
|
||||
* chunk size and window size */
|
||||
#define H3_STREAM_RECV_CHUNKS \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
#define H3_STREAM_SEND_CHUNKS \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
|
||||
#if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC)
|
||||
typedef uint32_t sslerr_t;
|
||||
|
|
@ -87,8 +87,7 @@ typedef unsigned long sslerr_t;
|
|||
|
||||
/* How to access `call_data` from a cf_osslq filter */
|
||||
#undef CF_CTX_CALL_DATA
|
||||
#define CF_CTX_CALL_DATA(cf) \
|
||||
((struct cf_osslq_ctx *)(cf)->ctx)->call_data
|
||||
#define CF_CTX_CALL_DATA(cf) ((struct cf_osslq_ctx *)(cf)->ctx)->call_data
|
||||
|
||||
static CURLcode cf_progress_ingress(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data);
|
||||
|
|
@ -954,7 +953,7 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id,
|
|||
(void)conn;
|
||||
|
||||
if(stream && stream->s.ssl) {
|
||||
SSL_STREAM_RESET_ARGS args = {0};
|
||||
SSL_STREAM_RESET_ARGS args = { 0 };
|
||||
args.quic_error_code = app_error_code;
|
||||
rv = !SSL_stream_reset(stream->s.ssl, &args, sizeof(args));
|
||||
CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv);
|
||||
|
|
|
|||
|
|
@ -65,11 +65,11 @@
|
|||
* stream buffer to not keep spares. Memory consumption goes down when streams
|
||||
* run empty, have a large upload done, etc. */
|
||||
#define H3_STREAM_POOL_SPARES \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE ) / 2
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE) / 2
|
||||
/* Receive and Send max number of chunks just follows from the
|
||||
* chunk size and window size */
|
||||
#define H3_STREAM_RECV_CHUNKS \
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
(H3_STREAM_WINDOW_SIZE / H3_STREAM_CHUNK_SIZE)
|
||||
|
||||
/*
|
||||
* Store quiche version info in this buffer.
|
||||
|
|
@ -1228,7 +1228,7 @@ static CURLcode cf_quiche_ctx_open(struct Curl_cfilter *cf,
|
|||
int rv;
|
||||
CURLcode result;
|
||||
const struct Curl_sockaddr_ex *sockaddr;
|
||||
static const struct alpn_spec ALPN_SPEC_H3 = {{ "h3" }, 1};
|
||||
static const struct alpn_spec ALPN_SPEC_H3 = { { "h3" }, 1 };
|
||||
|
||||
DEBUGASSERT(ctx->q.sockfd != CURL_SOCKET_BAD);
|
||||
DEBUGASSERT(ctx->initialized);
|
||||
|
|
|
|||
|
|
@ -178,12 +178,12 @@ CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx,
|
|||
if(!cert)
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
else if(peer->sni &&
|
||||
(wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, NULL)
|
||||
== WOLFSSL_FAILURE))
|
||||
(wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0,
|
||||
NULL) == WOLFSSL_FAILURE))
|
||||
result = CURLE_PEER_FAILED_VERIFICATION;
|
||||
else if(!peer->sni &&
|
||||
(wolfSSL_X509_check_ip_asc(cert, peer->hostname, 0)
|
||||
== WOLFSSL_FAILURE))
|
||||
(wolfSSL_X509_check_ip_asc(cert, peer->hostname,
|
||||
0) == WOLFSSL_FAILURE))
|
||||
result = CURLE_PEER_FAILED_VERIFICATION;
|
||||
wolfSSL_X509_free(cert);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
|
|||
CURLcode result = CURLE_OK;
|
||||
#ifdef HAVE_SENDMSG
|
||||
struct iovec msg_iov;
|
||||
struct msghdr msg = {0};
|
||||
struct msghdr msg = { 0 };
|
||||
ssize_t rv;
|
||||
#if defined(__linux__) && defined(UDP_SEGMENT)
|
||||
uint8_t msg_ctrl[32];
|
||||
|
|
@ -153,8 +153,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
|
|||
}
|
||||
#endif
|
||||
|
||||
while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 &&
|
||||
SOCKERRNO == SOCKEINTR)
|
||||
while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR)
|
||||
;
|
||||
|
||||
if(!curlx_sztouz(rv, psent)) {
|
||||
|
|
@ -516,7 +515,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf,
|
|||
}
|
||||
curlx_strerror(SOCKERRNO, errstr, sizeof(errstr));
|
||||
failf(data, "QUIC: recvmsg() unexpectedly returned %zd (errno=%d; %s)",
|
||||
rc, SOCKERRNO, errstr);
|
||||
rc, SOCKERRNO, errstr);
|
||||
result = CURLE_RECV_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -581,7 +580,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf,
|
|||
}
|
||||
curlx_strerror(SOCKERRNO, errstr, sizeof(errstr));
|
||||
failf(data, "QUIC: recvfrom() unexpectedly returned %zd (errno=%d; %s)",
|
||||
rv, SOCKERRNO, errstr);
|
||||
rv, SOCKERRNO, errstr);
|
||||
result = CURLE_RECV_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#ifdef USE_HTTP3
|
||||
|
||||
#define MAX_PKT_BURST 10
|
||||
#define MAX_PKT_BURST 10
|
||||
#define MAX_UDP_PAYLOAD_SIZE 1452
|
||||
|
||||
struct cf_quic_ctx {
|
||||
|
|
|
|||
|
|
@ -54,31 +54,31 @@
|
|||
#ifdef USE_APPLE_SECTRUST
|
||||
#define SSL_SYSTEM_VERIFIER
|
||||
|
||||
#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
|
||||
&& MAC_OS_X_VERSION_MAX_ALLOWED >= 101400) \
|
||||
|| (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \
|
||||
&& __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000)
|
||||
#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) && \
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED >= 101400) || \
|
||||
(defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \
|
||||
__IPHONE_OS_VERSION_MAX_ALLOWED >= 120000)
|
||||
#define SUPPORTS_SecTrustEvaluateWithError 1
|
||||
#endif
|
||||
|
||||
#if defined(SUPPORTS_SecTrustEvaluateWithError) \
|
||||
&& ((defined(MAC_OS_X_VERSION_MIN_REQUIRED) \
|
||||
&& MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) \
|
||||
|| (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) \
|
||||
&& __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000))
|
||||
#if defined(SUPPORTS_SecTrustEvaluateWithError) && \
|
||||
((defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || \
|
||||
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \
|
||||
__IPHONE_OS_VERSION_MIN_REQUIRED >= 120000))
|
||||
#define REQUIRES_SecTrustEvaluateWithError 1
|
||||
#endif
|
||||
|
||||
#if defined(SUPPORTS_SecTrustEvaluateWithError) \
|
||||
&& !defined(HAVE_BUILTIN_AVAILABLE) \
|
||||
&& !defined(REQUIRES_SecTrustEvaluateWithError)
|
||||
#if defined(SUPPORTS_SecTrustEvaluateWithError) && \
|
||||
!defined(HAVE_BUILTIN_AVAILABLE) && \
|
||||
!defined(REQUIRES_SecTrustEvaluateWithError)
|
||||
#undef SUPPORTS_SecTrustEvaluateWithError
|
||||
#endif
|
||||
|
||||
#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
|
||||
&& MAC_OS_X_VERSION_MAX_ALLOWED >= 100900) \
|
||||
|| (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \
|
||||
&& __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000)
|
||||
#if (defined(MAC_OS_X_VERSION_MAX_ALLOWED) && \
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED >= 100900) || \
|
||||
(defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \
|
||||
__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000)
|
||||
#define SUPPORTS_SecOCSP 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ struct cs_entry {
|
|||
};
|
||||
|
||||
/* !checksrc! disable COMMANOSPACE all */
|
||||
static const struct cs_entry cs_list [] = {
|
||||
static const struct cs_entry cs_list[] = {
|
||||
/* TLS 1.3 ciphers */
|
||||
#if defined(USE_MBEDTLS) || defined(USE_RUSTLS)
|
||||
CS_ENTRY(0x1301, TLS,AES,128,GCM,SHA256,,,),
|
||||
|
|
@ -549,7 +549,7 @@ static const struct cs_entry cs_list [] = {
|
|||
|
||||
static int cs_str_to_zip(const char *cs_str, size_t cs_len, uint8_t zip[6])
|
||||
{
|
||||
uint8_t indexes[8] = {0};
|
||||
uint8_t indexes[8] = { 0 };
|
||||
const char *entry, *cur;
|
||||
const char *nxt = cs_str;
|
||||
const char *end = cs_str + cs_len;
|
||||
|
|
@ -597,7 +597,7 @@ static int cs_str_to_zip(const char *cs_str, size_t cs_len, uint8_t zip[6])
|
|||
|
||||
static int cs_zip_to_str(const uint8_t zip[6], char *buf, size_t buf_size)
|
||||
{
|
||||
uint8_t indexes[8] = {0};
|
||||
uint8_t indexes[8] = { 0 };
|
||||
const char *entry;
|
||||
char separator = '-';
|
||||
int idx, i, r;
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
#define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend)
|
||||
|
||||
#define MAX_CAFILE_SIZE 1048576 /* 1 MiB */
|
||||
#define BEGIN_CERT "-----BEGIN CERTIFICATE-----"
|
||||
#define END_CERT "\n-----END CERTIFICATE-----"
|
||||
#define BEGIN_CERT "-----BEGIN CERTIFICATE-----"
|
||||
#define END_CERT "\n-----END CERTIFICATE-----"
|
||||
|
||||
struct cert_chain_engine_config_win8 {
|
||||
DWORD cbSize;
|
||||
|
|
@ -532,7 +532,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
DWORD actual_len = 0;
|
||||
PCERT_ALT_NAME_INFO alt_name_info = NULL;
|
||||
DWORD alt_name_info_size = 0;
|
||||
struct num_ip_data ip_blob = {0};
|
||||
struct num_ip_data ip_blob = { 0 };
|
||||
bool Win8_compat;
|
||||
struct num_ip_data *p = &ip_blob;
|
||||
DWORD i;
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ static const struct Curl_OID OIDtable[] = {
|
|||
{ "2.16.840.1.101.3.4.2.2", "sha384" },
|
||||
{ "2.16.840.1.101.3.4.2.3", "sha512" },
|
||||
{ "1.2.840.113549.1.9.2", "unstructuredName" },
|
||||
{ (const char *) NULL, (const char *) NULL }
|
||||
{ (const char *)NULL, (const char *)NULL }
|
||||
};
|
||||
|
||||
#endif /* WANT_EXTRACT_CERTINFO */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue