Modify ossl_method_store_add() to accept an OSSL_PROVIDER and check for it
[openssl.git] / include / internal / property.h
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 HEADER_PROPERTY_H
12 # define HEADER_PROPERTY_H
13
14 #include "internal/cryptlib.h"
15
16 typedef struct ossl_method_store_st OSSL_METHOD_STORE;
17
18 /* Implementation store functions */
19 OSSL_METHOD_STORE *ossl_method_store_new(OPENSSL_CTX *ctx);
20 void ossl_method_store_free(OSSL_METHOD_STORE *store);
21 int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
22                           int nid, const char *properties, void *method,
23                           int (*method_up_ref)(void *),
24                           void (*method_destruct)(void *));
25 int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid,
26                              const void *method);
27 int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid,
28                             const char *prop_query, void **result);
29 int ossl_method_store_set_global_properties(OSSL_METHOD_STORE *store,
30                                             const char *prop_query);
31
32 /* property query cache functions */
33 int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
34                                 const char *prop_query, void **result);
35 int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid,
36                                 const char *prop_query, void *result);
37 #endif