diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/store/store.h | 255 |
1 files changed, 141 insertions, 114 deletions
diff --git a/src/lib/libcrypto/store/store.h b/src/lib/libcrypto/store/store.h index 0a28c7d5a2..1a29ca2da5 100644 --- a/src/lib/libcrypto/store/store.h +++ b/src/lib/libcrypto/store/store.h | |||
@@ -10,7 +10,7 @@ | |||
10 | * are met: | 10 | * are met: |
11 | * | 11 | * |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * | 14 | * |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
@@ -113,8 +113,8 @@ int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void)); | |||
113 | #define STORE_set_app_data(s,arg) STORE_set_ex_data(s,0,arg) | 113 | #define STORE_set_app_data(s,arg) STORE_set_ex_data(s,0,arg) |
114 | #define STORE_get_app_data(s) STORE_get_ex_data(s,0) | 114 | #define STORE_get_app_data(s) STORE_get_ex_data(s,0) |
115 | int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 115 | int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
116 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 116 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
117 | int STORE_set_ex_data(STORE *r,int idx,void *arg); | 117 | int STORE_set_ex_data(STORE *r, int idx, void *arg); |
118 | void *STORE_get_ex_data(STORE *r, int idx); | 118 | void *STORE_get_ex_data(STORE *r, int idx); |
119 | 119 | ||
120 | /* Use specific methods instead of the built-in one */ | 120 | /* Use specific methods instead of the built-in one */ |
@@ -138,8 +138,7 @@ const STORE_METHOD *STORE_File(void); | |||
138 | 138 | ||
139 | /* Store functions take a type code for the type of data they should store | 139 | /* Store functions take a type code for the type of data they should store |
140 | or fetch */ | 140 | or fetch */ |
141 | typedef enum STORE_object_types | 141 | typedef enum STORE_object_types { |
142 | { | ||
143 | STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */ | 142 | STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */ |
144 | STORE_OBJECT_TYPE_X509_CRL= 0x02, /* X509_CRL * */ | 143 | STORE_OBJECT_TYPE_X509_CRL= 0x02, /* X509_CRL * */ |
145 | STORE_OBJECT_TYPE_PRIVATE_KEY= 0x03, /* EVP_PKEY * */ | 144 | STORE_OBJECT_TYPE_PRIVATE_KEY= 0x03, /* EVP_PKEY * */ |
@@ -148,15 +147,14 @@ typedef enum STORE_object_types | |||
148 | STORE_OBJECT_TYPE_ARBITRARY= 0x06, /* BUF_MEM * */ | 147 | STORE_OBJECT_TYPE_ARBITRARY= 0x06, /* BUF_MEM * */ |
149 | STORE_OBJECT_TYPE_NUM= 0x06 /* The amount of known | 148 | STORE_OBJECT_TYPE_NUM= 0x06 /* The amount of known |
150 | object types */ | 149 | object types */ |
151 | } STORE_OBJECT_TYPES; | 150 | } STORE_OBJECT_TYPES; |
152 | /* List of text strings corresponding to the object types. */ | 151 | /* List of text strings corresponding to the object types. */ |
153 | extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM+1]; | 152 | extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM + 1]; |
154 | 153 | ||
155 | /* Some store functions take a parameter list. Those parameters come with | 154 | /* Some store functions take a parameter list. Those parameters come with |
156 | one of the following codes. The comments following the codes below indicate | 155 | one of the following codes. The comments following the codes below indicate |
157 | what type the value should be a pointer to. */ | 156 | what type the value should be a pointer to. */ |
158 | typedef enum STORE_params | 157 | typedef enum STORE_params { |
159 | { | ||
160 | STORE_PARAM_EVP_TYPE= 0x01, /* int */ | 158 | STORE_PARAM_EVP_TYPE= 0x01, /* int */ |
161 | STORE_PARAM_BITS= 0x02, /* size_t */ | 159 | STORE_PARAM_BITS= 0x02, /* size_t */ |
162 | STORE_PARAM_KEY_PARAMETERS= 0x03, /* ??? */ | 160 | STORE_PARAM_KEY_PARAMETERS= 0x03, /* ??? */ |
@@ -165,16 +163,15 @@ typedef enum STORE_params | |||
165 | STORE_PARAM_AUTH_KRB5_TICKET= 0x06, /* void * */ | 163 | STORE_PARAM_AUTH_KRB5_TICKET= 0x06, /* void * */ |
166 | STORE_PARAM_TYPE_NUM= 0x06 /* The amount of known | 164 | STORE_PARAM_TYPE_NUM= 0x06 /* The amount of known |
167 | parameter types */ | 165 | parameter types */ |
168 | } STORE_PARAM_TYPES; | 166 | } STORE_PARAM_TYPES; |
169 | /* Parameter value sizes. -1 means unknown, anything else is the required size. */ | 167 | /* Parameter value sizes. -1 means unknown, anything else is the required size. */ |
170 | extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM+1]; | 168 | extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM + 1]; |
171 | 169 | ||
172 | /* Store functions take attribute lists. Those attributes come with codes. | 170 | /* Store functions take attribute lists. Those attributes come with codes. |
173 | The comments following the codes below indicate what type the value should | 171 | The comments following the codes below indicate what type the value should |
174 | be a pointer to. */ | 172 | be a pointer to. */ |
175 | typedef enum STORE_attribs | 173 | typedef enum STORE_attribs { |
176 | { | 174 | STORE_ATTR_END = 0x00, |
177 | STORE_ATTR_END= 0x00, | ||
178 | STORE_ATTR_FRIENDLYNAME= 0x01, /* C string */ | 175 | STORE_ATTR_FRIENDLYNAME= 0x01, /* C string */ |
179 | STORE_ATTR_KEYID= 0x02, /* 160 bit string (SHA1) */ | 176 | STORE_ATTR_KEYID= 0x02, /* 160 bit string (SHA1) */ |
180 | STORE_ATTR_ISSUERKEYID= 0x03, /* 160 bit string (SHA1) */ | 177 | STORE_ATTR_ISSUERKEYID= 0x03, /* 160 bit string (SHA1) */ |
@@ -192,132 +189,129 @@ typedef enum STORE_attribs | |||
192 | separator, which | 189 | separator, which |
193 | expresses the OR | 190 | expresses the OR |
194 | operation. */ | 191 | operation. */ |
195 | } STORE_ATTR_TYPES; | 192 | } STORE_ATTR_TYPES; |
193 | |||
196 | /* Attribute value sizes. -1 means unknown, anything else is the required size. */ | 194 | /* Attribute value sizes. -1 means unknown, anything else is the required size. */ |
197 | extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM+1]; | 195 | extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM + 1]; |
198 | 196 | ||
199 | typedef enum STORE_certificate_status | 197 | typedef enum STORE_certificate_status { |
200 | { | 198 | STORE_X509_VALID = 0x00, |
201 | STORE_X509_VALID= 0x00, | 199 | STORE_X509_EXPIRED = 0x01, |
202 | STORE_X509_EXPIRED= 0x01, | 200 | STORE_X509_SUSPENDED = 0x02, |
203 | STORE_X509_SUSPENDED= 0x02, | 201 | STORE_X509_REVOKED = 0x03 |
204 | STORE_X509_REVOKED= 0x03 | 202 | } STORE_CERTIFICATE_STATUS; |
205 | } STORE_CERTIFICATE_STATUS; | ||
206 | 203 | ||
207 | /* Engine store functions will return a structure that contains all the necessary | 204 | /* Engine store functions will return a structure that contains all the necessary |
208 | * information, including revokation status for certificates. This is really not | 205 | * information, including revokation status for certificates. This is really not |
209 | * needed for application authors, as the ENGINE framework functions will extract | 206 | * needed for application authors, as the ENGINE framework functions will extract |
210 | * the OpenSSL-specific information when at all possible. However, for engine | 207 | * the OpenSSL-specific information when at all possible. However, for engine |
211 | * authors, it's crucial to know this structure. */ | 208 | * authors, it's crucial to know this structure. */ |
212 | typedef struct STORE_OBJECT_st | 209 | typedef struct STORE_OBJECT_st { |
213 | { | ||
214 | STORE_OBJECT_TYPES type; | 210 | STORE_OBJECT_TYPES type; |
215 | union | 211 | union |
216 | { | 212 | { |
217 | struct | 213 | struct { |
218 | { | ||
219 | STORE_CERTIFICATE_STATUS status; | 214 | STORE_CERTIFICATE_STATUS status; |
220 | X509 *certificate; | 215 | X509 *certificate; |
221 | } x509; | 216 | } x509; |
222 | X509_CRL *crl; | 217 | X509_CRL *crl; |
223 | EVP_PKEY *key; | 218 | EVP_PKEY *key; |
224 | BIGNUM *number; | 219 | BIGNUM *number; |
225 | BUF_MEM *arbitrary; | 220 | BUF_MEM *arbitrary; |
226 | } data; | 221 | } data; |
227 | } STORE_OBJECT; | 222 | } STORE_OBJECT; |
223 | |||
228 | DECLARE_STACK_OF(STORE_OBJECT) | 224 | DECLARE_STACK_OF(STORE_OBJECT) |
229 | STORE_OBJECT *STORE_OBJECT_new(void); | 225 | STORE_OBJECT *STORE_OBJECT_new(void); |
230 | void STORE_OBJECT_free(STORE_OBJECT *data); | 226 | void STORE_OBJECT_free(STORE_OBJECT *data); |
231 | 227 | ||
232 | 228 | ||
233 | |||
234 | /* The following functions handle the storage. They return 0, a negative number | 229 | /* The following functions handle the storage. They return 0, a negative number |
235 | or NULL on error, anything else on success. */ | 230 | or NULL on error, anything else on success. */ |
236 | X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[], | 231 | X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[], |
237 | OPENSSL_ITEM parameters[]); | 232 | OPENSSL_ITEM parameters[]); |
238 | int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[], | 233 | int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[], |
239 | OPENSSL_ITEM parameters[]); | 234 | OPENSSL_ITEM parameters[]); |
240 | int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[], | 235 | int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[], |
241 | OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], | 236 | OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], |
242 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 237 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); |
243 | int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[], | 238 | int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[], |
244 | OPENSSL_ITEM parameters[]); | 239 | OPENSSL_ITEM parameters[]); |
245 | int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[], | 240 | int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[], |
246 | OPENSSL_ITEM parameters[]); | 241 | OPENSSL_ITEM parameters[]); |
247 | void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[], | 242 | void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[], |
248 | OPENSSL_ITEM parameters[]); | 243 | OPENSSL_ITEM parameters[]); |
249 | X509 *STORE_list_certificate_next(STORE *e, void *handle); | 244 | X509 *STORE_list_certificate_next(STORE *e, void *handle); |
250 | int STORE_list_certificate_end(STORE *e, void *handle); | 245 | int STORE_list_certificate_end(STORE *e, void *handle); |
251 | int STORE_list_certificate_endp(STORE *e, void *handle); | 246 | int STORE_list_certificate_endp(STORE *e, void *handle); |
252 | EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[], | 247 | EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[], |
253 | OPENSSL_ITEM parameters[]); | 248 | OPENSSL_ITEM parameters[]); |
254 | EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[], | 249 | EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[], |
255 | OPENSSL_ITEM parameters[]); | 250 | OPENSSL_ITEM parameters[]); |
256 | int STORE_store_private_key(STORE *e, EVP_PKEY *data, | 251 | int STORE_store_private_key(STORE *e, EVP_PKEY *data, |
257 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 252 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); |
258 | int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[], | 253 | int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[], |
259 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | 254 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], |
260 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 255 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); |
261 | int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[], | 256 | int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[], |
262 | OPENSSL_ITEM parameters[]); | 257 | OPENSSL_ITEM parameters[]); |
263 | int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[], | 258 | int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[], |
264 | OPENSSL_ITEM parameters[]); | 259 | OPENSSL_ITEM parameters[]); |
265 | void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[], | 260 | void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[], |
266 | OPENSSL_ITEM parameters[]); | 261 | OPENSSL_ITEM parameters[]); |
267 | EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle); | 262 | EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle); |
268 | int STORE_list_private_key_end(STORE *e, void *handle); | 263 | int STORE_list_private_key_end(STORE *e, void *handle); |
269 | int STORE_list_private_key_endp(STORE *e, void *handle); | 264 | int STORE_list_private_key_endp(STORE *e, void *handle); |
270 | EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[], | 265 | EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[], |
271 | OPENSSL_ITEM parameters[]); | 266 | OPENSSL_ITEM parameters[]); |
272 | int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[], | 267 | int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[], |
273 | OPENSSL_ITEM parameters[]); | 268 | OPENSSL_ITEM parameters[]); |
274 | int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[], | 269 | int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[], |
275 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | 270 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], |
276 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 271 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); |
277 | int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[], | 272 | int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[], |
278 | OPENSSL_ITEM parameters[]); | 273 | OPENSSL_ITEM parameters[]); |
279 | int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[], | 274 | int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[], |
280 | OPENSSL_ITEM parameters[]); | 275 | OPENSSL_ITEM parameters[]); |
281 | void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[], | 276 | void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[], |
282 | OPENSSL_ITEM parameters[]); | 277 | OPENSSL_ITEM parameters[]); |
283 | EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle); | 278 | EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle); |
284 | int STORE_list_public_key_end(STORE *e, void *handle); | 279 | int STORE_list_public_key_end(STORE *e, void *handle); |
285 | int STORE_list_public_key_endp(STORE *e, void *handle); | 280 | int STORE_list_public_key_endp(STORE *e, void *handle); |
286 | X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[], | 281 | X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[], |
287 | OPENSSL_ITEM parameters[]); | 282 | OPENSSL_ITEM parameters[]); |
288 | X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[], | 283 | X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[], |
289 | OPENSSL_ITEM parameters[]); | 284 | OPENSSL_ITEM parameters[]); |
290 | int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[], | 285 | int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[], |
291 | OPENSSL_ITEM parameters[]); | 286 | OPENSSL_ITEM parameters[]); |
292 | int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[], | 287 | int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[], |
293 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | 288 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], |
294 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 289 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); |
295 | int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[], | 290 | int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[], |
296 | OPENSSL_ITEM parameters[]); | 291 | OPENSSL_ITEM parameters[]); |
297 | void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[], | 292 | void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[], |
298 | OPENSSL_ITEM parameters[]); | 293 | OPENSSL_ITEM parameters[]); |
299 | X509_CRL *STORE_list_crl_next(STORE *e, void *handle); | 294 | X509_CRL *STORE_list_crl_next(STORE *e, void *handle); |
300 | int STORE_list_crl_end(STORE *e, void *handle); | 295 | int STORE_list_crl_end(STORE *e, void *handle); |
301 | int STORE_list_crl_endp(STORE *e, void *handle); | 296 | int STORE_list_crl_endp(STORE *e, void *handle); |
302 | int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[], | 297 | int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[], |
303 | OPENSSL_ITEM parameters[]); | 298 | OPENSSL_ITEM parameters[]); |
304 | int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[], | 299 | int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[], |
305 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | 300 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], |
306 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 301 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); |
307 | BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[], | 302 | BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[], |
308 | OPENSSL_ITEM parameters[]); | 303 | OPENSSL_ITEM parameters[]); |
309 | int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[], | 304 | int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[], |
310 | OPENSSL_ITEM parameters[]); | 305 | OPENSSL_ITEM parameters[]); |
311 | int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[], | 306 | int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[], |
312 | OPENSSL_ITEM parameters[]); | 307 | OPENSSL_ITEM parameters[]); |
313 | int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[], | 308 | int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[], |
314 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | 309 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], |
315 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 310 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); |
316 | BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[], | 311 | BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[], |
317 | OPENSSL_ITEM parameters[]); | 312 | OPENSSL_ITEM parameters[]); |
318 | int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[], | 313 | int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[], |
319 | OPENSSL_ITEM parameters[]); | 314 | OPENSSL_ITEM parameters[]); |
320 | |||
321 | 315 | ||
322 | /* Create and manipulate methods */ | 316 | /* Create and manipulate methods */ |
323 | STORE_METHOD *STORE_create_method(char *name); | 317 | STORE_METHOD *STORE_create_method(char *name); |
@@ -326,43 +320,74 @@ void STORE_destroy_method(STORE_METHOD *store_method); | |||
326 | /* These callback types are use for store handlers */ | 320 | /* These callback types are use for store handlers */ |
327 | typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *); | 321 | typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *); |
328 | typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *); | 322 | typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *); |
329 | typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 323 | typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, |
330 | typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 324 | STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], |
331 | typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 325 | OPENSSL_ITEM parameters[]); |
326 | typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *, | ||
327 | STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], | ||
328 | OPENSSL_ITEM parameters[]); | ||
329 | typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, | ||
330 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | ||
332 | typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle); | 331 | typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle); |
333 | typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle); | 332 | typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle); |
334 | typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 333 | typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, |
335 | typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 334 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); |
336 | typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | 335 | typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, |
337 | typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | 336 | STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); |
338 | typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, void (*f)(void)); | 337 | typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, |
339 | 338 | OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], | |
340 | int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f); | 339 | OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], |
341 | int STORE_method_set_cleanup_function(STORE_METHOD *sm, STORE_CLEANUP_FUNC_PTR clean_f); | 340 | OPENSSL_ITEM parameters[]); |
342 | int STORE_method_set_generate_function(STORE_METHOD *sm, STORE_GENERATE_OBJECT_FUNC_PTR generate_f); | 341 | typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], |
343 | int STORE_method_set_get_function(STORE_METHOD *sm, STORE_GET_OBJECT_FUNC_PTR get_f); | 342 | OPENSSL_ITEM parameters[]); |
344 | int STORE_method_set_store_function(STORE_METHOD *sm, STORE_STORE_OBJECT_FUNC_PTR store_f); | 343 | typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, |
345 | int STORE_method_set_modify_function(STORE_METHOD *sm, STORE_MODIFY_OBJECT_FUNC_PTR store_f); | 344 | void (*f)(void)); |
346 | int STORE_method_set_revoke_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR revoke_f); | 345 | |
347 | int STORE_method_set_delete_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR delete_f); | 346 | int STORE_method_set_initialise_function(STORE_METHOD *sm, |
348 | int STORE_method_set_list_start_function(STORE_METHOD *sm, STORE_START_OBJECT_FUNC_PTR list_start_f); | 347 | STORE_INITIALISE_FUNC_PTR init_f); |
349 | int STORE_method_set_list_next_function(STORE_METHOD *sm, STORE_NEXT_OBJECT_FUNC_PTR list_next_f); | 348 | int STORE_method_set_cleanup_function(STORE_METHOD *sm, |
350 | int STORE_method_set_list_end_function(STORE_METHOD *sm, STORE_END_OBJECT_FUNC_PTR list_end_f); | 349 | STORE_CLEANUP_FUNC_PTR clean_f); |
351 | int STORE_method_set_update_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); | 350 | int STORE_method_set_generate_function(STORE_METHOD *sm, |
352 | int STORE_method_set_lock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); | 351 | STORE_GENERATE_OBJECT_FUNC_PTR generate_f); |
353 | int STORE_method_set_unlock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); | 352 | int STORE_method_set_get_function(STORE_METHOD *sm, |
354 | int STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f); | 353 | STORE_GET_OBJECT_FUNC_PTR get_f); |
355 | 354 | int STORE_method_set_store_function(STORE_METHOD *sm, | |
356 | STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(STORE_METHOD *sm); | 355 | STORE_STORE_OBJECT_FUNC_PTR store_f); |
356 | int STORE_method_set_modify_function(STORE_METHOD *sm, | ||
357 | STORE_MODIFY_OBJECT_FUNC_PTR store_f); | ||
358 | int STORE_method_set_revoke_function(STORE_METHOD *sm, | ||
359 | STORE_HANDLE_OBJECT_FUNC_PTR revoke_f); | ||
360 | int STORE_method_set_delete_function(STORE_METHOD *sm, | ||
361 | STORE_HANDLE_OBJECT_FUNC_PTR delete_f); | ||
362 | int STORE_method_set_list_start_function(STORE_METHOD *sm, | ||
363 | STORE_START_OBJECT_FUNC_PTR list_start_f); | ||
364 | int STORE_method_set_list_next_function(STORE_METHOD *sm, | ||
365 | STORE_NEXT_OBJECT_FUNC_PTR list_next_f); | ||
366 | int STORE_method_set_list_end_function(STORE_METHOD *sm, | ||
367 | STORE_END_OBJECT_FUNC_PTR list_end_f); | ||
368 | int STORE_method_set_update_store_function(STORE_METHOD *sm, | ||
369 | STORE_GENERIC_FUNC_PTR); | ||
370 | int STORE_method_set_lock_store_function(STORE_METHOD *sm, | ||
371 | STORE_GENERIC_FUNC_PTR); | ||
372 | int STORE_method_set_unlock_store_function(STORE_METHOD *sm, | ||
373 | STORE_GENERIC_FUNC_PTR); | ||
374 | int STORE_method_set_ctrl_function(STORE_METHOD *sm, | ||
375 | STORE_CTRL_FUNC_PTR ctrl_f); | ||
376 | |||
377 | STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function( | ||
378 | STORE_METHOD *sm); | ||
357 | STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm); | 379 | STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm); |
358 | STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(STORE_METHOD *sm); | 380 | STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function( |
381 | STORE_METHOD *sm); | ||
359 | STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm); | 382 | STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm); |
360 | STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm); | 383 | STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm); |
361 | STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm); | 384 | STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm); |
362 | STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm); | 385 | STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm); |
363 | STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm); | 386 | STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm); |
364 | STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(STORE_METHOD *sm); | 387 | STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function( |
365 | STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(STORE_METHOD *sm); | 388 | STORE_METHOD *sm); |
389 | STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function( | ||
390 | STORE_METHOD *sm); | ||
366 | STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm); | 391 | STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm); |
367 | STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm); | 392 | STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm); |
368 | STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm); | 393 | STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm); |
@@ -392,30 +417,32 @@ int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs); | |||
392 | /* Manipulators */ | 417 | /* Manipulators */ |
393 | char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); | 418 | char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); |
394 | unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, | 419 | unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, |
395 | STORE_ATTR_TYPES code); | 420 | STORE_ATTR_TYPES code); |
396 | X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); | 421 | X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, |
397 | BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); | 422 | STORE_ATTR_TYPES code); |
423 | BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, | ||
424 | STORE_ATTR_TYPES code); | ||
398 | int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 425 | int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
399 | char *cstr, size_t cstr_size); | 426 | char *cstr, size_t cstr_size); |
400 | int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 427 | int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
401 | unsigned char *sha1str, size_t sha1str_size); | 428 | unsigned char *sha1str, size_t sha1str_size); |
402 | int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 429 | int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
403 | X509_NAME *dn); | 430 | X509_NAME *dn); |
404 | int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 431 | int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
405 | BIGNUM *number); | 432 | BIGNUM *number); |
406 | int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 433 | int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
407 | char *cstr, size_t cstr_size); | 434 | char *cstr, size_t cstr_size); |
408 | int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 435 | int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, |
409 | unsigned char *sha1str, size_t sha1str_size); | 436 | STORE_ATTR_TYPES code, unsigned char *sha1str, size_t sha1str_size); |
410 | int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 437 | int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
411 | X509_NAME *dn); | 438 | X509_NAME *dn); |
412 | int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | 439 | int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, |
413 | BIGNUM *number); | 440 | BIGNUM *number); |
414 | 441 | ||
415 | /* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values | 442 | /* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values |
416 | in each contained attribute. */ | 443 | in each contained attribute. */ |
417 | int STORE_ATTR_INFO_compare(const STORE_ATTR_INFO * const *a, | 444 | int STORE_ATTR_INFO_compare(const STORE_ATTR_INFO * const *a, |
418 | const STORE_ATTR_INFO * const *b); | 445 | const STORE_ATTR_INFO * const *b); |
419 | /* Check if the set of attributes in a is within the range of attributes | 446 | /* Check if the set of attributes in a is within the range of attributes |
420 | set in b. */ | 447 | set in b. */ |
421 | int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); | 448 | int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); |