summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/store/store.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/store/store.h255
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)
115int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 115int 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);
117int STORE_set_ex_data(STORE *r,int idx,void *arg); 117int STORE_set_ex_data(STORE *r, int idx, void *arg);
118void *STORE_get_ex_data(STORE *r, int idx); 118void *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 */
141typedef enum STORE_object_types 141typedef 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. */
153extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM+1]; 152extern 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. */
158typedef enum STORE_params 157typedef 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. */
170extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM+1]; 168extern 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. */
175typedef enum STORE_attribs 173typedef 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. */
197extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM+1]; 195extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM + 1];
198 196
199typedef enum STORE_certificate_status 197typedef 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. */
212typedef struct STORE_OBJECT_st 209typedef 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
228DECLARE_STACK_OF(STORE_OBJECT) 224DECLARE_STACK_OF(STORE_OBJECT)
229STORE_OBJECT *STORE_OBJECT_new(void); 225STORE_OBJECT *STORE_OBJECT_new(void);
230void STORE_OBJECT_free(STORE_OBJECT *data); 226void 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. */
236X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[], 231X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[],
237 OPENSSL_ITEM parameters[]); 232 OPENSSL_ITEM parameters[]);
238int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[], 233int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[],
239 OPENSSL_ITEM parameters[]); 234 OPENSSL_ITEM parameters[]);
240int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[], 235int 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[]);
243int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[], 238int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[],
244 OPENSSL_ITEM parameters[]); 239 OPENSSL_ITEM parameters[]);
245int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[], 240int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[],
246 OPENSSL_ITEM parameters[]); 241 OPENSSL_ITEM parameters[]);
247void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[], 242void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[],
248 OPENSSL_ITEM parameters[]); 243 OPENSSL_ITEM parameters[]);
249X509 *STORE_list_certificate_next(STORE *e, void *handle); 244X509 *STORE_list_certificate_next(STORE *e, void *handle);
250int STORE_list_certificate_end(STORE *e, void *handle); 245int STORE_list_certificate_end(STORE *e, void *handle);
251int STORE_list_certificate_endp(STORE *e, void *handle); 246int STORE_list_certificate_endp(STORE *e, void *handle);
252EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[], 247EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[],
253 OPENSSL_ITEM parameters[]); 248 OPENSSL_ITEM parameters[]);
254EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[], 249EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[],
255 OPENSSL_ITEM parameters[]); 250 OPENSSL_ITEM parameters[]);
256int STORE_store_private_key(STORE *e, EVP_PKEY *data, 251int STORE_store_private_key(STORE *e, EVP_PKEY *data,
257 OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); 252 OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
258int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[], 253int 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[]);
261int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[], 256int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[],
262 OPENSSL_ITEM parameters[]); 257 OPENSSL_ITEM parameters[]);
263int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[], 258int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[],
264 OPENSSL_ITEM parameters[]); 259 OPENSSL_ITEM parameters[]);
265void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[], 260void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[],
266 OPENSSL_ITEM parameters[]); 261 OPENSSL_ITEM parameters[]);
267EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle); 262EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle);
268int STORE_list_private_key_end(STORE *e, void *handle); 263int STORE_list_private_key_end(STORE *e, void *handle);
269int STORE_list_private_key_endp(STORE *e, void *handle); 264int STORE_list_private_key_endp(STORE *e, void *handle);
270EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[], 265EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[],
271 OPENSSL_ITEM parameters[]); 266 OPENSSL_ITEM parameters[]);
272int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[], 267int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[],
273 OPENSSL_ITEM parameters[]); 268 OPENSSL_ITEM parameters[]);
274int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[], 269int 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[]);
277int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[], 272int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[],
278 OPENSSL_ITEM parameters[]); 273 OPENSSL_ITEM parameters[]);
279int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[], 274int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[],
280 OPENSSL_ITEM parameters[]); 275 OPENSSL_ITEM parameters[]);
281void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[], 276void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[],
282 OPENSSL_ITEM parameters[]); 277 OPENSSL_ITEM parameters[]);
283EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle); 278EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle);
284int STORE_list_public_key_end(STORE *e, void *handle); 279int STORE_list_public_key_end(STORE *e, void *handle);
285int STORE_list_public_key_endp(STORE *e, void *handle); 280int STORE_list_public_key_endp(STORE *e, void *handle);
286X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[], 281X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[],
287 OPENSSL_ITEM parameters[]); 282 OPENSSL_ITEM parameters[]);
288X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[], 283X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[],
289 OPENSSL_ITEM parameters[]); 284 OPENSSL_ITEM parameters[]);
290int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[], 285int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[],
291 OPENSSL_ITEM parameters[]); 286 OPENSSL_ITEM parameters[]);
292int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[], 287int 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[]);
295int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[], 290int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[],
296 OPENSSL_ITEM parameters[]); 291 OPENSSL_ITEM parameters[]);
297void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[], 292void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[],
298 OPENSSL_ITEM parameters[]); 293 OPENSSL_ITEM parameters[]);
299X509_CRL *STORE_list_crl_next(STORE *e, void *handle); 294X509_CRL *STORE_list_crl_next(STORE *e, void *handle);
300int STORE_list_crl_end(STORE *e, void *handle); 295int STORE_list_crl_end(STORE *e, void *handle);
301int STORE_list_crl_endp(STORE *e, void *handle); 296int STORE_list_crl_endp(STORE *e, void *handle);
302int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[], 297int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[],
303 OPENSSL_ITEM parameters[]); 298 OPENSSL_ITEM parameters[]);
304int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[], 299int 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[]);
307BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[], 302BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[],
308 OPENSSL_ITEM parameters[]); 303 OPENSSL_ITEM parameters[]);
309int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[], 304int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[],
310 OPENSSL_ITEM parameters[]); 305 OPENSSL_ITEM parameters[]);
311int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[], 306int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[],
312 OPENSSL_ITEM parameters[]); 307 OPENSSL_ITEM parameters[]);
313int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[], 308int 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[]);
316BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[], 311BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[],
317 OPENSSL_ITEM parameters[]); 312 OPENSSL_ITEM parameters[]);
318int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[], 313int 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 */
323STORE_METHOD *STORE_create_method(char *name); 317STORE_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 */
327typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *); 321typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *);
328typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *); 322typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *);
329typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); 323typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *,
330typedef 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[],
331typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); 325 OPENSSL_ITEM parameters[]);
326typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *,
327 STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[],
328 OPENSSL_ITEM parameters[]);
329typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type,
330 OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
332typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle); 331typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle);
333typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle); 332typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle);
334typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); 333typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type,
335typedef 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[]);
336typedef 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[]); 335typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type,
337typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); 336 STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
338typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, void (*f)(void)); 337typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type,
339 338 OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[],
340int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f); 339 OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[],
341int STORE_method_set_cleanup_function(STORE_METHOD *sm, STORE_CLEANUP_FUNC_PTR clean_f); 340 OPENSSL_ITEM parameters[]);
342int STORE_method_set_generate_function(STORE_METHOD *sm, STORE_GENERATE_OBJECT_FUNC_PTR generate_f); 341typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[],
343int STORE_method_set_get_function(STORE_METHOD *sm, STORE_GET_OBJECT_FUNC_PTR get_f); 342 OPENSSL_ITEM parameters[]);
344int STORE_method_set_store_function(STORE_METHOD *sm, STORE_STORE_OBJECT_FUNC_PTR store_f); 343typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p,
345int STORE_method_set_modify_function(STORE_METHOD *sm, STORE_MODIFY_OBJECT_FUNC_PTR store_f); 344 void (*f)(void));
346int STORE_method_set_revoke_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR revoke_f); 345
347int STORE_method_set_delete_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR delete_f); 346int STORE_method_set_initialise_function(STORE_METHOD *sm,
348int STORE_method_set_list_start_function(STORE_METHOD *sm, STORE_START_OBJECT_FUNC_PTR list_start_f); 347 STORE_INITIALISE_FUNC_PTR init_f);
349int STORE_method_set_list_next_function(STORE_METHOD *sm, STORE_NEXT_OBJECT_FUNC_PTR list_next_f); 348int STORE_method_set_cleanup_function(STORE_METHOD *sm,
350int STORE_method_set_list_end_function(STORE_METHOD *sm, STORE_END_OBJECT_FUNC_PTR list_end_f); 349 STORE_CLEANUP_FUNC_PTR clean_f);
351int STORE_method_set_update_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); 350int STORE_method_set_generate_function(STORE_METHOD *sm,
352int STORE_method_set_lock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); 351 STORE_GENERATE_OBJECT_FUNC_PTR generate_f);
353int STORE_method_set_unlock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); 352int STORE_method_set_get_function(STORE_METHOD *sm,
354int STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f); 353 STORE_GET_OBJECT_FUNC_PTR get_f);
355 354int STORE_method_set_store_function(STORE_METHOD *sm,
356STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(STORE_METHOD *sm); 355 STORE_STORE_OBJECT_FUNC_PTR store_f);
356int STORE_method_set_modify_function(STORE_METHOD *sm,
357 STORE_MODIFY_OBJECT_FUNC_PTR store_f);
358int STORE_method_set_revoke_function(STORE_METHOD *sm,
359 STORE_HANDLE_OBJECT_FUNC_PTR revoke_f);
360int STORE_method_set_delete_function(STORE_METHOD *sm,
361 STORE_HANDLE_OBJECT_FUNC_PTR delete_f);
362int STORE_method_set_list_start_function(STORE_METHOD *sm,
363 STORE_START_OBJECT_FUNC_PTR list_start_f);
364int STORE_method_set_list_next_function(STORE_METHOD *sm,
365 STORE_NEXT_OBJECT_FUNC_PTR list_next_f);
366int STORE_method_set_list_end_function(STORE_METHOD *sm,
367 STORE_END_OBJECT_FUNC_PTR list_end_f);
368int STORE_method_set_update_store_function(STORE_METHOD *sm,
369 STORE_GENERIC_FUNC_PTR);
370int STORE_method_set_lock_store_function(STORE_METHOD *sm,
371 STORE_GENERIC_FUNC_PTR);
372int STORE_method_set_unlock_store_function(STORE_METHOD *sm,
373 STORE_GENERIC_FUNC_PTR);
374int STORE_method_set_ctrl_function(STORE_METHOD *sm,
375 STORE_CTRL_FUNC_PTR ctrl_f);
376
377STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(
378 STORE_METHOD *sm);
357STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm); 379STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm);
358STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(STORE_METHOD *sm); 380STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(
381 STORE_METHOD *sm);
359STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm); 382STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm);
360STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm); 383STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm);
361STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm); 384STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm);
362STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm); 385STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm);
363STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm); 386STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm);
364STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(STORE_METHOD *sm); 387STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(
365STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(STORE_METHOD *sm); 388 STORE_METHOD *sm);
389STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(
390 STORE_METHOD *sm);
366STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm); 391STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm);
367STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm); 392STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm);
368STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm); 393STORE_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 */
393char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); 418char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
394unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, 419unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs,
395 STORE_ATTR_TYPES code); 420 STORE_ATTR_TYPES code);
396X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); 421X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs,
397BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); 422 STORE_ATTR_TYPES code);
423BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs,
424 STORE_ATTR_TYPES code);
398int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 425int 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);
400int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 427int 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);
402int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 429int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
403 X509_NAME *dn); 430 X509_NAME *dn);
404int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 431int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
405 BIGNUM *number); 432 BIGNUM *number);
406int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 433int 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);
408int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 435int 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);
410int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 437int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
411 X509_NAME *dn); 438 X509_NAME *dn);
412int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, 439int 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. */
417int STORE_ATTR_INFO_compare(const STORE_ATTR_INFO * const *a, 444int 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. */
421int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); 448int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);