build: drop Windows CE / CeGCC support

Windows CE support was limited to successful builds with ming32ce
(a toolchain that hasn't seen an update since 2009, using an ancient gcc
version and "old mingw"-style SDK headers, that curl deprecated earlier).
Builds with MSVC were broken for a long time. mingw32ce builds were never
actually tested and runtime and unlikely to work due to missing stubs.
Windows CE toolchains also miss to comply with C89. Paired with lack of
demand and support for the platform, curl deprecated it earlier.

This patch removes support from the codebase to ease maintaining Windows
codepaths.

Follow-up to f98c0ba834 #17924
Follow-up to 8491e6574c #17379
Follow-up to 2a292c3984 #15975

Closes #17927
This commit is contained in:
Viktor Szakats 2025-07-15 00:36:08 +02:00
parent 2dc71ba8bf
commit 554dfa5568
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
81 changed files with 166 additions and 975 deletions

View file

@ -473,7 +473,7 @@ static bool async_thrdd_init(struct Curl_easy *data,
err_exit:
CURL_TRC_DNS(data, "resolve thread failed init: %d", err);
async_thrdd_destroy(data);
CURL_SETERRNO(err);
errno = err;
return FALSE;
}

View file

@ -853,24 +853,11 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
*
* Someone got to verify this on Win-NT 4.0, 2000."
*/
#ifdef UNDER_CE
Sleep(0);
#else
SleepEx(0, FALSE);
#endif
#endif
if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize))
err = SOCKERRNO;
#ifdef UNDER_CE
/* Old Windows CE versions do not support SO_ERROR */
if(WSAENOPROTOOPT == err) {
SET_SOCKERRNO(0);
err = 0;
}
#endif
#if defined(EBADIOCTL) && defined(__minix)
/* Minix 3.1.x does not support getsockopt on UDP sockets */
if(EBADIOCTL == err) {

View file

@ -28,8 +28,6 @@
/* Hand crafted config file for Windows */
/* ================================================================ */
#ifndef UNDER_CE
/* Define some minimum and default build targets for Visual Studio */
#ifdef _MSC_VER
/* VS2012 default target settings and minimum build target check. */
@ -78,8 +76,6 @@
# endif
#endif /* _MSC_VER */
#endif /* UNDER_CE */
/* ---------------------------------------------------------------- */
/* HEADER FILES */
/* ---------------------------------------------------------------- */
@ -87,19 +83,15 @@
/* Define if you have the <arpa/inet.h> header file. */
/* #define HAVE_ARPA_INET_H 1 */
#ifndef UNDER_CE
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1 /* exists on __MINGW32CE__ */
#define HAVE_FCNTL_H 1
/* Define if you have the <io.h> header file. */
#define HAVE_IO_H 1 /* exists on __MINGW32CE__ */
#define HAVE_IO_H 1
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
#endif
/* Define if you have the <netdb.h> header file. */
/* #define HAVE_NETDB_H 1 */
@ -107,10 +99,8 @@
/* #define HAVE_NETINET_IN_H 1 */
/* Define to 1 if you have the <stdbool.h> header file. */
#ifndef UNDER_CE
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_STDBOOL_H 1 /* exists on __MINGW32CE__ */
#endif
#define HAVE_STDBOOL_H 1
#endif
/* Define to 1 if you have the <stdint.h> header file. */
@ -159,10 +149,8 @@
#define STDC_HEADERS 1
/* Define to 1 if bool is an available type. */
#ifndef UNDER_CE
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_BOOL_T 1 /* exists on __MINGW32CE__ */
#endif
#define HAVE_BOOL_T 1
#endif
/* ---------------------------------------------------------------- */
@ -200,7 +188,6 @@
/* Define if you have the select function. */
#define HAVE_SELECT 1
#ifndef UNDER_CE
/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
@ -209,7 +196,6 @@
/* Define if you have the _setmode function. */
#define HAVE__SETMODE 1
#endif
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
@ -276,9 +262,7 @@
#endif
/* Define to 1 if you have the signal function. */
#ifndef UNDER_CE
#define HAVE_SIGNAL 1
#endif
/* ---------------------------------------------------------------- */
/* TYPEDEF REPLACEMENTS */
@ -347,11 +331,9 @@
#endif
/* Windows XP is required for freeaddrinfo, getaddrinfo */
#ifndef UNDER_CE
#define HAVE_FREEADDRINFO 1
#define HAVE_GETADDRINFO 1
#define HAVE_GETADDRINFO_THREADSAFE 1
#endif
/* ---------------------------------------------------------------- */
/* STRUCT RELATED */
@ -370,8 +352,6 @@
/* LARGE FILE SUPPORT */
/* ---------------------------------------------------------------- */
#ifndef UNDER_CE
#if defined(_MSC_VER) || defined(__MINGW32__)
# define USE_WIN32_LARGE_FILES
/* Number of bits in a file offset, on hosts where this is settable. */
@ -390,8 +370,6 @@
# define SIZEOF_OFF_T 4
#endif
#endif /* UNDER_CE */
/* ---------------------------------------------------------------- */
/* DNS RESOLVER SPECIALTY */
/* ---------------------------------------------------------------- */
@ -420,7 +398,7 @@
#ifdef CURL_HAS_OPENLDAP_LDAPSDK
#undef USE_WIN32_LDAP
#define HAVE_LDAP_URL_PARSE 1
#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#elif !defined(CURL_WINDOWS_UWP)
#undef HAVE_LDAP_URL_PARSE
#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
@ -432,9 +410,7 @@
#endif
/* Define to use Unix sockets. */
#ifndef UNDER_CE
#define USE_UNIX_SOCKETS
#endif
/* ---------------------------------------------------------------- */
/* ADDITIONAL DEFINITIONS */
@ -442,52 +418,19 @@
/* Define cpu-machine-OS */
#ifndef CURL_OS
# ifdef UNDER_CE
# ifdef _M_ARM
# define CURL_OS "arm-pc-win32ce"
# else
# define CURL_OS "i386-pc-win32ce"
# endif
# else /* !UNDER_CE */
# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
# define CURL_OS "i386-pc-win32"
# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */
# define CURL_OS "x86_64-pc-win32"
# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
# define CURL_OS "ia64-pc-win32"
# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */
# define CURL_OS "thumbv7a-pc-win32"
# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
# define CURL_OS "aarch64-pc-win32"
# else
# define CURL_OS "unknown-pc-win32"
# endif
# endif /* UNDER_CE */
# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
# define CURL_OS "i386-pc-win32"
# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */
# define CURL_OS "x86_64-pc-win32"
# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
# define CURL_OS "ia64-pc-win32"
# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */
# define CURL_OS "thumbv7a-pc-win32"
# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
# define CURL_OS "aarch64-pc-win32"
# else
# define CURL_OS "unknown-pc-win32"
# endif
#endif /* !CURL_OS */
/* ---------------------------------------------------------------- */
/* Windows CE */
/* ---------------------------------------------------------------- */
#ifdef UNDER_CE
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#define CURL_DISABLE_FILE 1
#define CURL_DISABLE_TELNET 1
#define CURL_DISABLE_LDAP 1
#ifndef _MSC_VER
/* !checksrc! disable BANNEDFUNC 1 */
extern int stat(const char *path, struct stat *buffer);
#endif
#endif /* UNDER_CE */
#endif /* HEADER_CURL_CONFIG_WIN32_H */

View file

@ -280,7 +280,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
addr[0] = '\0';
*port = 0;
CURL_SETERRNO(SOCKEAFNOSUPPORT);
errno = SOCKEAFNOSUPPORT;
return FALSE;
}

View file

@ -101,14 +101,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
*fh = curlx_fopen(filename, FOPEN_WRITETEXT);
if(!*fh)
goto fail;
if(
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
stat(filename, &sb) == -1
#else
fstat(fileno(*fh), &sb) == -1
#endif
|| !S_ISREG(sb.st_mode)) {
if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) {
return CURLE_OK;
}
curlx_fclose(*fh);

View file

@ -75,7 +75,7 @@
#endif
#endif
#if defined(__MINGW32__) && !defined(__MINGW32CE__) && \
#if defined(__MINGW32__) && \
(!defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 3))
#error "Building curl requires mingw-w64 3.0 or later"
#endif
@ -122,14 +122,6 @@
# endif
#endif
/* Avoid bogus format check warnings with mingw32ce gcc 4.4.0 in
C99 (-std=gnu99) mode */
#if defined(__MINGW32CE__) && !defined(CURL_NO_FMT_CHECKS) && \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) && \
(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4))
#define CURL_NO_FMT_CHECKS
#endif
/* Compatibility */
#ifdef ENABLE_IPV6
#define USE_IPV6 1
@ -497,12 +489,10 @@
# define LSEEK_ERROR (__int64)-1
# else
/* Small file (<2Gb) support using Win32 functions. */
# ifndef UNDER_CE
# undef lseek
# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence)
# define fstat(fdes, stp) _fstat(fdes, stp)
# define struct_stat struct _stat
# endif
# undef lseek
# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence)
# define fstat(fdes, stp) _fstat(fdes, stp)
# define struct_stat struct _stat
# define LSEEK_ERROR (long)-1
# endif
#elif defined(__DJGPP__)
@ -817,27 +807,6 @@
#include "curl_setup_once.h"
#endif
#ifdef UNDER_CE
#define getenv curl_getenv /* Windows CE does not support getenv() */
#define raise(s) ((void)(s))
/* Terrible workarounds to make Windows CE compile */
#define errno 0
#define CURL_SETERRNO(x) ((void)(x))
#define EINTR 4
#define EAGAIN 11
#define ENOMEM 12
#define EACCES 13
#define EEXIST 17
#define EISDIR 21
#define EINVAL 22
#define ENOSPC 28
#define strerror(x) "?"
#undef STDIN_FILENO
#define STDIN_FILENO 0
#else
#define CURL_SETERRNO(x) (errno = (x))
#endif
/*
* Definition of our NOP statement Object-like macro
*/
@ -926,7 +895,7 @@ endings either CRLF or LF so 't' is appropriate.
/* for systems that do not detect this in configure */
#ifndef CURL_SA_FAMILY_T
# if defined(_WIN32) && !defined(UNDER_CE)
# ifdef _WIN32
# define CURL_SA_FAMILY_T ADDRESS_FAMILY
# elif defined(HAVE_SA_FAMILY_T)
# define CURL_SA_FAMILY_T sa_family_t

View file

@ -33,9 +33,7 @@
#include <string.h>
#include <stdarg.h>
#include <time.h>
#ifndef UNDER_CE
#include <errno.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@ -356,7 +354,7 @@ typedef unsigned int bit;
#ifdef __VMS
#define argv_item_t __char_ptr32
#elif defined(_UNICODE) && !defined(UNDER_CE)
#elif defined(_UNICODE)
#define argv_item_t wchar_t *
#else
#define argv_item_t char *

View file

@ -62,11 +62,7 @@ CURLcode Curl_sspi_global_init(void)
/* If security interface is not yet initialized try to do this */
if(!Curl_pSecFn) {
/* Get pointer to Security Service Provider Interface dispatch table */
#ifdef __MINGW32CE__
Curl_pSecFn = InitSecurityInterfaceW();
#else
Curl_pSecFn = InitSecurityInterface();
#endif
if(!Curl_pSecFn)
return CURLE_FAILED_INIT;
}

View file

@ -70,225 +70,6 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define ISC_REQ_USE_HTTP_STYLE 0x01000000
#endif
#ifdef __MINGW32CE__
#ifndef ISC_RET_REPLAY_DETECT
#define ISC_RET_REPLAY_DETECT 0x00000004
#endif
#ifndef ISC_RET_SEQUENCE_DETECT
#define ISC_RET_SEQUENCE_DETECT 0x00000008
#endif
#ifndef ISC_RET_CONFIDENTIALITY
#define ISC_RET_CONFIDENTIALITY 0x00000010
#endif
#ifndef ISC_RET_ALLOCATED_MEMORY
#define ISC_RET_ALLOCATED_MEMORY 0x00000100
#endif
#ifndef ISC_RET_STREAM
#define ISC_RET_STREAM 0x00008000
#endif
#ifndef SEC_E_INSUFFICIENT_MEMORY
#define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L)
#endif
#ifndef SEC_E_INVALID_HANDLE
#define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L)
#endif
#ifndef SEC_E_UNSUPPORTED_FUNCTION
#define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L)
#endif
#ifndef SEC_E_TARGET_UNKNOWN
#define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L)
#endif
#ifndef SEC_E_INTERNAL_ERROR
#define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L)
#endif
#ifndef SEC_E_SECPKG_NOT_FOUND
#define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L)
#endif
#ifndef SEC_E_NOT_OWNER
#define SEC_E_NOT_OWNER ((HRESULT)0x80090306L)
#endif
#ifndef SEC_E_CANNOT_INSTALL
#define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L)
#endif
#ifndef SEC_E_INVALID_TOKEN
#define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L)
#endif
#ifndef SEC_E_CANNOT_PACK
#define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L)
#endif
#ifndef SEC_E_QOP_NOT_SUPPORTED
#define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL)
#endif
#ifndef SEC_E_NO_IMPERSONATION
#define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL)
#endif
#ifndef SEC_E_LOGON_DENIED
#define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL)
#endif
#ifndef SEC_E_UNKNOWN_CREDENTIALS
#define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL)
#endif
#ifndef SEC_E_NO_CREDENTIALS
#define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL)
#endif
#ifndef SEC_E_MESSAGE_ALTERED
#define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL)
#endif
#ifndef SEC_E_OUT_OF_SEQUENCE
#define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L)
#endif
#ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY
#define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L)
#endif
#ifndef SEC_E_BAD_PKGID
#define SEC_E_BAD_PKGID ((HRESULT)0x80090316L)
#endif
#ifndef SEC_E_CONTEXT_EXPIRED
#define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L)
#endif
#ifndef SEC_E_INCOMPLETE_MESSAGE
#define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L)
#endif
#ifndef SEC_E_INCOMPLETE_CREDENTIALS
#define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L)
#endif
#ifndef SEC_E_BUFFER_TOO_SMALL
#define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L)
#endif
#ifndef SEC_E_WRONG_PRINCIPAL
#define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L)
#endif
#ifndef SEC_E_TIME_SKEW
#define SEC_E_TIME_SKEW ((HRESULT)0x80090324L)
#endif
#ifndef SEC_E_UNTRUSTED_ROOT
#define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L)
#endif
#ifndef SEC_E_ILLEGAL_MESSAGE
#define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L)
#endif
#ifndef SEC_E_CERT_UNKNOWN
#define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L)
#endif
#ifndef SEC_E_CERT_EXPIRED
#define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L)
#endif
#ifndef SEC_E_ENCRYPT_FAILURE
#define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L)
#endif
#ifndef SEC_E_DECRYPT_FAILURE
#define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L)
#endif
#ifndef SEC_E_ALGORITHM_MISMATCH
#define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L)
#endif
#ifndef SEC_E_SECURITY_QOS_FAILED
#define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L)
#endif
#ifndef SEC_E_UNFINISHED_CONTEXT_DELETED
#define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L)
#endif
#ifndef SEC_E_NO_TGT_REPLY
#define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L)
#endif
#ifndef SEC_E_NO_IP_ADDRESSES
#define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L)
#endif
#ifndef SEC_E_WRONG_CREDENTIAL_HANDLE
#define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L)
#endif
#ifndef SEC_E_CRYPTO_SYSTEM_INVALID
#define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L)
#endif
#ifndef SEC_E_MAX_REFERRALS_EXCEEDED
#define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L)
#endif
#ifndef SEC_E_MUST_BE_KDC
#define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L)
#endif
#ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED
#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL)
#endif
#ifndef SEC_E_TOO_MANY_PRINCIPALS
#define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL)
#endif
#ifndef SEC_E_NO_PA_DATA
#define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL)
#endif
#ifndef SEC_E_PKINIT_NAME_MISMATCH
#define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL)
#endif
#ifndef SEC_E_SMARTCARD_LOGON_REQUIRED
#define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL)
#endif
#ifndef SEC_E_SHUTDOWN_IN_PROGRESS
#define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL)
#endif
#ifndef SEC_E_KDC_INVALID_REQUEST
#define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L)
#endif
#ifndef SEC_E_KDC_UNABLE_TO_REFER
#define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L)
#endif
#ifndef SEC_E_KDC_UNKNOWN_ETYPE
#define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L)
#endif
#ifndef SEC_E_UNSUPPORTED_PREAUTH
#define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L)
#endif
#ifndef SEC_E_DELEGATION_REQUIRED
#define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L)
#endif
#ifndef SEC_E_BAD_BINDINGS
#define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L)
#endif
#ifndef SEC_E_MULTIPLE_ACCOUNTS
#define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L)
#endif
#ifndef SEC_E_NO_KERB_KEY
#define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L)
#endif
#ifndef SEC_E_CERT_WRONG_USAGE
#define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L)
#endif
#ifndef SEC_E_DOWNGRADE_DETECTED
#define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L)
#endif
#ifndef SEC_E_SMARTCARD_CERT_REVOKED
#define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L)
#endif
#ifndef SEC_E_ISSUING_CA_UNTRUSTED
#define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L)
#endif
#ifndef SEC_E_REVOCATION_OFFLINE_C
#define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L)
#endif
#ifndef SEC_E_PKINIT_CLIENT_FAILURE
#define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L)
#endif
#ifndef SEC_E_SMARTCARD_CERT_EXPIRED
#define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L)
#endif
#ifndef SEC_E_NO_S4U_PROT_SUPPORT
#define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L)
#endif
#ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE
#define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L)
#endif
#ifndef SEC_E_REVOCATION_OFFLINE_KDC
#define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L)
#endif
#ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC
#define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L)
#endif
#ifndef SEC_E_KDC_CERT_EXPIRED
#define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL)
#endif
#ifndef SEC_E_KDC_CERT_REVOKED
#define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL)
#endif
#endif /* __MINGW32CE__ */
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_E_INVALID_PARAMETER
#define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL)
@ -302,44 +83,11 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL)
#endif
#ifdef __MINGW32CE__
#ifndef SEC_I_CONTINUE_NEEDED
#define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L)
#endif
#ifndef SEC_I_COMPLETE_NEEDED
#define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L)
#endif
#ifndef SEC_I_COMPLETE_AND_CONTINUE
#define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L)
#endif
#ifndef SEC_I_LOCAL_LOGON
#define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L)
#endif
#ifndef SEC_I_CONTEXT_EXPIRED
#define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L)
#endif
#ifndef SEC_I_INCOMPLETE_CREDENTIALS
#define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L)
#endif
#ifndef SEC_I_RENEGOTIATE
#define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L)
#endif
#ifndef SEC_I_NO_LSA_CONTEXT
#define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L)
#endif
#endif /* __MINGW32CE__ */
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_I_SIGNATURE_NEEDED
#define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL)
#endif
#ifdef __MINGW32CE__
#ifndef CRYPT_E_NOT_IN_REVOCATION_DATABASE
#define CRYPT_E_NOT_IN_REVOCATION_DATABASE ((HRESULT)0x80092014L)
#endif
#endif /* __MINGW32CE__ */
/*
* Definitions required from ntsecapi.h are directly provided below this point
* to avoid including ntsecapi.h due to a conflict with OpenSSL's safestack.h

View file

@ -69,7 +69,7 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
rc = pthread_create(t, NULL, curl_thread_create_thunk, ac);
if(rc) {
CURL_SETERRNO(rc);
errno = rc;
goto err;
}
@ -109,10 +109,9 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
if(!t) {
DWORD gle = GetLastError();
/* !checksrc! disable ERRNOVAR 1 */
int err = (gle == ERROR_ACCESS_DENIED ||
gle == ERROR_NOT_ENOUGH_MEMORY) ?
EACCES : EINVAL;
CURL_SETERRNO(err);
errno = (gle == ERROR_ACCESS_DENIED ||
gle == ERROR_NOT_ENOUGH_MEMORY) ?
EACCES : EINVAL;
return curl_thread_t_null;
}
return t;
@ -128,11 +127,7 @@ void Curl_thread_destroy(curl_thread_t *hnd)
int Curl_thread_join(curl_thread_t *hnd)
{
#ifdef UNDER_CE
int ret = (WaitForSingleObject(*hnd, INFINITE) == WAIT_OBJECT_0);
#else
int ret = (WaitForSingleObjectEx(*hnd, INFINITE, FALSE) == WAIT_OBJECT_0);
#endif
Curl_thread_destroy(hnd);

View file

@ -47,7 +47,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence)
#endif
}
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
#include "multibyte.h"
@ -235,7 +235,7 @@ int curlx_win32_open(const char *filename, int oflag, ...)
}
else
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(EINVAL);
errno = EINVAL;
#else
if(fix_excessive_path(filename, &fixed))
target = fixed;
@ -266,7 +266,7 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode)
}
else
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(EINVAL);
errno = EINVAL;
curlx_unicodefree(filename_w);
curlx_unicodefree(mode_w);
#else
@ -304,7 +304,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer)
}
else
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(EINVAL);
errno = EINVAL;
#else
if(fix_excessive_path(path, &fixed))
target = fixed;
@ -321,4 +321,4 @@ int curlx_win32_stat(const char *path, struct_stat *buffer)
return result;
}
#endif /* _WIN32 && !UNDER_CE */
#endif /* _WIN32 */

