mirror of
https://github.com/curl/curl
synced 2026-08-25 12:32:35 -04:00
Merge branch 'master' into renovate/cloudflare-quiche-0.x
This commit is contained in:
commit
10dde71e5e
10 changed files with 44 additions and 28 deletions
2
.github/scripts/requirements.txt
vendored
2
.github/scripts/requirements.txt
vendored
|
|
@ -3,6 +3,6 @@
|
|||
# SPDX-License-Identifier: curl
|
||||
|
||||
cmakelang==0.6.13
|
||||
codespell==2.4.2
|
||||
codespell==2.4.3
|
||||
reuse==6.2.0
|
||||
ruff==0.15.16
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ We aim to support these or later versions:
|
|||
- ngtcp2 1.0.0 (2023-10-15), with OpenSSL 3.5.0+: 1.12.0 (2025-04-16)
|
||||
- OpenLDAP 2.0 (2000-08-01)
|
||||
- OpenSSL 3.0.0 (2021-09-07)
|
||||
- quiche 0.20.0 (2023-12-12)
|
||||
- Windows Vista 6.0 (2006-11-08 - 2012-04-10)
|
||||
- wolfSSL 5.0.0 (2021-11-01)
|
||||
- zlib 1.2.5.2 (2011-12-11)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
|
|||
xcharp_u passwd, dup_passwd;
|
||||
size_t domlen = 0;
|
||||
|
||||
domain.const_tchar_ptr = TEXT("");
|
||||
domain.const_tchar_ptr = _TEXT("");
|
||||
|
||||
/* Initialize the identity */
|
||||
memset(identity, 0, sizeof(*identity));
|
||||
|
|
@ -110,9 +110,9 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
|
|||
if(!useranddomain.tchar_ptr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('\\'));
|
||||
user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, _TEXT('\\'));
|
||||
if(!user.const_tchar_ptr)
|
||||
user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('/'));
|
||||
user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, _TEXT('/'));
|
||||
|
||||
if(user.tchar_ptr) {
|
||||
domain.tchar_ptr = useranddomain.tchar_ptr;
|
||||
|
|
@ -121,7 +121,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
|
|||
}
|
||||
else {
|
||||
user.tchar_ptr = useranddomain.tchar_ptr;
|
||||
domain.const_tchar_ptr = TEXT("");
|
||||
domain.const_tchar_ptr = _TEXT("");
|
||||
domlen = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static wchar_t *fn_convert_UTF8_to_wchar(const char *str_utf8)
|
|||
if(str_w_len > 0) {
|
||||
str_w = CURLX_MALLOC(str_w_len * sizeof(wchar_t));
|
||||
if(str_w) {
|
||||
if(MultiByteToWideChar(CP_UTF8, 0,
|
||||
if(MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
|
||||
str_utf8, -1, str_w, str_w_len) == 0) {
|
||||
CURLX_FREE(str_w);
|
||||
return NULL;
|
||||
|
|
@ -121,7 +121,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out)
|
|||
*out = NULL;
|
||||
|
||||
/* skip paths already normalized */
|
||||
if(!_tcsncmp(in, _T("\\\\?\\"), 4))
|
||||
if(!_tcsncmp(in, _TEXT("\\\\?\\"), 4))
|
||||
goto cleanup;
|
||||
|
||||
#ifndef _UNICODE
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8)
|
|||
if(str_w_len > 0) {
|
||||
str_w = curlx_malloc(str_w_len * sizeof(wchar_t));
|
||||
if(str_w) {
|
||||
if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w,
|
||||
str_w_len) == 0) {
|
||||
if(MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
|
||||
str_utf8, -1, str_w, str_w_len) == 0) {
|
||||
curlx_free(str_w);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ static CURLcode win32_idn_to_ascii(const char *in, char **out)
|
|||
/* Returned in_w_len includes the null-terminator, which then gets
|
||||
preserved across the calls that follow, ending up terminating
|
||||
the buffer returned to the caller. */
|
||||
in_w_len = MultiByteToWideChar(CP_UTF8, 0, in, -1, in_w, IDN_MAX_LENGTH);
|
||||
in_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
|
||||
in, -1, in_w, IDN_MAX_LENGTH);
|
||||
if(in_w_len) {
|
||||
wchar_t punycode[IDN_MAX_LENGTH];
|
||||
int chars = IdnToAscii(0, in_w, in_w_len, punycode, IDN_MAX_LENGTH);
|
||||
|
|
@ -198,7 +199,8 @@ static CURLcode win32_ascii_to_idn(const char *in, char **out)
|
|||
/* Returned in_w_len includes the null-terminator, which then gets
|
||||
preserved across the calls that follow, ending up terminating
|
||||
the buffer returned to the caller. */
|
||||
in_w_len = MultiByteToWideChar(CP_UTF8, 0, in, -1, in_w, IDN_MAX_LENGTH);
|
||||
in_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
|
||||
in, -1, in_w, IDN_MAX_LENGTH);
|
||||
if(in_w_len) {
|
||||
WCHAR idn[IDN_MAX_LENGTH]; /* stores a UTF-16 string */
|
||||
int chars = IdnToUnicode(0, in_w, in_w_len, idn, IDN_MAX_LENGTH);
|
||||
|
|
|
|||
|
|
@ -419,6 +419,11 @@ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
|
|||
return cursize;
|
||||
}
|
||||
|
||||
/* The maximum input size that does not cause an overflow. */
|
||||
#define BASE64_MAX_INPUT_SIZE \
|
||||
(((CURL_OFF_T_MAX / (MAX_ENCODED_LINE_LENGTH + 2)) * \
|
||||
MAX_ENCODED_LINE_LENGTH / 4) * 3 - 3)
|
||||
|
||||
static curl_off_t encoder_base64_size(curl_mimepart *part)
|
||||
{
|
||||
curl_off_t size = part->datasize;
|
||||
|
|
@ -426,6 +431,10 @@ static curl_off_t encoder_base64_size(curl_mimepart *part)
|
|||
if(size <= 0)
|
||||
return size; /* Unknown size or no data. */
|
||||
|
||||
/* Prevent integer overflows */
|
||||
if(size > BASE64_MAX_INPUT_SIZE)
|
||||
return -1;
|
||||
|
||||
/* Compute base64 character count. */
|
||||
size = 4 * (1 + ((size - 1) / 3));
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "connect.h"
|
||||
#include "progress.h"
|
||||
#include "select.h"
|
||||
#include "http.h"
|
||||
#include "http1.h"
|
||||
#include "sockaddr.h"
|
||||
#include "vquic/vquic.h"
|
||||
|
|
@ -1429,6 +1430,10 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf,
|
|||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
}
|
||||
/* quiche 0.29.3+ rejects response headers larger than 32 KiB by
|
||||
default. Allow as much as curl itself accepts. */
|
||||
quiche_h3_config_set_max_field_section_size(ctx->h3config,
|
||||
MAX_HTTP_RESP_HEADER_SIZE);
|
||||
|
||||
/* Create a new HTTP/3 connection on the QUIC connection. */
|
||||
ctx->h3c = quiche_h3_conn_new_with_transport(ctx->qconn, ctx->h3config);
|
||||
|
|
|
|||
|
|
@ -316,34 +316,35 @@ static CURLcode get_cert_location(TCHAR *path, DWORD *store_name,
|
|||
TCHAR *store_path_start;
|
||||
size_t store_name_len;
|
||||
|
||||
sep = _tcschr(path, TEXT('\\'));
|
||||
sep = _tcschr(path, _TEXT('\\'));
|
||||
if(!sep)
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
|
||||
store_name_len = sep - path;
|
||||
|
||||
if(_tcsncmp(path, TEXT("CurrentUser"), store_name_len) == 0)
|
||||
if(_tcsncmp(path, _TEXT("CurrentUser"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_CURRENT_USER;
|
||||
else if(_tcsncmp(path, TEXT("LocalMachine"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("LocalMachine"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_LOCAL_MACHINE;
|
||||
else if(_tcsncmp(path, TEXT("CurrentService"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("CurrentService"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_CURRENT_SERVICE;
|
||||
else if(_tcsncmp(path, TEXT("Services"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("Services"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_SERVICES;
|
||||
else if(_tcsncmp(path, TEXT("Users"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("Users"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_USERS;
|
||||
else if(_tcsncmp(path, TEXT("CurrentUserGroupPolicy"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("CurrentUserGroupPolicy"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY;
|
||||
else if(_tcsncmp(path, TEXT("LocalMachineGroupPolicy"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("LocalMachineGroupPolicy"), store_name_len) ==
|
||||
0)
|
||||
*store_name = CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY;
|
||||
else if(_tcsncmp(path, TEXT("LocalMachineEnterprise"), store_name_len) == 0)
|
||||
else if(_tcsncmp(path, _TEXT("LocalMachineEnterprise"), store_name_len) == 0)
|
||||
*store_name = CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE;
|
||||
else
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
|
||||
store_path_start = sep + 1;
|
||||
|
||||
sep = _tcschr(store_path_start, TEXT('\\'));
|
||||
sep = _tcschr(store_path_start, _TEXT('\\'));
|
||||
if(!sep)
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
|
||||
|
|
@ -351,9 +352,9 @@ static CURLcode get_cert_location(TCHAR *path, DWORD *store_name,
|
|||
if(_tcslen(*thumbprint) != CERT_THUMBPRINT_STR_LEN)
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
|
||||
*sep = TEXT('\0');
|
||||
*sep = _TEXT('\0');
|
||||
*store_path = curlx_tcsdup(store_path_start);
|
||||
*sep = TEXT('\\');
|
||||
*sep = _TEXT('\\');
|
||||
if(!*store_path)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
|
|
@ -473,10 +474,8 @@ static CURLcode get_client_cert(struct Curl_cfilter *cf,
|
|||
if(pszPassword) {
|
||||
int str_w_len = 0;
|
||||
if(pwd_len > 0)
|
||||
str_w_len = MultiByteToWideChar(CP_UTF8,
|
||||
MB_ERR_INVALID_CHARS,
|
||||
sslc->key_passwd,
|
||||
(int)pwd_len,
|
||||
str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
|
||||
sslc->key_passwd, (int)pwd_len,
|
||||
pszPassword, (int)(pwd_len + 1));
|
||||
|
||||
if((str_w_len >= 0) && (str_w_len <= (int)pwd_len))
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ int main(int argc, char *argv[])
|
|||
#ifdef _WIN32
|
||||
/* Undocumented diagnostic option to list the full paths of all loaded
|
||||
modules. This is purposely pre-init. */
|
||||
if(argc == 2 && !_tcscmp(argv[1], _T("--dump-module-paths"))) {
|
||||
if(argc == 2 && !_tcscmp(argv[1], _TEXT("--dump-module-paths"))) {
|
||||
struct curl_slist *item, *head = GetLoadedModulePaths();
|
||||
for(item = head; item; item = item->next)
|
||||
curl_mprintf("%s\n", item->data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue