OLD | NEW |
1 /* engines/e_capi.c */ | 1 /* engines/e_capi.c */ |
2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 * project. | 3 * project. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #include <openssl/rsa.h> | 64 #include <openssl/rsa.h> |
65 | 65 |
66 #include <windows.h> | 66 #include <windows.h> |
67 | 67 |
68 #ifndef _WIN32_WINNT | 68 #ifndef _WIN32_WINNT |
69 #define _WIN32_WINNT 0x0400 | 69 #define _WIN32_WINNT 0x0400 |
70 #endif | 70 #endif |
71 | 71 |
72 #include <wincrypt.h> | 72 #include <wincrypt.h> |
73 | 73 |
| 74 /* |
| 75 * This module uses several "new" interfaces, among which is |
| 76 * CertGetCertificateContextProperty. CERT_KEY_PROV_INFO_PROP_ID is |
| 77 * one of possible values you can pass to function in question. By |
| 78 * checking if it's defined we can see if wincrypt.h and accompanying |
| 79 * crypt32.lib are in shape. The native MingW32 headers up to and |
| 80 * including __W32API_VERSION 3.14 lack of struct DSSPUBKEY and the |
| 81 * defines CERT_STORE_PROV_SYSTEM_A and CERT_STORE_READONLY_FLAG, |
| 82 * so we check for these too and avoid compiling. |
| 83 * Yes, it's rather "weak" test and if compilation fails, |
| 84 * then re-configure with -DOPENSSL_NO_CAPIENG. |
| 85 */ |
| 86 #if defined(CERT_KEY_PROV_INFO_PROP_ID) && \ |
| 87 defined(CERT_STORE_PROV_SYSTEM_A) && \ |
| 88 defined(CERT_STORE_READONLY_FLAG) |
| 89 # define __COMPILE_CAPIENG |
| 90 #endif /* CERT_KEY_PROV_INFO_PROP_ID */ |
| 91 #endif /* OPENSSL_NO_CAPIENG */ |
| 92 #endif /* OPENSSL_SYS_WIN32 */ |
| 93 |
| 94 #ifdef __COMPILE_CAPIENG |
| 95 |
74 #undef X509_EXTENSIONS | 96 #undef X509_EXTENSIONS |
75 #undef X509_CERT_PAIR | 97 #undef X509_CERT_PAIR |
76 | 98 |
77 /* Definitions which may be missing from earlier version of headers */ | 99 /* Definitions which may be missing from earlier version of headers */ |
78 #ifndef CERT_STORE_OPEN_EXISTING_FLAG | 100 #ifndef CERT_STORE_OPEN_EXISTING_FLAG |
79 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000 | 101 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000 |
80 #endif | 102 #endif |
81 | 103 |
82 #ifndef CERT_STORE_CREATE_NEW_FLAG | 104 #ifndef CERT_STORE_CREATE_NEW_FLAG |
83 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000 | 105 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000 |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 } | 1803 } |
1782 | 1804 |
1783 err: | 1805 err: |
1784 if (dstore) | 1806 if (dstore) |
1785 CertCloseStore(dstore, 0); | 1807 CertCloseStore(dstore, 0); |
1786 return idx; | 1808 return idx; |
1787 | 1809 |
1788 } | 1810 } |
1789 #endif | 1811 #endif |
1790 | 1812 |
1791 #endif | 1813 #else /* !__COMPILE_CAPIENG */ |
1792 #else /* !WIN32 */ | |
1793 #include <openssl/engine.h> | 1814 #include <openssl/engine.h> |
1794 #ifndef OPENSSL_NO_DYNAMIC_ENGINE | 1815 #ifndef OPENSSL_NO_DYNAMIC_ENGINE |
1795 OPENSSL_EXPORT | 1816 OPENSSL_EXPORT |
| 1817 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); |
| 1818 OPENSSL_EXPORT |
1796 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } | 1819 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } |
1797 IMPLEMENT_DYNAMIC_CHECK_FN() | 1820 IMPLEMENT_DYNAMIC_CHECK_FN() |
| 1821 #else |
| 1822 void ENGINE_load_capi(void){} |
1798 #endif | 1823 #endif |
1799 #endif | 1824 #endif |
OLD | NEW |