View file

@ -34,7 +34,7 @@
int curlx_fseek(void *stream, curl_off_t offset, int whence);
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
FILE *curlx_win32_fopen(const char *filename, const char *mode);
int curlx_win32_stat(const char *path, struct_stat *buffer);
int curlx_win32_open(const char *filename, int oflag, ...);

View file

@ -72,9 +72,9 @@ static char *inet_ntop4(const unsigned char *src, char *dst, size_t size)
len = strlen(tmp);
if(len == 0 || len >= size) {
#ifdef USE_WINSOCK
CURL_SETERRNO(WSAEINVAL);
errno = WSAEINVAL;
#else
CURL_SETERRNO(ENOSPC);
errno = ENOSPC;
#endif
return NULL;
}
@ -186,9 +186,9 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
*/
if((size_t)(tp - tmp) > size) {
#ifdef USE_WINSOCK
CURL_SETERRNO(WSAEINVAL);
errno = WSAEINVAL;
#else
CURL_SETERRNO(ENOSPC);
errno = ENOSPC;
#endif
return NULL;
}
@ -215,7 +215,7 @@ char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size)
case AF_INET6:
return inet_ntop6((const unsigned char *)src, buf, size);
default:
CURL_SETERRNO(SOCKEAFNOSUPPORT);
errno = SOCKEAFNOSUPPORT;
return NULL;
}
}

