#include "syshead.h"
-#if defined(WIN32) && defined(USE_CRYPTO) && defined(USE_SSL)
+#ifdef ENABLE_CRYPTOAPI
#include <openssl/ssl.h>
#include <openssl/err.h>
.TP
.B \-\-cryptoapicert select-string
Load the certificate and private key from the
-Windows Certificate System Store (Windows Only).
+Windows Certificate System Store (Windows/OpenSSL Only).
Use this option instead of
.B \-\-cert
SHOW_STR (cert_file);
SHOW_STR (priv_key_file);
SHOW_STR (pkcs12_file);
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
SHOW_STR (cryptoapi_cert);
#endif
SHOW_STR (cipher_list);
msg(M_USAGE, "Parameter --key cannot be used when --pkcs11-provider is also specified.");
if (options->pkcs12_file)
msg(M_USAGE, "Parameter --pkcs12 cannot be used when --pkcs11-provider is also specified.");
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
if (options->cryptoapi_cert)
msg(M_USAGE, "Parameter --cryptoapicert cannot be used when --pkcs11-provider is also specified.");
#endif
}
else
#endif
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
if (options->cryptoapi_cert)
{
if ((!(options->ca_file)) && (!(options->ca_path)))
VERIFY_PERMISSION (OPT_P_GENERAL);
options->verify_hash = parse_hash_fingerprint(p[1], SHA_DIGEST_LENGTH, msglevel, &options->gc);
}
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
else if (streq (p[0], "cryptoapicert") && p[1])
{
VERIFY_PERMISSION (OPT_P_GENERAL);
bool pkcs11_id_management;
#endif
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
const char *cryptoapi_cert;
#endif
}
}
#endif
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
else if (options->cryptoapi_cert)
{
tls_ctx_load_cryptoapi(new_ctx, options->cryptoapi_cert);
* @param ctx TLS context to use
* @param crypto_api_cert String representing the certificate to load.
*/
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
void tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert);
#endif /* WIN32 */
return 0;
}
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
void
tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert)
{
return 0;
}
-#ifdef WIN32
+#ifdef ENABLE_CRYPTOAPI
void
tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert)
{
#define ENABLE_PKCS11
#endif
+/*
+ * Do we have CryptoAPI capability?
+ */
+#if defined(WIN32) && defined(USE_CRYPTO) && defined(USE_SSL) && defined(USE_OPENSSL)
+#define ENABLE_CRYPTOAPI
+#endif
+
/*
* Enable x509-track feature?
*/