diff options
Diffstat (limited to 'src/lib/libcrypto/store/store.h')
-rw-r--r-- | src/lib/libcrypto/store/store.h | 588 |
1 files changed, 0 insertions, 588 deletions
diff --git a/src/lib/libcrypto/store/store.h b/src/lib/libcrypto/store/store.h deleted file mode 100644 index 4be5a4c277..0000000000 --- a/src/lib/libcrypto/store/store.h +++ /dev/null | |||
@@ -1,588 +0,0 @@ | |||
1 | /* $OpenBSD: store.h,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ | ||
2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
3 | * project 2003. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2003 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * openssl-core@openssl.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #ifndef HEADER_STORE_H | ||
60 | #define HEADER_STORE_H | ||
61 | |||
62 | #include <openssl/opensslconf.h> | ||
63 | |||
64 | #ifdef OPENSSL_NO_STORE | ||
65 | #error STORE is disabled. | ||
66 | #endif | ||
67 | |||
68 | #include <openssl/ossl_typ.h> | ||
69 | #ifndef OPENSSL_NO_DEPRECATED | ||
70 | #include <openssl/evp.h> | ||
71 | #include <openssl/bn.h> | ||
72 | #include <openssl/x509.h> | ||
73 | #endif | ||
74 | |||
75 | #ifdef __cplusplus | ||
76 | extern "C" { | ||
77 | #endif | ||
78 | |||
79 | /* Already defined in ossl_typ.h */ | ||
80 | /* typedef struct store_st STORE; */ | ||
81 | /* typedef struct store_method_st STORE_METHOD; */ | ||
82 | |||
83 | |||
84 | /* All the following functions return 0, a negative number or NULL on error. | ||
85 | When everything is fine, they return a positive value or a non-NULL | ||
86 | pointer, all depending on their purpose. */ | ||
87 | |||
88 | /* Creators and destructor. */ | ||
89 | STORE *STORE_new_method(const STORE_METHOD *method); | ||
90 | STORE *STORE_new_engine(ENGINE *engine); | ||
91 | void STORE_free(STORE *ui); | ||
92 | |||
93 | |||
94 | /* Give a user interface parametrised control commands. This can be used to | ||
95 | send down an integer, a data pointer or a function pointer, as well as | ||
96 | be used to get information from a STORE. */ | ||
97 | int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void)); | ||
98 | |||
99 | /* A control to set the directory with keys and certificates. Used by the | ||
100 | built-in directory level method. */ | ||
101 | #define STORE_CTRL_SET_DIRECTORY 0x0001 | ||
102 | /* A control to set a file to load. Used by the built-in file level method. */ | ||
103 | #define STORE_CTRL_SET_FILE 0x0002 | ||
104 | /* A control to set a configuration file to load. Can be used by any method | ||
105 | that wishes to load a configuration file. */ | ||
106 | #define STORE_CTRL_SET_CONF_FILE 0x0003 | ||
107 | /* A control to set a the section of the loaded configuration file. Can be | ||
108 | used by any method that wishes to load a configuration file. */ | ||
109 | #define STORE_CTRL_SET_CONF_SECTION 0x0004 | ||
110 | |||
111 | |||
112 | /* Some methods may use extra data */ | ||
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) | ||
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); | ||
117 | int STORE_set_ex_data(STORE *r, int idx, void *arg); | ||
118 | void *STORE_get_ex_data(STORE *r, int idx); | ||
119 | |||
120 | /* Use specific methods instead of the built-in one */ | ||
121 | const STORE_METHOD *STORE_get_method(STORE *store); | ||
122 | const STORE_METHOD *STORE_set_method(STORE *store, const STORE_METHOD *meth); | ||
123 | |||
124 | /* The standard OpenSSL methods. */ | ||
125 | /* This is the in-memory method. It does everything except revoking and updating, | ||
126 | and is of course volatile. It's used by other methods that have an in-memory | ||
127 | cache. */ | ||
128 | const STORE_METHOD *STORE_Memory(void); | ||
129 | #if 0 /* Not yet implemented */ | ||
130 | /* This is the directory store. It does everything except revoking and updating, | ||
131 | and uses STORE_Memory() to cache things in memory. */ | ||
132 | const STORE_METHOD *STORE_Directory(void); | ||
133 | /* This is the file store. It does everything except revoking and updating, | ||
134 | and uses STORE_Memory() to cache things in memory. Certificates are added | ||
135 | to it with the store operation, and it will only get cached certificates. */ | ||
136 | const STORE_METHOD *STORE_File(void); | ||
137 | #endif | ||
138 | |||
139 | /* Store functions take a type code for the type of data they should store | ||
140 | or fetch */ | ||
141 | typedef enum STORE_object_types { | ||
142 | STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */ | ||
143 | STORE_OBJECT_TYPE_X509_CRL= 0x02, /* X509_CRL * */ | ||
144 | STORE_OBJECT_TYPE_PRIVATE_KEY= 0x03, /* EVP_PKEY * */ | ||
145 | STORE_OBJECT_TYPE_PUBLIC_KEY= 0x04, /* EVP_PKEY * */ | ||
146 | STORE_OBJECT_TYPE_NUMBER= 0x05, /* BIGNUM * */ | ||
147 | STORE_OBJECT_TYPE_ARBITRARY= 0x06, /* BUF_MEM * */ | ||
148 | STORE_OBJECT_TYPE_NUM= 0x06 /* The amount of known | ||
149 | object types */ | ||
150 | } STORE_OBJECT_TYPES; | ||
151 | /* List of text strings corresponding to the object types. */ | ||
152 | extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM + 1]; | ||
153 | |||
154 | /* Some store functions take a parameter list. Those parameters come with | ||
155 | one of the following codes. The comments following the codes below indicate | ||
156 | what type the value should be a pointer to. */ | ||
157 | typedef enum STORE_params { | ||
158 | STORE_PARAM_EVP_TYPE= 0x01, /* int */ | ||
159 | STORE_PARAM_BITS= 0x02, /* size_t */ | ||
160 | STORE_PARAM_KEY_PARAMETERS= 0x03, /* ??? */ | ||
161 | STORE_PARAM_KEY_NO_PARAMETERS= 0x04, /* N/A */ | ||
162 | STORE_PARAM_AUTH_PASSPHRASE= 0x05, /* char * */ | ||
163 | STORE_PARAM_AUTH_KRB5_TICKET= 0x06, /* void * */ | ||
164 | STORE_PARAM_TYPE_NUM= 0x06 /* The amount of known | ||
165 | parameter types */ | ||
166 | } STORE_PARAM_TYPES; | ||
167 | /* Parameter value sizes. -1 means unknown, anything else is the required size. */ | ||
168 | extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM + 1]; | ||
169 | |||
170 | /* Store functions take attribute lists. Those attributes come with codes. | ||
171 | The comments following the codes below indicate what type the value should | ||
172 | be a pointer to. */ | ||
173 | typedef enum STORE_attribs { | ||
174 | STORE_ATTR_END = 0x00, | ||
175 | STORE_ATTR_FRIENDLYNAME= 0x01, /* C string */ | ||
176 | STORE_ATTR_KEYID= 0x02, /* 160 bit string (SHA1) */ | ||
177 | STORE_ATTR_ISSUERKEYID= 0x03, /* 160 bit string (SHA1) */ | ||
178 | STORE_ATTR_SUBJECTKEYID= 0x04, /* 160 bit string (SHA1) */ | ||
179 | STORE_ATTR_ISSUERSERIALHASH= 0x05, /* 160 bit string (SHA1) */ | ||
180 | STORE_ATTR_ISSUER= 0x06, /* X509_NAME * */ | ||
181 | STORE_ATTR_SERIAL= 0x07, /* BIGNUM * */ | ||
182 | STORE_ATTR_SUBJECT= 0x08, /* X509_NAME * */ | ||
183 | STORE_ATTR_CERTHASH= 0x09, /* 160 bit string (SHA1) */ | ||
184 | STORE_ATTR_EMAIL= 0x0a, /* C string */ | ||
185 | STORE_ATTR_FILENAME= 0x0b, /* C string */ | ||
186 | STORE_ATTR_TYPE_NUM= 0x0b, /* The amount of known | ||
187 | attribute types */ | ||
188 | STORE_ATTR_OR= 0xff /* This is a special | ||
189 | separator, which | ||
190 | expresses the OR | ||
191 | operation. */ | ||
192 | } STORE_ATTR_TYPES; | ||
193 | |||
194 | /* Attribute value sizes. -1 means unknown, anything else is the required size. */ | ||
195 | extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM + 1]; | ||
196 | |||
197 | typedef enum STORE_certificate_status { | ||
198 | STORE_X509_VALID = 0x00, | ||
199 | STORE_X509_EXPIRED = 0x01, | ||
200 | STORE_X509_SUSPENDED = 0x02, | ||
201 | STORE_X509_REVOKED = 0x03 | ||
202 | } STORE_CERTIFICATE_STATUS; | ||
203 | |||
204 | /* Engine store functions will return a structure that contains all the necessary | ||
205 | * information, including revokation status for certificates. This is really not | ||
206 | * needed for application authors, as the ENGINE framework functions will extract | ||
207 | * the OpenSSL-specific information when at all possible. However, for engine | ||
208 | * authors, it's crucial to know this structure. */ | ||
209 | typedef struct STORE_OBJECT_st { | ||
210 | STORE_OBJECT_TYPES type; | ||
211 | union | ||
212 | { | ||
213 | struct { | ||
214 | STORE_CERTIFICATE_STATUS status; | ||
215 | X509 *certificate; | ||
216 | } x509; | ||
217 | X509_CRL *crl; | ||
218 | EVP_PKEY *key; | ||
219 | BIGNUM *number; | ||
220 | BUF_MEM *arbitrary; | ||
221 | } data; | ||
222 | } STORE_OBJECT; | ||
223 | |||
224 | DECLARE_STACK_OF(STORE_OBJECT) | ||
225 | STORE_OBJECT *STORE_OBJECT_new(void); | ||
226 | void STORE_OBJECT_free(STORE_OBJECT *data); | ||
227 | |||
228 | |||
229 | /* The following functions handle the storage. They return 0, a negative number | ||
230 | or NULL on error, anything else on success. */ | ||
231 | X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[], | ||
232 | OPENSSL_ITEM parameters[]); | ||
233 | int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[], | ||
234 | OPENSSL_ITEM parameters[]); | ||
235 | int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[], | ||
236 | OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], | ||
237 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | ||
238 | int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[], | ||
239 | OPENSSL_ITEM parameters[]); | ||
240 | int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[], | ||
241 | OPENSSL_ITEM parameters[]); | ||
242 | void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[], | ||
243 | OPENSSL_ITEM parameters[]); | ||
244 | X509 *STORE_list_certificate_next(STORE *e, void *handle); | ||
245 | int STORE_list_certificate_end(STORE *e, void *handle); | ||
246 | int STORE_list_certificate_endp(STORE *e, void *handle); | ||
247 | EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[], | ||
248 | OPENSSL_ITEM parameters[]); | ||
249 | EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[], | ||
250 | OPENSSL_ITEM parameters[]); | ||
251 | int STORE_store_private_key(STORE *e, EVP_PKEY *data, | ||
252 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | ||
253 | int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[], | ||
254 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | ||
255 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | ||
256 | int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[], | ||
257 | OPENSSL_ITEM parameters[]); | ||
258 | int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[], | ||
259 | OPENSSL_ITEM parameters[]); | ||
260 | void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[], | ||
261 | OPENSSL_ITEM parameters[]); | ||
262 | EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle); | ||
263 | int STORE_list_private_key_end(STORE *e, void *handle); | ||
264 | int STORE_list_private_key_endp(STORE *e, void *handle); | ||
265 | EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[], | ||
266 | OPENSSL_ITEM parameters[]); | ||
267 | int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[], | ||
268 | OPENSSL_ITEM parameters[]); | ||
269 | int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[], | ||
270 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | ||
271 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | ||
272 | int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[], | ||
273 | OPENSSL_ITEM parameters[]); | ||
274 | int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[], | ||
275 | OPENSSL_ITEM parameters[]); | ||
276 | void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[], | ||
277 | OPENSSL_ITEM parameters[]); | ||
278 | EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle); | ||
279 | int STORE_list_public_key_end(STORE *e, void *handle); | ||
280 | int STORE_list_public_key_endp(STORE *e, void *handle); | ||
281 | X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[], | ||
282 | OPENSSL_ITEM parameters[]); | ||
283 | X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[], | ||
284 | OPENSSL_ITEM parameters[]); | ||
285 | int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[], | ||
286 | OPENSSL_ITEM parameters[]); | ||
287 | int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[], | ||
288 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | ||
289 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | ||
290 | int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[], | ||
291 | OPENSSL_ITEM parameters[]); | ||
292 | void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[], | ||
293 | OPENSSL_ITEM parameters[]); | ||
294 | X509_CRL *STORE_list_crl_next(STORE *e, void *handle); | ||
295 | int STORE_list_crl_end(STORE *e, void *handle); | ||
296 | int STORE_list_crl_endp(STORE *e, void *handle); | ||
297 | int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[], | ||
298 | OPENSSL_ITEM parameters[]); | ||
299 | int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[], | ||
300 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | ||
301 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | ||
302 | BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[], | ||
303 | OPENSSL_ITEM parameters[]); | ||
304 | int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[], | ||
305 | OPENSSL_ITEM parameters[]); | ||
306 | int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[], | ||
307 | OPENSSL_ITEM parameters[]); | ||
308 | int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[], | ||
309 | OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], | ||
310 | OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); | ||
311 | BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[], | ||
312 | OPENSSL_ITEM parameters[]); | ||
313 | int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[], | ||
314 | OPENSSL_ITEM parameters[]); | ||
315 | |||
316 | /* Create and manipulate methods */ | ||
317 | STORE_METHOD *STORE_create_method(char *name); | ||
318 | void STORE_destroy_method(STORE_METHOD *store_method); | ||
319 | |||
320 | /* These callback types are use for store handlers */ | ||
321 | typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *); | ||
322 | typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *); | ||
323 | typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, | ||
324 | STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], | ||
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[]); | ||
331 | typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle); | ||
332 | typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle); | ||
333 | typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, | ||
334 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | ||
335 | typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, | ||
336 | STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); | ||
337 | typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, | ||
338 | OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], | ||
339 | OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], | ||
340 | OPENSSL_ITEM parameters[]); | ||
341 | typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], | ||
342 | OPENSSL_ITEM parameters[]); | ||
343 | typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, | ||
344 | void (*f)(void)); | ||
345 | |||
346 | int STORE_method_set_initialise_function(STORE_METHOD *sm, | ||
347 | STORE_INITIALISE_FUNC_PTR init_f); | ||
348 | int STORE_method_set_cleanup_function(STORE_METHOD *sm, | ||
349 | STORE_CLEANUP_FUNC_PTR clean_f); | ||
350 | int STORE_method_set_generate_function(STORE_METHOD *sm, | ||
351 | STORE_GENERATE_OBJECT_FUNC_PTR generate_f); | ||
352 | int STORE_method_set_get_function(STORE_METHOD *sm, | ||
353 | STORE_GET_OBJECT_FUNC_PTR get_f); | ||
354 | int STORE_method_set_store_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); | ||
379 | STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm); | ||
380 | STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function( | ||
381 | STORE_METHOD *sm); | ||
382 | STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm); | ||
383 | STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm); | ||
384 | STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm); | ||
385 | STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm); | ||
386 | STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm); | ||
387 | STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function( | ||
388 | STORE_METHOD *sm); | ||
389 | STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function( | ||
390 | STORE_METHOD *sm); | ||
391 | STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm); | ||
392 | STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm); | ||
393 | STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm); | ||
394 | STORE_GENERIC_FUNC_PTR STORE_method_get_unlock_store_function(STORE_METHOD *sm); | ||
395 | STORE_CTRL_FUNC_PTR STORE_method_get_ctrl_function(STORE_METHOD *sm); | ||
396 | |||
397 | /* Method helper structures and functions. */ | ||
398 | |||
399 | /* This structure is the result of parsing through the information in a list | ||
400 | of OPENSSL_ITEMs. It stores all the necessary information in a structured | ||
401 | way.*/ | ||
402 | typedef struct STORE_attr_info_st STORE_ATTR_INFO; | ||
403 | |||
404 | /* Parse a list of OPENSSL_ITEMs and return a pointer to a STORE_ATTR_INFO. | ||
405 | Note that we do this in the list form, since the list of OPENSSL_ITEMs can | ||
406 | come in blocks separated with STORE_ATTR_OR. Note that the value returned | ||
407 | by STORE_parse_attrs_next() must be freed with STORE_ATTR_INFO_free(). */ | ||
408 | void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes); | ||
409 | STORE_ATTR_INFO *STORE_parse_attrs_next(void *handle); | ||
410 | int STORE_parse_attrs_end(void *handle); | ||
411 | int STORE_parse_attrs_endp(void *handle); | ||
412 | |||
413 | /* Creator and destructor */ | ||
414 | STORE_ATTR_INFO *STORE_ATTR_INFO_new(void); | ||
415 | int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs); | ||
416 | |||
417 | /* Manipulators */ | ||
418 | char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); | ||
419 | unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, | ||
420 | STORE_ATTR_TYPES code); | ||
421 | X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, | ||
422 | STORE_ATTR_TYPES code); | ||
423 | BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, | ||
424 | STORE_ATTR_TYPES code); | ||
425 | int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
426 | char *cstr, size_t cstr_size); | ||
427 | int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
428 | unsigned char *sha1str, size_t sha1str_size); | ||
429 | int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
430 | X509_NAME *dn); | ||
431 | int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
432 | BIGNUM *number); | ||
433 | int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
434 | char *cstr, size_t cstr_size); | ||
435 | int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, | ||
436 | STORE_ATTR_TYPES code, unsigned char *sha1str, size_t sha1str_size); | ||
437 | int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
438 | X509_NAME *dn); | ||
439 | int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | ||
440 | BIGNUM *number); | ||
441 | |||
442 | /* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values | ||
443 | in each contained attribute. */ | ||
444 | int STORE_ATTR_INFO_compare(const STORE_ATTR_INFO * const *a, | ||
445 | const STORE_ATTR_INFO * const *b); | ||
446 | /* Check if the set of attributes in a is within the range of attributes | ||
447 | set in b. */ | ||
448 | int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); | ||
449 | /* Check if the set of attributes in a are also set in b. */ | ||
450 | int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); | ||
451 | /* Same as STORE_ATTR_INFO_in(), but also checks the attribute values. */ | ||
452 | int STORE_ATTR_INFO_in_ex(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); | ||
453 | |||
454 | |||
455 | /* BEGIN ERROR CODES */ | ||
456 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
457 | * made after this point may be overwritten when the script is next run. | ||
458 | */ | ||
459 | void ERR_load_STORE_strings(void); | ||
460 | |||
461 | /* Error codes for the STORE functions. */ | ||
462 | |||
463 | /* Function codes. */ | ||
464 | #define STORE_F_MEM_DELETE 134 | ||
465 | #define STORE_F_MEM_GENERATE 135 | ||
466 | #define STORE_F_MEM_LIST_END 168 | ||
467 | #define STORE_F_MEM_LIST_NEXT 136 | ||
468 | #define STORE_F_MEM_LIST_START 137 | ||
469 | #define STORE_F_MEM_MODIFY 169 | ||
470 | #define STORE_F_MEM_STORE 138 | ||
471 | #define STORE_F_STORE_ATTR_INFO_GET0_CSTR 139 | ||
472 | #define STORE_F_STORE_ATTR_INFO_GET0_DN 140 | ||
473 | #define STORE_F_STORE_ATTR_INFO_GET0_NUMBER 141 | ||
474 | #define STORE_F_STORE_ATTR_INFO_GET0_SHA1STR 142 | ||
475 | #define STORE_F_STORE_ATTR_INFO_MODIFY_CSTR 143 | ||
476 | #define STORE_F_STORE_ATTR_INFO_MODIFY_DN 144 | ||
477 | #define STORE_F_STORE_ATTR_INFO_MODIFY_NUMBER 145 | ||
478 | #define STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR 146 | ||
479 | #define STORE_F_STORE_ATTR_INFO_SET_CSTR 147 | ||
480 | #define STORE_F_STORE_ATTR_INFO_SET_DN 148 | ||
481 | #define STORE_F_STORE_ATTR_INFO_SET_NUMBER 149 | ||
482 | #define STORE_F_STORE_ATTR_INFO_SET_SHA1STR 150 | ||
483 | #define STORE_F_STORE_CERTIFICATE 170 | ||
484 | #define STORE_F_STORE_CTRL 161 | ||
485 | #define STORE_F_STORE_DELETE_ARBITRARY 158 | ||
486 | #define STORE_F_STORE_DELETE_CERTIFICATE 102 | ||
487 | #define STORE_F_STORE_DELETE_CRL 103 | ||
488 | #define STORE_F_STORE_DELETE_NUMBER 104 | ||
489 | #define STORE_F_STORE_DELETE_PRIVATE_KEY 105 | ||
490 | #define STORE_F_STORE_DELETE_PUBLIC_KEY 106 | ||
491 | #define STORE_F_STORE_GENERATE_CRL 107 | ||
492 | #define STORE_F_STORE_GENERATE_KEY 108 | ||
493 | #define STORE_F_STORE_GET_ARBITRARY 159 | ||
494 | #define STORE_F_STORE_GET_CERTIFICATE 109 | ||
495 | #define STORE_F_STORE_GET_CRL 110 | ||
496 | #define STORE_F_STORE_GET_NUMBER 111 | ||
497 | #define STORE_F_STORE_GET_PRIVATE_KEY 112 | ||
498 | #define STORE_F_STORE_GET_PUBLIC_KEY 113 | ||
499 | #define STORE_F_STORE_LIST_CERTIFICATE_END 114 | ||
500 | #define STORE_F_STORE_LIST_CERTIFICATE_ENDP 153 | ||
501 | #define STORE_F_STORE_LIST_CERTIFICATE_NEXT 115 | ||
502 | #define STORE_F_STORE_LIST_CERTIFICATE_START 116 | ||
503 | #define STORE_F_STORE_LIST_CRL_END 117 | ||
504 | #define STORE_F_STORE_LIST_CRL_ENDP 154 | ||
505 | #define STORE_F_STORE_LIST_CRL_NEXT 118 | ||
506 | #define STORE_F_STORE_LIST_CRL_START 119 | ||
507 | #define STORE_F_STORE_LIST_PRIVATE_KEY_END 120 | ||
508 | #define STORE_F_STORE_LIST_PRIVATE_KEY_ENDP 155 | ||
509 | #define STORE_F_STORE_LIST_PRIVATE_KEY_NEXT 121 | ||
510 | #define STORE_F_STORE_LIST_PRIVATE_KEY_START 122 | ||
511 | #define STORE_F_STORE_LIST_PUBLIC_KEY_END 123 | ||
512 | #define STORE_F_STORE_LIST_PUBLIC_KEY_ENDP 156 | ||
513 | #define STORE_F_STORE_LIST_PUBLIC_KEY_NEXT 124 | ||
514 | #define STORE_F_STORE_LIST_PUBLIC_KEY_START 125 | ||
515 | #define STORE_F_STORE_MODIFY_ARBITRARY 162 | ||
516 | #define STORE_F_STORE_MODIFY_CERTIFICATE 163 | ||
517 | #define STORE_F_STORE_MODIFY_CRL 164 | ||
518 | #define STORE_F_STORE_MODIFY_NUMBER 165 | ||
519 | #define STORE_F_STORE_MODIFY_PRIVATE_KEY 166 | ||
520 | #define STORE_F_STORE_MODIFY_PUBLIC_KEY 167 | ||
521 | #define STORE_F_STORE_NEW_ENGINE 133 | ||
522 | #define STORE_F_STORE_NEW_METHOD 132 | ||
523 | #define STORE_F_STORE_PARSE_ATTRS_END 151 | ||
524 | #define STORE_F_STORE_PARSE_ATTRS_ENDP 172 | ||
525 | #define STORE_F_STORE_PARSE_ATTRS_NEXT 152 | ||
526 | #define STORE_F_STORE_PARSE_ATTRS_START 171 | ||
527 | #define STORE_F_STORE_REVOKE_CERTIFICATE 129 | ||
528 | #define STORE_F_STORE_REVOKE_PRIVATE_KEY 130 | ||
529 | #define STORE_F_STORE_REVOKE_PUBLIC_KEY 131 | ||
530 | #define STORE_F_STORE_STORE_ARBITRARY 157 | ||
531 | #define STORE_F_STORE_STORE_CERTIFICATE 100 | ||
532 | #define STORE_F_STORE_STORE_CRL 101 | ||
533 | #define STORE_F_STORE_STORE_NUMBER 126 | ||
534 | #define STORE_F_STORE_STORE_PRIVATE_KEY 127 | ||
535 | #define STORE_F_STORE_STORE_PUBLIC_KEY 128 | ||
536 | |||
537 | /* Reason codes. */ | ||
538 | #define STORE_R_ALREADY_HAS_A_VALUE 127 | ||
539 | #define STORE_R_FAILED_DELETING_ARBITRARY 132 | ||
540 | #define STORE_R_FAILED_DELETING_CERTIFICATE 100 | ||
541 | #define STORE_R_FAILED_DELETING_KEY 101 | ||
542 | #define STORE_R_FAILED_DELETING_NUMBER 102 | ||
543 | #define STORE_R_FAILED_GENERATING_CRL 103 | ||
544 | #define STORE_R_FAILED_GENERATING_KEY 104 | ||
545 | #define STORE_R_FAILED_GETTING_ARBITRARY 133 | ||
546 | #define STORE_R_FAILED_GETTING_CERTIFICATE 105 | ||
547 | #define STORE_R_FAILED_GETTING_KEY 106 | ||
548 | #define STORE_R_FAILED_GETTING_NUMBER 107 | ||
549 | #define STORE_R_FAILED_LISTING_CERTIFICATES 108 | ||
550 | #define STORE_R_FAILED_LISTING_KEYS 109 | ||
551 | #define STORE_R_FAILED_MODIFYING_ARBITRARY 138 | ||
552 | #define STORE_R_FAILED_MODIFYING_CERTIFICATE 139 | ||
553 | #define STORE_R_FAILED_MODIFYING_CRL 140 | ||
554 | #define STORE_R_FAILED_MODIFYING_NUMBER 141 | ||
555 | #define STORE_R_FAILED_MODIFYING_PRIVATE_KEY 142 | ||
556 | #define STORE_R_FAILED_MODIFYING_PUBLIC_KEY 143 | ||
557 | #define STORE_R_FAILED_REVOKING_CERTIFICATE 110 | ||
558 | #define STORE_R_FAILED_REVOKING_KEY 111 | ||
559 | #define STORE_R_FAILED_STORING_ARBITRARY 134 | ||
560 | #define STORE_R_FAILED_STORING_CERTIFICATE 112 | ||
561 | #define STORE_R_FAILED_STORING_KEY 113 | ||
562 | #define STORE_R_FAILED_STORING_NUMBER 114 | ||
563 | #define STORE_R_NOT_IMPLEMENTED 128 | ||
564 | #define STORE_R_NO_CONTROL_FUNCTION 144 | ||
565 | #define STORE_R_NO_DELETE_ARBITRARY_FUNCTION 135 | ||
566 | #define STORE_R_NO_DELETE_NUMBER_FUNCTION 115 | ||
567 | #define STORE_R_NO_DELETE_OBJECT_FUNCTION 116 | ||
568 | #define STORE_R_NO_GENERATE_CRL_FUNCTION 117 | ||
569 | #define STORE_R_NO_GENERATE_OBJECT_FUNCTION 118 | ||
570 | #define STORE_R_NO_GET_OBJECT_ARBITRARY_FUNCTION 136 | ||
571 | #define STORE_R_NO_GET_OBJECT_FUNCTION 119 | ||
572 | #define STORE_R_NO_GET_OBJECT_NUMBER_FUNCTION 120 | ||
573 | #define STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION 131 | ||
574 | #define STORE_R_NO_LIST_OBJECT_END_FUNCTION 121 | ||
575 | #define STORE_R_NO_LIST_OBJECT_NEXT_FUNCTION 122 | ||
576 | #define STORE_R_NO_LIST_OBJECT_START_FUNCTION 123 | ||
577 | #define STORE_R_NO_MODIFY_OBJECT_FUNCTION 145 | ||
578 | #define STORE_R_NO_REVOKE_OBJECT_FUNCTION 124 | ||
579 | #define STORE_R_NO_STORE 129 | ||
580 | #define STORE_R_NO_STORE_OBJECT_ARBITRARY_FUNCTION 137 | ||
581 | #define STORE_R_NO_STORE_OBJECT_FUNCTION 125 | ||
582 | #define STORE_R_NO_STORE_OBJECT_NUMBER_FUNCTION 126 | ||
583 | #define STORE_R_NO_VALUE 130 | ||
584 | |||
585 | #ifdef __cplusplus | ||
586 | } | ||
587 | #endif | ||
588 | #endif | ||