NingSun | 0c89b3c | 2018-02-08 08:34:03 -0800 | [diff] [blame^] | 1 | /* config.h for WIN32 */ |
| 2 | |
| 3 | /* The default log level */ |
| 4 | #define DEFAULT_LOG_LEVEL "INFO" |
| 5 | |
| 6 | /* Default storage backend for token objects */ |
| 7 | #define DEFAULT_OBJECTSTORE_BACKEND "file" |
| 8 | |
| 9 | /* The default PKCS#11 library */ |
| 10 | #define DEFAULT_PKCS11_LIB "softhsm2.dll" |
| 11 | |
| 12 | /* The default location of softhsm2.conf */ |
| 13 | #define DEFAULT_SOFTHSM2_CONF "softhsm2.conf" |
| 14 | |
| 15 | /* The default location of the token directory */ |
| 16 | #define DEFAULT_TOKENDIR "tokens" |
| 17 | |
| 18 | /* Define if advanced AES key wrap without pad is supported */ |
| 19 | @IF RFC3394 |
| 20 | #define HAVE_AES_KEY_WRAP 1 |
| 21 | @ELSE RFC3394 |
| 22 | #undef HAVE_AES_KEY_WRAP |
| 23 | @END RFC3394 |
| 24 | |
| 25 | /* Define if advanced AES key wrap with pad is supported */ |
| 26 | @IF RFC5649 |
| 27 | #define HAVE_AES_KEY_WRAP_PAD 1 |
| 28 | @ELSE RFC5649 |
| 29 | #undef HAVE_AES_KEY_WRAP_PAD |
| 30 | @END RFC5649 |
| 31 | |
| 32 | /* Whether LoadLibrary is available */ |
| 33 | #define HAVE_LOADLIBRARY 1 |
| 34 | |
| 35 | /* Define to 1 if you have the <sqlite3.h> header file. */ |
| 36 | #undef HAVE_SQLITE3_H |
| 37 | |
| 38 | /* Define to 1 if you have the <stdlib.h> header file. */ |
| 39 | #define HAVE_STDLIB_H 1 |
| 40 | |
| 41 | /* Define to 1 if you have the <string.h> header file. */ |
| 42 | #define HAVE_STRING_H 1 |
| 43 | |
| 44 | /* Define to 1 if you have the <sys/stat.h> header file. */ |
| 45 | #define HAVE_SYS_STAT_H 1 |
| 46 | |
| 47 | /* Define to 1 if you have the <sys/types.h> header file. */ |
| 48 | #define HAVE_SYS_TYPES_H 1 |
| 49 | |
| 50 | /* Define to 1 if you have the <unistd.h> header file. */ |
| 51 | #undef HAVE_UNISTD_H |
| 52 | |
| 53 | /* Maximum PIN length */ |
| 54 | #define MAX_PIN_LEN 255 |
| 55 | |
| 56 | /* Minimum PIN length */ |
| 57 | #define MIN_PIN_LEN 4 |
| 58 | |
| 59 | /* Name of package */ |
| 60 | #define PACKAGE "softhsm" |
| 61 | |
| 62 | /* Define to the address where bug reports for this package should be sent. */ |
| 63 | #define PACKAGE_BUGREPORT "" |
| 64 | |
| 65 | /* Define to the full name of this package. */ |
| 66 | #define PACKAGE_NAME "SoftHSM" |
| 67 | |
| 68 | /* Define to the full name and version of this package. */ |
| 69 | #define PACKAGE_STRING "SoftHSM 2.3.0" |
| 70 | |
| 71 | /* Define to the one symbol short name of this package. */ |
| 72 | #define PACKAGE_TARNAME "softhsm" |
| 73 | |
| 74 | /* Define to the home page for this package. */ |
| 75 | #define PACKAGE_URL "" |
| 76 | |
| 77 | /* Define to the version of this package. */ |
| 78 | #define PACKAGE_VERSION "2.3.0" |
| 79 | |
| 80 | /* Non-paged memory for secure storage */ |
| 81 | @IF NONPAGE |
| 82 | #define SENSITIVE_NON_PAGE 1 |
| 83 | @ELSE NONPAGE |
| 84 | #undef SENSITIVE_NON_PAGE |
| 85 | @END NONPAGE |
| 86 | |
| 87 | /* Define to 1 if you have the ANSI C header files. */ |
| 88 | #undef STDC_HEADERS |
| 89 | |
| 90 | /* Version number of package */ |
| 91 | #define VERSION "2.3.0" |
| 92 | |
| 93 | /* SoftHSM major version number via PKCS#11 */ |
| 94 | #define VERSION_MAJOR 2 |
| 95 | |
| 96 | /* SoftHSM minor version number via PKCS#11 */ |
| 97 | #define VERSION_MINOR 3 |
| 98 | |
| 99 | /* Compile with Botan support */ |
| 100 | @IF BOTAN |
| 101 | #define WITH_BOTAN 1 |
| 102 | @ELSE BOTAN |
| 103 | #undef WITH_BOTAN |
| 104 | @END BOTAN |
| 105 | |
| 106 | /* Compile with ECC support */ |
| 107 | @IF ECC |
| 108 | #define WITH_ECC 1 |
| 109 | @ELSE ECC |
| 110 | #undef WITH_ECC |
| 111 | @END ECC |
| 112 | |
| 113 | /* Compile with GOST support */ |
| 114 | @IF GOST |
| 115 | #define WITH_GOST 1 |
| 116 | @ELSE GOST |
| 117 | #undef WITH_GOST |
| 118 | @END GOST |
| 119 | |
| 120 | /* Compile with OpenSSL support */ |
| 121 | @IF OPENSSL |
| 122 | #define WITH_OPENSSL 1 |
| 123 | @ELSE OPENSSL |
| 124 | #undef WITH_OPENSSL |
| 125 | @END OPENSSL |
| 126 | |
| 127 | /* Compile with raw PSS support */ |
| 128 | @IF RAWPSS |
| 129 | #define WITH_RAW_PSS 1 |
| 130 | @ELSE RAWPSS |
| 131 | #undef WITH_RAW_PSS |
| 132 | @END RAWPSS |
| 133 | |
| 134 | /* Compile with AES GCM support */ |
| 135 | @IF AESGCM |
| 136 | #define WITH_AES_GCM 1 |
| 137 | @ELSE AESGCM |
| 138 | #undef WITH_AES_GCM |
| 139 | @END AESGCM |
| 140 | |
| 141 | /* Define to 1 if you have getpassphrase(). */ |
| 142 | #define HAVE_GETPASSPHRASE |
| 143 | |
| 144 | /* Addition things */ |
| 145 | |
| 146 | char *getpassphrase(const char *prompt); |
| 147 | int setenv(const char *name, const char *value, int overwrite); |
| 148 | |
| 149 | /* At least Vista */ |
| 150 | |
| 151 | #ifndef _WIN32_WINNT |
| 152 | #define _WIN32_WINNT 0x0600 |
| 153 | #endif |
| 154 | |
| 155 | #if _MSC_VER < 1900 |
| 156 | #define snprintf _snprintf |
| 157 | #endif |
| 158 | #define strcasecmp _stricmp |
| 159 | #define strncasecmp _strnicmp |
| 160 | |
| 161 | /* Prevent inclusion of winsock.h in windows.h */ |
| 162 | |
| 163 | #define WIN32_LEAN_AND_MEAN 1 |
| 164 | |
| 165 | #include <windows.h> |
| 166 | |
| 167 | /* avoid collision from min and max macros */ |
| 168 | |
| 169 | #undef min |
| 170 | #undef max |
| 171 | |
| 172 | @IF BOTAN |
| 173 | /* For Botan */ |
| 174 | |
| 175 | #pragma warning(disable: 4275 4267) |
| 176 | @END BOTAN |
| 177 | |
| 178 | /* Temporary for debug */ |
| 179 | |
| 180 | #undef DEBUG_LOG_STDERR |
| 181 | // #define DEBUG_LOG_STDERR 1 |
| 182 | |
| 183 | /* To avoid unsafe warnings (off) */ |
| 184 | |
| 185 | // #pragma warning(disable: 4996) |