* https://www.openssl.org/source/license.html
*/
+/*
+ * Unfortunate workaround to avoid symbol conflict with wincrypt.h
+ * See https://github.com/openssl/openssl/issues/9981
+ */
+#ifdef _WIN32
+# define WINCRYPT_USE_SYMBOL_PREFIX
+# undef X509_NAME
+# undef X509_EXTENSIONS
+# undef PKCS7_SIGNER_INFO
+# undef OCSP_REQUEST
+# undef OCSP_RESPONSE
+#endif
+
#ifndef OPENSSL_TYPES_H
# define OPENSSL_TYPES_H
-# pragma once
# include <limits.h>
typedef struct asn1_pctx_st ASN1_PCTX;
typedef struct asn1_sctx_st ASN1_SCTX;
-# ifdef _WIN32
-# undef X509_NAME
-# undef X509_EXTENSIONS
-# undef PKCS7_ISSUER_AND_SERIAL
-# undef PKCS7_SIGNER_INFO
-# undef OCSP_REQUEST
-# undef OCSP_RESPONSE
-# endif
-
# ifdef BIGNUM
# undef BIGNUM
# endif
recordlentest drbgtest rand_status_test sslbuffertest \
time_offset_test pemtest ssl_cert_table_internal_test ciphername_test \
http_test servername_test ocspapitest fatalerrtest tls13ccstest \
- sysdefaulttest errtest ssl_ctx_test \
+ sysdefaulttest errtest ssl_ctx_test build_wincrypt_test \
context_internal_test aesgcmtest params_test evp_pkey_dparams_test \
keymgmt_internal_test hexstr_test provider_status_test defltfips_test \
bio_readbuffer_test user_property_test pkcs7_test upcallstest \
INCLUDE[ssl_ctx_test]=../include ../apps/include
DEPEND[ssl_ctx_test]=../libcrypto ../libssl libtestutil.a
+ SOURCE[build_wincrypt_test]=build_wincrypt_test.c
+ INCLUDE[build_wincrypt_test]=../include
+ DEPEND[build_wincrypt_test]=../libssl ../libcrypto
+
{-
use File::Spec::Functions;
use File::Basename;
--- /dev/null
+/*
+ * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Simple buildtest to check for symbol collisions between wincrypt and
+ * OpenSSL headers
+ */
+
+#include <openssl/types.h>
+
+#ifdef _WIN32
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <wincrypt.h>
+# ifndef X509_NAME
+# ifndef PEDANTIC
+# warning "wincrypt.h no longer defining X509_NAME before OpenSSL headers"
+# endif
+# endif
+#endif
+
+#include <openssl/opensslconf.h>
+#ifndef OPENSSL_NO_STDIO
+# include <stdio.h>
+#endif
+
+#include <openssl/evp.h>
+#include <openssl/x509.h>
+#include <openssl/x509v3.h>
+
+int main(void)
+{
+ return 0;
+}