]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/internal/provider.h
Prepare EVP_MAC infrastructure for moving all MACs to providers
[thirdparty/openssl.git] / include / internal / provider.h
CommitLineData
4c2883a9
RL
1/*
2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_INTERNAL_PROVIDER_H
11# define OSSL_INTERNAL_PROVIDER_H
12
13# include <openssl/core.h>
14# include "internal/dso.h"
15# include "internal/symhacks.h"
16
17# ifdef __cplusplus
18extern "C" {
19# endif
20
21/*
22 * namespaces:
23 *
24 * ossl_provider_ Provider Object internal API
25 * OSSL_PROVIDER Provider Object
26 */
27
28/* Provider Object finder, constructor and destructor */
29dc6e00
MC
29OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name,
30 int noconfig);
4c2883a9 31OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
29dc6e00
MC
32 OSSL_provider_init_fn *init_function,
33 int noconfig);
7c95390e 34int ossl_provider_up_ref(OSSL_PROVIDER *prov);
4c2883a9
RL
35void ossl_provider_free(OSSL_PROVIDER *prov);
36
37/* Setters */
e55008a9 38int ossl_provider_set_fallback(OSSL_PROVIDER *prov);
ac1055ef
RL
39int ossl_provider_set_module_path(OSSL_PROVIDER *prov, const char *module_path);
40int ossl_provider_add_parameter(OSSL_PROVIDER *prov, const char *name,
41 const char *value);
4c2883a9
RL
42
43/*
44 * Activate the Provider
45 * If the Provider is a module, the module will be loaded
46 * Inactivation is done by freeing the Provider
47 */
48int ossl_provider_activate(OSSL_PROVIDER *prov);
36f5ec55
RL
49/* Check if the provider is available */
50int ossl_provider_available(OSSL_PROVIDER *prov);
4c2883a9 51
a39eb840
RL
52/* Return pointer to the provider's context */
53void *ossl_provider_ctx(const OSSL_PROVIDER *prov);
54
85e2417c
RL
55/* Iterate over all loaded providers */
56int ossl_provider_forall_loaded(OPENSSL_CTX *,
57 int (*cb)(OSSL_PROVIDER *provider,
58 void *cbdata),
59 void *cbdata);
60
4c2883a9 61/* Getters for other library functions */
24626a47
RL
62const char *ossl_provider_name(const OSSL_PROVIDER *prov);
63const DSO *ossl_provider_dso(const OSSL_PROVIDER *prov);
64const char *ossl_provider_module_name(const OSSL_PROVIDER *prov);
65const char *ossl_provider_module_path(const OSSL_PROVIDER *prov);
e74bd290 66OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov);
4c2883a9
RL
67
68/* Thin wrappers around calls to the provider */
69void ossl_provider_teardown(const OSSL_PROVIDER *prov);
dca97d00 70const OSSL_PARAM *ossl_provider_gettable_params(const OSSL_PROVIDER *prov);
4e7991b4 71int ossl_provider_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
099bd339
RL
72const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov,
73 int operation_id,
74 int *no_cache);
4c2883a9 75
abbc2c40
RL
76/* Configuration */
77void ossl_provider_add_conf_module(void);
78
4c2883a9
RL
79# ifdef __cplusplus
80}
81# endif
82
83#endif