2011-09-20 00:18:17 +08:00
|
|
|
#ifndef HEADER_CURL_TOOL_DOSWIN_H
|
|
|
|
#define HEADER_CURL_TOOL_DOSWIN_H
|
2009-06-06 00:14:50 +08:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2020-02-19 14:53:54 +08:00
|
|
|
* Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2009-06-06 00:14:50 +08:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2009-06-06 00:14:50 +08:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
*
|
2009-06-06 00:14:50 +08:00
|
|
|
***************************************************************************/
|
2012-04-07 05:35:15 +08:00
|
|
|
#include "tool_setup.h"
|
2009-06-06 00:14:50 +08:00
|
|
|
|
2011-09-20 00:18:17 +08:00
|
|
|
#if defined(MSDOS) || defined(WIN32)
|
2009-06-06 00:14:50 +08:00
|
|
|
|
2016-02-05 14:44:27 +08:00
|
|
|
#define SANITIZE_ALLOW_COLONS (1<<0) /* Allow colons */
|
|
|
|
#define SANITIZE_ALLOW_PATH (1<<1) /* Allow path separators and colons */
|
|
|
|
#define SANITIZE_ALLOW_RESERVED (1<<2) /* Allow reserved device names */
|
|
|
|
#define SANITIZE_ALLOW_TRUNCATE (1<<3) /* Allow truncating a long filename */
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SANITIZE_ERR_OK = 0, /* 0 - OK */
|
|
|
|
SANITIZE_ERR_INVALID_PATH, /* 1 - the path is invalid */
|
|
|
|
SANITIZE_ERR_BAD_ARGUMENT, /* 2 - bad function parameter */
|
|
|
|
SANITIZE_ERR_OUT_OF_MEMORY, /* 3 - out of memory */
|
|
|
|
SANITIZE_ERR_LAST /* never use! */
|
|
|
|
} SANITIZEcode;
|
|
|
|
|
|
|
|
SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name,
|
|
|
|
int flags);
|
|
|
|
#ifdef UNITTESTS
|
|
|
|
SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos);
|
|
|
|
SANITIZEcode msdosify(char **const sanitized, const char *file_name,
|
|
|
|
int flags);
|
|
|
|
SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized,
|
|
|
|
const char *file_name,
|
|
|
|
int flags);
|
|
|
|
#endif /* UNITTESTS */
|
2009-06-06 00:14:50 +08:00
|
|
|
|
2011-10-05 06:03:20 +08:00
|
|
|
#if defined(MSDOS) && (defined(__DJGPP__) || defined(__GO32__))
|
|
|
|
|
|
|
|
char **__crt0_glob_function(char *arg);
|
|
|
|
|
|
|
|
#endif /* MSDOS && (__DJGPP__ || __GO32__) */
|
|
|
|
|
2011-09-20 21:58:35 +08:00
|
|
|
#ifdef WIN32
|
|
|
|
|
2014-02-24 00:09:15 +08:00
|
|
|
CURLcode FindWin32CACert(struct OperationConfig *config,
|
schannel: add support for CURLOPT_CAINFO
- Move verify_certificate functionality in schannel.c into a new
file called schannel_verify.c. Additionally, some structure defintions
from schannel.c have been moved to schannel.h to allow them to be
used in schannel_verify.c.
- Make verify_certificate functionality for Schannel available on
all versions of Windows instead of just Windows CE. verify_certificate
will be invoked on Windows CE or when the user specifies
CURLOPT_CAINFO and CURLOPT_SSL_VERIFYPEER.
- In verify_certificate, create a custom certificate chain engine that
exclusively trusts the certificate store backed by the CURLOPT_CAINFO
file.
- doc updates of --cacert/CAINFO support for schannel
- Use CERT_NAME_SEARCH_ALL_NAMES_FLAG when invoking CertGetNameString
when available. This implements a TODO in schannel.c to improve
handling of multiple SANs in a certificate. In particular, all SANs
will now be searched instead of just the first name.
- Update tool_operate.c to not search for the curl-ca-bundle.crt file
when using Schannel to maintain backward compatibility. Previously,
any curl-ca-bundle.crt file found in that search would have been
ignored by Schannel. But, with CAINFO support, the file found by
that search would have been used as the certificate store and
could cause issues for any users that have curl-ca-bundle.crt in
the search path.
- Update url.c to not set the build time CURL_CA_BUNDLE if the selected
SSL backend is Schannel. We allow setting CA location for schannel
only when explicitly specified by the user via CURLOPT_CAINFO /
--cacert.
- Add new test cases 3000 and 3001. These test cases check that the first
and last SAN, respectively, matches the connection hostname. New test
certificates have been added for these cases. For 3000, the certificate
prefix is Server-localhost-firstSAN and for 3001, the certificate
prefix is Server-localhost-secondSAN.
- Remove TODO 15.2 (Add support for custom server certificate
validation), this commit addresses it.
Closes https://github.com/curl/curl/pull/1325
2017-03-11 04:27:30 +08:00
|
|
|
curl_sslbackend backend,
|
2020-07-24 03:28:14 +08:00
|
|
|
const TCHAR *bundle_file);
|
2018-11-01 14:50:40 +08:00
|
|
|
struct curl_slist *GetLoadedModulePaths(void);
|
2020-01-24 16:34:52 +08:00
|
|
|
CURLcode win32_init(void);
|
2011-09-20 21:58:35 +08:00
|
|
|
|
|
|
|
#endif /* WIN32 */
|
|
|
|
|
2011-09-20 00:18:17 +08:00
|
|
|
#endif /* MSDOS || WIN32 */
|
2009-06-06 00:14:50 +08:00
|
|
|
|
2011-09-20 00:18:17 +08:00
|
|
|
#endif /* HEADER_CURL_TOOL_DOSWIN_H */
|