2 * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
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
10 #include <openssl/types.h>
11 #include <openssl/crypto.h>
13 typedef struct prov_ctx_st {
14 const OSSL_PROVIDER *provider;
15 OPENSSL_CTX *libctx; /* For all provider modules */
19 * To be used anywhere the library context needs to be passed, such as to
22 #define PROV_LIBRARY_CONTEXT_OF(provctx) \
23 PROV_CTX_get0_library_context((provctx))
25 PROV_CTX *PROV_CTX_new(void);
26 void PROV_CTX_free(PROV_CTX *ctx);
27 void PROV_CTX_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx);
28 void PROV_CTX_set0_provider(PROV_CTX *ctx, const OSSL_PROVIDER *libctx);
29 OPENSSL_CTX *PROV_CTX_get0_library_context(PROV_CTX *ctx);
30 const OSSL_PROVIDER *PROV_CTX_get0_provider(PROV_CTX *ctx);