View file

@ -82,7 +82,7 @@ curlx_inet_pton(int af, const char *src, void *dst)
case AF_INET6:
return inet_pton6(src, (unsigned char *)dst);
default:
CURL_SETERRNO(SOCKEAFNOSUPPORT);
errno = SOCKEAFNOSUPPORT;
return -1;
}
/* NOTREACHED */

View file

@ -287,13 +287,10 @@ const char *curlx_strerror(int err, char *buf, size_t buflen)
*buf = '\0';
#ifdef _WIN32
#ifndef UNDER_CE
/* 'sys_nerr' is the maximum errno number, it is not widely portable */
if(err >= 0 && err < sys_nerr)
SNPRINTF(buf, buflen, "%s", sys_errlist[err]);
else
#endif
{
else {
if(
#ifdef USE_WINSOCK
!get_winsock_error(err, buf, buflen) &&
@ -350,7 +347,7 @@ const char *curlx_strerror(int err, char *buf, size_t buflen)
*p = '\0';
if(errno != old_errno)
CURL_SETERRNO(old_errno);
errno = old_errno;
#ifdef _WIN32
if(old_win_err != GetLastError())

View file

@ -111,12 +111,6 @@ bool curlx_verify_windows_version(const unsigned int majorVersion,
/* we are always running on PLATFORM_WINNT */
matched = FALSE;
}
#elif defined(UNDER_CE)
(void)majorVersion;
(void)minorVersion;
(void)buildVersion;
(void)platform;
(void)condition;
#else
ULONGLONG cm = 0;
struct OUR_OSVERSIONINFOEXW osver;
@ -139,7 +133,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion,
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
#endif
pRtlVerifyVersionInfo = CURLX_FUNCTION_CAST(RTLVERIFYVERSIONINFO_FN,
GetProcAddress(GetModuleHandleA("ntdll"), "RtlVerifyVersionInfo"));
GetProcAddress(GetModuleHandle(TEXT("ntdll")), "RtlVerifyVersionInfo"));
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic pop
#endif

View file

@ -61,8 +61,7 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen)
/* We return the local codepage version of the error string because if it is
output to the user's terminal it will likely be with functions which
expect the local codepage (eg fprintf, failf, infof).
FormatMessageW -> wcstombs is used for Windows CE compatibility. */
expect the local codepage (eg fprintf, failf, infof). */
if(FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err,
LANG_NEUTRAL, wbuf, CURL_ARRAYSIZE(wbuf), NULL)) {
@ -118,7 +117,7 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen)
#endif
if(errno != old_errno)
CURL_SETERRNO(old_errno);
errno = old_errno;
if(old_win_err != GetLastError())
SetLastError(old_win_err);

