|
35 | 35 |
|
36 | 36 | /** Define to lock the PIN slot after writing */ |
37 | 37 | #ifndef PKCS11_LOCK_PIN_SLOT |
38 | | -#define PKCS11_LOCK_PIN_SLOT 0 |
| 38 | +#cmakedefine01 PKCS11_LOCK_PIN_SLOT |
39 | 39 | #endif |
40 | 40 |
|
41 | 41 | /** Enable PKCS#11 Debugging Messages */ |
42 | 42 | #ifndef PKCS11_DEBUG_ENABLE |
43 | | -#define PKCS11_DEBUG_ENABLE 0 |
| 43 | +#cmakedefine01 PKCS11_DEBUG_ENABLE |
44 | 44 | #endif |
45 | 45 |
|
46 | 46 | /** Use Static or Dynamic Allocation */ |
47 | 47 | #ifndef PKCS11_USE_STATIC_MEMORY |
48 | | -#define PKCS11_USE_STATIC_MEMORY 1 |
| 48 | +#cmakedefine01 PKCS11_USE_STATIC_MEMORY |
49 | 49 | #endif |
50 | 50 |
|
51 | 51 | /** Use a compiled configuration rather than loading from a filestore */ |
52 | 52 | #ifndef PKCS11_USE_STATIC_CONFIG |
53 | | -#define PKCS11_USE_STATIC_CONFIG 0 |
| 53 | +#cmakedefine01 PKCS11_USE_STATIC_CONFIG |
54 | 54 | #endif |
55 | 55 |
|
56 | 56 | /** Maximum number of slots allowed in the system - if static memory this will |
57 | 57 | always be the number of slots */ |
58 | 58 | #ifndef PKCS11_MAX_SLOTS_ALLOWED |
59 | | -#define PKCS11_MAX_SLOTS_ALLOWED 1 |
| 59 | +#define PKCS11_MAX_SLOTS_ALLOWED @PKCS11_MAX_SLOTS_ALLOWED@ |
60 | 60 | #endif |
61 | 61 |
|
62 | 62 | /** Maximum number of total sessions allowed in the system - if using static |
63 | 63 | memory then this many session contexts will be allocated */ |
64 | 64 | #ifndef PKCS11_MAX_SESSIONS_ALLOWED |
65 | | -#define PKCS11_MAX_SESSIONS_ALLOWED 10 |
| 65 | +#define PKCS11_MAX_SESSIONS_ALLOWED @PKCS11_MAX_SESSIONS_ALLOWED@ |
66 | 66 | #endif |
67 | 67 |
|
68 | 68 | /** Maximum number of cryptographic objects allowed to be cached */ |
69 | 69 | #ifndef PKCS11_MAX_OBJECTS_ALLOWED |
70 | | -#define PKCS11_MAX_OBJECTS_ALLOWED 16 |
| 70 | +#define PKCS11_MAX_OBJECTS_ALLOWED @PKCS11_MAX_OBJECTS_ALLOWED@ |
71 | 71 | #endif |
72 | 72 |
|
73 | 73 | /** Maximum label size in characters */ |
74 | 74 | #ifndef PKCS11_MAX_LABEL_SIZE |
75 | | -#define PKCS11_MAX_LABEL_SIZE 30 |
| 75 | +#define PKCS11_MAX_LABEL_SIZE @PKCS11_MAX_LABEL_SIZE@ |
76 | 76 | #endif |
77 | 77 |
|
78 | 78 | /** Define to always convert PIN using KDF */ |
|
83 | 83 |
|
84 | 84 | /** Define how many iterations PBKDF2 will use for PIN KDF */ |
85 | 85 | #if defined(PKCS11_PIN_PBKDF2_EN) && !defined(PKCS11_PIN_PBKDF2_ITERATIONS) |
86 | | -#define PKCS11_PIN_PBKDF2_ITERATIONS 2 |
87 | | -#endif |
| 86 | +#define PKCS11_PIN_PBKDF2_ITERATIONS @PKCS11_PIN_PBKDF2_ITERATIONS@ |
| 87 | +#endif |
88 | 88 |
|
89 | 89 | /****************************************************************************/ |
90 | 90 | /* The following configuration options are for fine tuning of the library */ |
|
96 | 96 | intends to use. Otherwise compilers will not be able to optimize out the unusued |
97 | 97 | functions */ |
98 | 98 | #ifndef PKCS11_EXTERNAL_FUNCTION_LIST |
99 | | -#define PKCS11_EXTERNAL_FUNCTION_LIST 0 |
| 99 | +#cmakedefine01 PKCS11_EXTERNAL_FUNCTION_LIST |
100 | 100 | #endif |
101 | 101 |
|
102 | 102 | /** Static Search Attribute Cache in bytes (variable number of attributes based |
103 | 103 | on size and memory requirements) */ |
104 | 104 | #ifndef PKCS11_SEARCH_CACHE_SIZE |
105 | | -#define PKCS11_SEARCH_CACHE_SIZE 250 |
| 105 | +#define PKCS11_SEARCH_CACHE_SIZE @PKCS11_SEARCH_CACHE_SIZE@ |
106 | 106 | #endif |
107 | 107 |
|
108 | 108 | /** Support for configuring a "blank" or new device */ |
109 | 109 | #ifndef PKCS11_TOKEN_INIT_SUPPORT |
110 | | -#define PKCS11_TOKEN_INIT_SUPPORT 1 |
| 110 | +#cmakedefine01 PKCS11_TOKEN_INIT_SUPPORT |
111 | 111 | #endif |
112 | 112 |
|
113 | 113 | /** Include the monotonic hardware feature as an object */ |
114 | 114 | #ifndef PKCS11_MONOTONIC_ENABLE |
115 | | -#define PKCS11_MONOTONIC_ENABLE 0 |
| 115 | +#cmakedefine01 PKCS11_MONOTONIC_ENABLE |
116 | 116 | #endif |
117 | 117 |
|
| 118 | +/** Automatically generate CKA_ID values based on standards */ |
| 119 | +#ifndef PKCS11_AUTO_ID_ENABLE |
| 120 | +#cmakedefine01 PKCS11_AUTO_ID_ENABLE |
| 121 | +#endif |
118 | 122 |
|
119 | 123 | #include "pkcs11/cryptoki.h" |
120 | 124 | #include <stddef.h> |
|
0 commit comments