]>
Commit | Line | Data |
---|---|---|
1bdbdaff | 1 | /* |
33388b44 | 2 | * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. |
1bdbdaff P |
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 | ||
ae4186b0 DMSP |
11 | #ifndef OSSL_INTERNAL_PROPERTY_H |
12 | # define OSSL_INTERNAL_PROPERTY_H | |
3a111aad | 13 | # pragma once |
1bdbdaff | 14 | |
3a111aad | 15 | # include "internal/cryptlib.h" |
1aedc35f | 16 | |
1bdbdaff | 17 | typedef struct ossl_method_store_st OSSL_METHOD_STORE; |
1793d270 | 18 | typedef struct ossl_property_list_st OSSL_PROPERTY_LIST; |
1bdbdaff | 19 | |
505f4660 | 20 | /* Initialisation */ |
b4250010 | 21 | int ossl_property_parse_init(OSSL_LIB_CTX *ctx); |
505f4660 | 22 | |
1793d270 | 23 | /* Property definition parser */ |
b4250010 | 24 | OSSL_PROPERTY_LIST *ossl_parse_property(OSSL_LIB_CTX *ctx, const char *defn); |
1793d270 | 25 | /* Property query parser */ |
b4250010 | 26 | OSSL_PROPERTY_LIST *ossl_parse_query(OSSL_LIB_CTX *ctx, const char *s); |
1793d270 RL |
27 | /* Property checker of query vs definition */ |
28 | int ossl_property_match_count(const OSSL_PROPERTY_LIST *query, | |
29 | const OSSL_PROPERTY_LIST *defn); | |
b4250010 | 30 | int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name, |
e0624f0d | 31 | const OSSL_PROPERTY_LIST *prop_list); |
b305452f RL |
32 | /* Free a parsed property list */ |
33 | void ossl_property_free(OSSL_PROPERTY_LIST *p); | |
34 | ||
1793d270 | 35 | |
1bdbdaff | 36 | /* Implementation store functions */ |
b4250010 | 37 | OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx); |
1bdbdaff | 38 | void ossl_method_store_free(OSSL_METHOD_STORE *store); |
c1d56231 RL |
39 | int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov, |
40 | int nid, const char *properties, void *method, | |
41 | int (*method_up_ref)(void *), | |
42 | void (*method_destruct)(void *)); | |
43 | int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid, | |
44 | const void *method); | |
1bdbdaff | 45 | int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid, |
f9e504e8 P |
46 | const char *prop_query, void **method); |
47 | ||
48 | /* Get the global properties associate with the specified library context */ | |
b4250010 DMSP |
49 | OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *ctx, |
50 | int loadconfig); | |
1bdbdaff | 51 | |
c2969ff6 | 52 | /* property query cache functions */ |
1bdbdaff P |
53 | int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid, |
54 | const char *prop_query, void **result); | |
55 | int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid, | |
bdbf2df2 P |
56 | const char *prop_query, void *result, |
57 | int (*method_up_ref)(void *), | |
58 | void (*method_destruct)(void *)); | |
04cb5ec0 SL |
59 | |
60 | void ossl_method_store_flush_cache(OSSL_METHOD_STORE *store, int all); | |
f9e504e8 P |
61 | |
62 | /* Merge two property queries together */ | |
63 | OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a, | |
64 | const OSSL_PROPERTY_LIST *b); | |
65 | ||
1bdbdaff | 66 | #endif |