View file

@ -106,12 +106,10 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT;
* ways, but at this point it must be defined as the system-supplied strdup
* so the callback pointer is initialized correctly.
*/
#ifdef UNDER_CE
#define system_strdup _strdup
#elif !defined(HAVE_STRDUP)
#define system_strdup Curl_strdup
#else
#ifdef HAVE_STRDUP
#define system_strdup strdup
#else
#define system_strdup Curl_strdup
#endif
#if defined(_MSC_VER) && defined(_DLL)

View file

@ -572,7 +572,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done)
if(data->state.resume_from) {
if(!S_ISDIR(statbuf.st_mode)) {
#if defined(__AMIGA__) || defined(__MINGW32CE__)
#ifdef __AMIGA__
if(data->state.resume_from !=
lseek(fd, (off_t)data->state.resume_from, SEEK_SET))
#else

View file

@ -3311,10 +3311,6 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
/* shut down the socket to inform the server we are done */
#ifdef UNDER_CE
shutdown(conn->sock[SECONDARYSOCKET], 2); /* SD_BOTH */
#endif
if(Curl_conn_is_setup(conn, SECONDARYSOCKET)) {
if(!result && ftpc->dont_check && data->req.maxdownload > 0) {
/* partial download completed */

View file

@ -31,7 +31,7 @@
static char *GetEnv(const char *variable)
{
#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE) || \
#if defined(CURL_WINDOWS_UWP) || \
defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */
(void)variable;
return NULL;

View file

@ -42,9 +42,7 @@
#endif
#include <setjmp.h>
#ifndef UNDER_CE
#include <signal.h>
#endif
#include "urldata.h"
#include "sendf.h"

View file

@ -133,12 +133,7 @@ static int MD4_Init(MD4_CTX *ctx)
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
{
#ifdef __MINGW32CE__
CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(data),
(unsigned int) size, 0);
#else
CryptHashData(ctx->hHash, (const BYTE *)data, (unsigned int) size, 0);
#endif
}
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)

View file

@ -240,11 +240,7 @@ static void my_md5_update(void *in,
unsigned int inputLen)
{
my_md5_ctx *ctx = in;
#ifdef __MINGW32CE__
CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(input), inputLen, 0);
#else
CryptHashData(ctx->hHash, (const BYTE *)input, inputLen, 0);
#endif
}
static void my_md5_final(unsigned char *digest, void *in)

View file

@ -117,7 +117,7 @@ static bool countcheck(const char *func, int line, const char *source)
source, line, func);
fflush(curl_dbg_logfile); /* because it might crash now */
/* !checksrc! disable ERRNOVAR 1 */
CURL_SETERRNO(ENOMEM);
errno = ENOMEM;
return TRUE; /* RETURN ERROR! */
}
else

View file

@ -39,7 +39,7 @@
/* return 0 on success, 1 on error */
int Curl_rename(const char *oldpath, const char *newpath)
{
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
/* rename() on Windows does not overwrite, so we cannot use it here.
MoveFileEx() will overwrite and is usually atomic, however it fails
when there are open handles to the file. */

View file

@ -214,11 +214,7 @@ static void my_sha256_update(void *in,
unsigned int length)
{
my_sha256_ctx *ctx = (my_sha256_ctx *)in;
#ifdef __MINGW32CE__
CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(data), length, 0);
#else
CryptHashData(ctx->hHash, (const BYTE *)data, length, 0);
#endif
}
static void my_sha256_final(unsigned char *digest, void *in)

View file

@ -679,7 +679,7 @@ const char *Curl_sspi_strerror(SECURITY_STATUS err, char *buf, size_t buflen)
#endif
if(errno != old_errno)
CURL_SETERRNO(old_errno);
errno = old_errno;
#ifdef _WIN32
if(old_win_err != GetLastError())

View file

