1 | /* |
2 | * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. |
3 | * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
4 | * |
5 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
6 | * this file except in compliance with the License. You can obtain a copy |
7 | * in the file LICENSE in the source distribution or at |
8 | * https://www.openssl.org/source/license.html |
9 | */ |
10 | |
11 | #ifndef OSSL_INTERNAL_PROPERTY_H |
12 | # define OSSL_INTERNAL_PROPERTY_H |
13 | |
14 | #include "internal/cryptlib.h" |
15 | |
16 | typedef struct ossl_method_store_st OSSL_METHOD_STORE; |
17 | typedef struct ossl_property_list_st OSSL_PROPERTY_LIST; |
18 | |
19 | /* Initialisation */ |
20 | int ossl_property_parse_init(OPENSSL_CTX *ctx); |
21 | |
22 | /* Property definition parser */ |
23 | OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn); |
24 | /* Property query parser */ |
25 | OSSL_PROPERTY_LIST *ossl_parse_query(OPENSSL_CTX *ctx, const char *s); |
26 | /* Property checker of query vs definition */ |
27 | int ossl_property_match_count(const OSSL_PROPERTY_LIST *query, |
28 | const OSSL_PROPERTY_LIST *defn); |
29 | |
30 | /* Implementation store functions */ |
31 | OSSL_METHOD_STORE *ossl_method_store_new(OPENSSL_CTX *ctx); |
32 | void ossl_method_store_free(OSSL_METHOD_STORE *store); |
33 | int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov, |
34 | int nid, const char *properties, void *method, |
35 | int (*method_up_ref)(void *), |
36 | void (*method_destruct)(void *)); |
37 | int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid, |
38 | const void *method); |
39 | int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid, |
40 | const char *prop_query, void **result); |
41 | int ossl_method_store_set_global_properties(OSSL_METHOD_STORE *store, |
42 | const char *prop_query); |
43 | |
44 | /* property query cache functions */ |
45 | int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid, |
46 | const char *prop_query, void **result); |
47 | int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid, |
48 | const char *prop_query, void *result, |
49 | int (*method_up_ref)(void *), |
50 | void (*method_destruct)(void *)); |
51 | #endif |
52 | |