X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=engines%2Fe_capi.c;h=e2a7cb58b0037cf0b31f4b2b75dd12fb749ab900;hb=3081e2ca7311526555954ab10ef094ec90d17b43;hp=652f5282a420715c7d288ea226c1229ec2075e4c;hpb=0f41ccf370a1d5abc97e65b00b1bd7b0968ec69c;p=oweals%2Fopenssl.git diff --git a/engines/e_capi.c b/engines/e_capi.c index 652f5282a4..e2a7cb58b0 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -71,6 +71,22 @@ #include +/* + * This module uses several "new" interfaces, among which is + * CertGetCertificateContextProperty. CERT_KEY_PROV_INFO_PROP_ID is + * one of possible values you can pass to function in question. By + * checking if it's defined we can see if wincrypt.h and accompanying + * crypt32.lib are in shape. Yes, it's rather "weak" test and if + * compilation fails, then re-configure with -DOPENSSL_NO_CAPIENG. + */ +#ifdef CERT_KEY_PROV_INFO_PROP_ID +# define __COMPILE_CAPIENG +#endif /* CERT_KEY_PROV_INFO_PROP_ID */ +#endif /* OPENSSL_NO_CAPIENG */ +#endif /* OPENSSL_SYS_WIN32 */ + +#ifdef __COMPILE_CAPIENG + #undef X509_EXTENSIONS #undef X509_CERT_PAIR @@ -83,6 +99,10 @@ #define CERT_STORE_CREATE_NEW_FLAG 0x00002000 #endif +#ifndef CERT_SYSTEM_STORE_CURRENT_USER +#define CERT_SYSTEM_STORE_CURRENT_USER 0x00010000 +#endif + #include #include #include @@ -162,11 +182,11 @@ struct CAPI_CTX_st { /* Lookup string meanings in load_private_key */ /* Substring of subject: uses "storename" */ -#define CAPI_LU_SUBSTR 0 +#define CAPI_LU_SUBSTR 1 /* Friendly name: uses storename */ -#define CAPI_LU_FNAME 1 +#define CAPI_LU_FNAME 2 /* Container name: uses cspname, keytype */ -#define CAPI_LU_CONTNAME 2 +#define CAPI_LU_CONTNAME 3 int lookup_method; /* Info to dump with dumpcerts option */ /* Issuer and serial name strings */ @@ -1784,12 +1804,13 @@ static int cert_select_dialog(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs) } #endif -#endif -#else /* !WIN32 */ +#else /* !__COMPILE_CAPIENG */ #include #ifndef OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_EXPORT int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } IMPLEMENT_DYNAMIC_CHECK_FN() +#else +void ENGINE_load_capi(void){} #endif #endif