@ -99,15 +99,9 @@ CURLcode Curl_win32_init(long flags)
s_hIpHlpApiDll = curl_load_library(TEXT("iphlpapi.dll"));
if(s_hIpHlpApiDll) {
/* Get the address of the if_nametoindex function */
#ifdef UNDER_CE
#define CURL_TEXT(n) TEXT(n)
#else
#define CURL_TEXT(n) (n)
#endif
IF_NAMETOINDEX_FN pIfNameToIndex =
CURLX_FUNCTION_CAST(IF_NAMETOINDEX_FN,
GetProcAddress(s_hIpHlpApiDll,
CURL_TEXT("if_nametoindex")));
GetProcAddress(s_hIpHlpApiDll, "if_nametoindex"));
if(pIfNameToIndex)
Curl_if_nametoindex = pIfNameToIndex;
@ -164,13 +158,9 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
/* See function definitions in winbase.h */
#ifdef UNICODE
# ifdef UNDER_CE
# define LOADLIBARYEX L"LoadLibraryExW"
# else
# define LOADLIBARYEX "LoadLibraryExW"
# endif
# define LOADLIBARYEX "LoadLibraryExW"
#else
# define LOADLIBARYEX "LoadLibraryExA"
# define LOADLIBARYEX "LoadLibraryExA"
#endif
/*
@ -189,7 +179,7 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
*/
static HMODULE curl_load_library(LPCTSTR filename)
{
#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#ifndef CURL_WINDOWS_UWP
HMODULE hModule = NULL;
LOADLIBRARYEX_FN pLoadLibraryEx = NULL;

View file

@ -39,9 +39,7 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifndef UNDER_CE
#include <signal.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>

View file

@ -119,12 +119,6 @@
#define CALG_SHA_256 0x0000800c
#endif
/* Work around typo in CeGCC (as of 0.59.1) w32api headers */
#if defined(__MINGW32CE__) && \
!defined(ALG_CLASS_DHASH) && defined(ALG_CLASS_HASH)
#define ALG_CLASS_DHASH ALG_CLASS_HASH
#endif
/* Offered by mingw-w64 v4+. MS SDK 6.0A+. */
#ifndef PKCS12_NO_PERSIST_KEY
#define PKCS12_NO_PERSIST_KEY 0x00008000
@ -385,7 +379,6 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers,
return CURLE_OK;
}
#ifndef UNDER_CE
/* Function allocates memory for store_path only if CURLE_OK is returned */
static CURLcode
get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path,
@ -441,7 +434,6 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path,
return CURLE_OK;
}
#endif
static CURLcode
schannel_acquire_credential_handle(struct Curl_cfilter *cf,
@ -536,7 +528,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
return CURLE_SSL_CONNECT_ERROR;
}
#ifndef UNDER_CE
/* client certificate */
if(data->set.ssl.primary.clientcert || data->set.ssl.primary.cert_blob) {
DWORD cert_store_name = 0;
@ -744,7 +735,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
}
client_cert_store = cert_store;
}
#endif
/* allocate memory for the reusable credential handle */
backend->cred = (struct Curl_schannel_cred *)
@ -875,9 +865,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
struct ssl_connect_data *connssl = cf->ctx;
struct schannel_ssl_backend_data *backend =
(struct schannel_ssl_backend_data *)connssl->backend;
#ifndef UNDER_CE
struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
#endif
struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
SecBuffer outbuf;
SecBufferDesc outbuf_desc;
@ -908,11 +896,6 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
backend->use_alpn = FALSE;
#endif
#ifdef UNDER_CE
/* certificate validation on Windows CE does not seem to work right; we will
* do it following a more manual process. */
backend->use_manual_cred_validation = TRUE;
#else
if(conn_config->CAfile || conn_config->ca_info_blob) {
if(curlx_verify_windows_version(6, 1, 0, PLATFORM_WINNT,
VERSION_GREATER_THAN_EQUAL)) {
@ -926,7 +909,6 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
}
else
backend->use_manual_cred_validation = FALSE;
#endif
backend->cred = NULL;
@ -2573,7 +2555,7 @@ static void schannel_close(struct Curl_cfilter *cf, struct Curl_easy *data)
static int schannel_init(void)
{
#if defined(HAS_ALPN_SCHANNEL) && !defined(UNDER_CE)
#ifdef HAS_ALPN_SCHANNEL
typedef const char *(APIENTRY *WINE_GET_VERSION_FN)(void);
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic push
@ -2581,8 +2563,7 @@ static int schannel_init(void)
#endif
WINE_GET_VERSION_FN p_wine_get_version =
CURLX_FUNCTION_CAST(WINE_GET_VERSION_FN,
GetProcAddress(GetModuleHandleA("ntdll"),
"wine_get_version"));
GetProcAddress(GetModuleHandle(TEXT("ntdll")), "wine_get_version"));
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic pop
#endif
@ -2599,7 +2580,7 @@ static int schannel_init(void)
s_win_has_alpn = curlx_verify_windows_version(6, 3, 0, PLATFORM_WINNT,
VERSION_GREATER_THAN_EQUAL);
}
#endif /* HAS_ALPN_SCHANNEL && !UNDER_CE */
#endif /* HAS_ALPN_SCHANNEL */
return Curl_sspi_global_init() == CURLE_OK ? 1 : 0;
}
@ -2716,12 +2697,7 @@ static void schannel_checksum(const unsigned char *input,
if(!CryptCreateHash(hProv, algId, 0, 0, &hHash))
break; /* failed */
#ifdef __MINGW32CE__
/* workaround for CeGCC, should be (const BYTE*) */
if(!CryptHashData(hHash, (BYTE*)CURL_UNCONST(input), (DWORD)inputlen, 0))
#else
if(!CryptHashData(hHash, input, (DWORD)inputlen, 0))
#endif
break; /* failed */
/* get hash size */

View file

@ -55,22 +55,6 @@
#define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend)
#ifdef __MINGW32CE__
#define CERT_QUERY_OBJECT_BLOB 0x00000002
#define CERT_QUERY_CONTENT_CERT 1
#define CERT_QUERY_CONTENT_FLAG_CERT (1 << CERT_QUERY_CONTENT_CERT)
#define CERT_QUERY_FORMAT_BINARY 1
#define CERT_QUERY_FORMAT_BASE64_ENCODED 2
#define CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED 3
#define CERT_QUERY_FORMAT_FLAG_ALL \
(1 << CERT_QUERY_FORMAT_BINARY) | \
(1 << CERT_QUERY_FORMAT_BASE64_ENCODED) | \
(1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
#define CERT_CHAIN_REVOCATION_CHECK_CHAIN 0x20000000
#define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000
#define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000
#endif /* __MINGW32CE__ */
#define MAX_CAFILE_SIZE 1048576 /* 1 MiB */
#define BEGIN_CERT "-----BEGIN CERTIFICATE-----"
#define END_CERT "\n-----END CERTIFICATE-----"
@ -112,7 +96,6 @@ struct cert_chain_engine_config_win7 {
HCERTSTORE hExclusiveTrustedPeople;
};
#ifndef UNDER_CE
static int is_cr_or_lf(char c)
{
return c == '\r' || c == '\n';
@ -534,7 +517,6 @@ static bool get_alt_name_info(struct Curl_easy *data,
result = TRUE;
return result;
}
#endif /* !UNDER_CE */
/* Verify the server's hostname */
CURLcode Curl_verify_host(struct Curl_cfilter *cf,
@ -543,58 +525,6 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf,
CURLcode result = CURLE_PEER_FAILED_VERIFICATION;
struct ssl_connect_data *connssl = cf->ctx;
CERT_CONTEXT *pCertContextServer = NULL;
#ifdef UNDER_CE
TCHAR cert_hostname_buff[256];
DWORD len;
/* This code does not support certificates with multiple alternative names.
* Right now we are only asking for the first preferred alternative name.
* Instead we would need to do all via CERT_NAME_SEARCH_ALL_NAMES_FLAG
* (If Windows CE supports that?) and run this section in a loop for each.
* https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certgetnamestringa
* curl: (51) schannel: CertGetNameString() certificate hostname
* (.google.com) did not match connection (google.com)
*/
len = CertGetNameString(pCertContextServer,
CERT_NAME_DNS_TYPE,
CERT_NAME_DISABLE_IE4_UTF8_FLAG,
NULL,
cert_hostname_buff,
256);
if(len > 0) {
/* Comparing the cert name and the connection hostname encoded as UTF-8
* is acceptable since both values are assumed to use ASCII
* (or some equivalent) encoding
*/
char *cert_hostname = curlx_convert_tchar_to_UTF8(cert_hostname_buff);
if(!cert_hostname) {
result = CURLE_OUT_OF_MEMORY;
}
else{
const char *conn_hostname = connssl->peer.hostname;
if(Curl_cert_hostcheck(cert_hostname, strlen(cert_hostname),
conn_hostname, strlen(conn_hostname))) {
infof(data,
"schannel: connection hostname (%s) validated "
"against certificate name (%s)",
conn_hostname, cert_hostname);
result = CURLE_OK;
}
else{
failf(data,
"schannel: connection hostname (%s) "
"does not match certificate name (%s)",
conn_hostname, cert_hostname);
}
Curl_safefree(cert_hostname);
}
}
else {
failf(data,
"schannel: CertGetNameString did not provide any "
"certificate name information");
}
#else
SECURITY_STATUS sspi_status;
TCHAR *cert_hostname_buff = NULL;
size_t cert_hostname_buff_index = 0;
@ -740,7 +670,6 @@ cleanup:
if(pCertContextServer)
CertFreeCertificateContext(pCertContextServer);
#endif /* !UNDER_CE */
return result;
}
@ -757,10 +686,8 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
CERT_CONTEXT *pCertContextServer = NULL;
const CERT_CHAIN_CONTEXT *pChainContext = NULL;
HCERTCHAINENGINE cert_chain_engine = NULL;
#ifndef UNDER_CE
HCERTSTORE trust_store = NULL;
HCERTSTORE own_trust_store = NULL;
#endif /* !UNDER_CE */
DEBUGASSERT(BACKEND);
@ -776,7 +703,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
result = CURLE_PEER_FAILED_VERIFICATION;
}
#ifndef UNDER_CE
if(result == CURLE_OK &&
(conn_config->CAfile || conn_config->ca_info_blob) &&
BACKEND->use_manual_cred_validation) {
@ -870,7 +796,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
}
}
}
#endif /* !UNDER_CE */
if(result == CURLE_OK) {
CERT_CHAIN_PARA ChainPara;
@ -934,7 +859,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
}
}
#ifndef UNDER_CE
if(cert_chain_engine) {
CertFreeCertificateChainEngine(cert_chain_engine);
}
@ -942,7 +866,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
if(own_trust_store) {
CertCloseStore(own_trust_store, 0);
}
#endif /* !UNDER_CE */
if(pChainContext)
CertFreeCertificateChain(pChainContext);

View file

@ -386,10 +386,7 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf,
* valid when used in another process with different CWD. However,
* when a path does not exist, this does not work. Then, we add
* the path as is. */
#ifdef UNDER_CE
(void)is_local;
return curlx_dyn_addf(buf, ":%s-%s", name, path);
#elif defined(_WIN32)
#ifdef _WIN32
char abspath[_MAX_PATH];
if(_fullpath(abspath, path, _MAX_PATH))
return curlx_dyn_addf(buf, ":%s-%s", name, abspath);