curl/src/tool_doswin.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
2.8 KiB
C
Raw Normal View History

#ifndef HEADER_CURL_TOOL_DOSWIN_H
#define HEADER_CURL_TOOL_DOSWIN_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* 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.
*
* 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
*
***************************************************************************/
#include "tool_setup.h"
#if defined(MSDOS) || defined(WIN32)
#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 */
#if defined(MSDOS) && (defined(__DJGPP__) || defined(__GO32__))
char **__crt0_glob_function(char *arg);
#endif /* MSDOS && (__DJGPP__ || __GO32__) */
#ifdef WIN32
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,
const TCHAR *bundle_file);
struct curl_slist *GetLoadedModulePaths(void);
CURLcode win32_init(void);
#endif /* WIN32 */
#endif /* MSDOS || WIN32 */
#endif /* HEADER_CURL_TOOL_DOSWIN_H */