*Rich Salz and Richard Levitte*
- * Added a library context that applications as well as other
- libraries can use to form a separate context within which libcrypto
- operations are performed.
+ * Added a library context `OSSL_LIB_CTX` that applications as well as
+ other libraries can use to form a separate context within which
+ libcrypto operations are performed.
There are two ways this can be used:
such an argument, such as `EVP_CIPHER_fetch` and similar algorithm
fetching functions.
- Indirectly, by creating a new library context and then assigning
- it as the new default, with `OPENSSL_CTX_set0_default`.
+ it as the new default, with `OSSL_LIB_CTX_set0_default`.
- All public OpenSSL functions that take an `OPENSSL_CTX` pointer,
- apart from the functions directly related to `OPENSSL_CTX`, accept
+ All public OpenSSL functions that take an `OSSL_LIB_CTX` pointer,
+ apart from the functions directly related to `OSSL_LIB_CTX`, accept
NULL to indicate that the default library context should be used.
Library code that changes the default library context using
- `OPENSSL_CTX_set0_default` should take care to restore it with a
+ `OSSL_LIB_CTX_set0_default` should take care to restore it with a
second call before returning to the caller.
+ _(Note: the library context was initially called `OPENSSL_CTX` and
+ renamed to `OSSL_LIB_CTX` in version 3.0.0 alpha7.)_
+
*Richard Levitte*
* Handshake now fails if Extended Master Secret extension is dropped
* Remove the `RAND_DRBG` API.
* Deprecated the `ENGINE` API.
- * Added `OPENSSL_CTX`, a libcrypto library context.
+ * Added `OSSL_LIB_CTX`, a libcrypto library context.
* Interactive mode is removed from the 'openssl' program.
* The X25519, X448, Ed25519, Ed448 and SHAKE256 algorithms are included in
the FIPS provider. None have the "fips=yes" property set and, as such,
return 1;
}
-OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OPENSSL_CTX *libctx, const char *propq)
+OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_CMP_SRV_CTX *srv_ctx = OSSL_CMP_SRV_CTX_new(libctx, propq);
mock_srv_ctx *ctx = mock_srv_ctx_new();
# include <openssl/cmp.h>
-OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OPENSSL_CTX *libctx, const char *propq);
+OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx,
+ const char *propq);
void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx);
int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert);
static void receipt_request_print(CMS_ContentInfo *cms);
static CMS_ReceiptRequest *make_receipt_request(
STACK_OF(OPENSSL_STRING) *rr_to, int rr_allorfirst,
- STACK_OF(OPENSSL_STRING) *rr_from, OPENSSL_CTX *libctx, const char *propq);
+ STACK_OF(OPENSSL_STRING) *rr_from, OSSL_LIB_CTX *libctx, const char *propq);
static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
STACK_OF(OPENSSL_STRING) *param);
static CMS_ContentInfo *load_content_info(int informat, BIO *in, BIO **indata,
const char *name,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx,
+ const char *propq)
{
CMS_ContentInfo *ret, *ci;
long ltmp;
const char *mime_eol = "\n";
OPTION_CHOICE o;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
static CMS_ReceiptRequest *make_receipt_request(
STACK_OF(OPENSSL_STRING) *rr_to, int rr_allorfirst,
STACK_OF(OPENSSL_STRING) *rr_from,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
STACK_OF(GENERAL_NAMES) *rct_to = NULL, *rct_from = NULL;
CMS_ReceiptRequest *rr;
static int verify_module_load(const char *parent_config_file)
{
- return OPENSSL_CTX_load_config(NULL, parent_config_file);
+ return OSSL_LIB_CTX_load_config(NULL, parent_config_file);
}
/*
#endif
static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
static int genpkey_cb(EVP_PKEY_CTX *ctx);
typedef enum OPTION_choice {
OPTION_CHOICE o;
int outformat = FORMAT_PEM, text = 0, ret = 1, rv, do_param = 0;
int private = 0;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
prog = opt_init(argc, argv, genpkey_options);
}
static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
BIO *pbio;
EVP_PKEY *pkey = NULL;
int init_gen_str(EVP_PKEY_CTX **pctx,
const char *algname, ENGINE *e, int do_param,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_PKEY_CTX *ctx = NULL;
const EVP_PKEY_ASN1_METHOD *ameth;
int x509_req_ctrl_string(X509_REQ *x, const char *value);
int init_gen_str(EVP_PKEY_CTX **pctx,
const char *algname, ENGINE *e, int do_param,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int do_X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
STACK_OF(OPENSSL_STRING) *sigopts);
int do_X509_verify(X509 *x, EVP_PKEY *pkey, STACK_OF(OPENSSL_STRING) *vfyopts);
extern VERIFY_CB_ARGS verify_args;
-OPENSSL_CTX *app_create_libctx(void);
-OPENSSL_CTX *app_get0_libctx(void);
+OSSL_LIB_CTX *app_create_libctx(void);
+OSSL_LIB_CTX *app_get0_libctx(void);
OSSL_PARAM *app_params_new_from_opts(STACK_OF(OPENSSL_STRING) *opts,
const OSSL_PARAM *paramdefs);
void app_params_free(OSSL_PARAM *params);
-int app_provider_load(OPENSSL_CTX *libctx, const char *provider_name);
+int app_provider_load(OSSL_LIB_CTX *libctx, const char *provider_name);
void app_providers_cleanup(void);
-OPENSSL_CTX *app_get0_libctx(void);
+OSSL_LIB_CTX *app_get0_libctx(void);
const char *app_get0_propq(void);
#endif
OSSL_PROVIDER_unload(prov);
}
-int app_provider_load(OPENSSL_CTX *libctx, const char *provider_name)
+int app_provider_load(OSSL_LIB_CTX *libctx, const char *provider_name)
{
OSSL_PROVIDER *prov;
unsigned long mask;
} NAME_EX_TBL;
-static OPENSSL_CTX *app_libctx = NULL;
+static OSSL_LIB_CTX *app_libctx = NULL;
static int set_table_opts(unsigned long *flags, const char *arg,
const NAME_EX_TBL * in_tbl);
return OPENSSL_strdup(tpass);
}
-OPENSSL_CTX *app_get0_libctx(void)
+OSSL_LIB_CTX *app_get0_libctx(void)
{
return app_libctx;
}
return NULL;
}
-OPENSSL_CTX *app_create_libctx(void)
+OSSL_LIB_CTX *app_create_libctx(void)
{
/*
* Load the NULL provider into the default library context and create a
BIO_puts(bio_err, "Failed to create null provider\n");
return NULL;
}
- app_libctx = OPENSSL_CTX_new();
+ app_libctx = OSSL_LIB_CTX_new();
}
if (app_libctx == NULL)
BIO_puts(bio_err, "Failed to create library context\n");
{
PW_CB_DATA uidata;
OSSL_STORE_CTX *ctx = NULL;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
int ncerts = 0;
int ncrls = 0;
{
X509_STORE *store = X509_STORE_new();
X509_LOOKUP *lookup;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
if (store == NULL)
static void apps_shutdown(void)
{
app_providers_cleanup();
- OPENSSL_CTX_free(app_get0_libctx());
+ OSSL_LIB_CTX_free(app_get0_libctx());
destroy_ui_method();
}
char *infile = NULL, *outfile = NULL, *prog;
int i, print_certs = 0, text = 0, noout = 0, p7_print = 0, ret = 1;
OPTION_CHOICE o;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
prog = opt_init(argc, argv, pkcs7_options);
const char *keyfile, int keyform, int key_type,
char *passinarg, int pkey_op, ENGINE *e,
const int impl, int rawin, EVP_PKEY **ppkey,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file,
ENGINE *e);
int rawin = 0;
const EVP_MD *md = NULL;
int filesize = -1;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = NULL;
prog = opt_init(argc, argv, pkeyutl_options);
char *passinarg, int pkey_op, ENGINE *e,
const int engine_impl, int rawin,
EVP_PKEY **ppkey,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_PKEY *pkey = NULL;
EVP_PKEY_CTX *ctx = NULL;
int vpmtouched = 0, rv = 0;
ENGINE *e = NULL;
const char *mime_eol = "\n";
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,
int expected, int criterion, OSSL_STORE_SEARCH *search,
int text, int noout, int recursive, int indent, BIO *out,
- const char *prog, OPENSSL_CTX *libctx, const char *propq);
+ const char *prog, OSSL_LIB_CTX *libctx, const char *propq);
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_ENGINE, OPT_OUT, OPT_PASSIN,
char *alias = NULL;
OSSL_STORE_SEARCH *search = NULL;
const EVP_MD *digest = NULL;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
while ((o = opt_next()) != OPT_EOF) {
static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,
int expected, int criterion, OSSL_STORE_SEARCH *search,
int text, int noout, int recursive, int indent, BIO *out,
- const char *prog, OPENSSL_CTX *libctx, const char *propq)
+ const char *prog, OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_STORE_CTX *store_ctx = NULL;
int ret = 1, items = 0;
{
X509_STORE *cert_ctx = NULL;
X509_LOOKUP *lookup = NULL;
- OPENSSL_CTX *libctx = app_get0_libctx();
+ OSSL_LIB_CTX *libctx = app_get0_libctx();
const char *propq = app_get0_propq();
cert_ctx = X509_STORE_new();
int asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *md, void *asn,
unsigned char *data, unsigned int *len,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int i, ret = 0;
unsigned char *str = NULL;
int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1,
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
const void *data, const ASN1_OCTET_STRING *id,
- EVP_PKEY *pkey, const EVP_MD *md, OPENSSL_CTX *libctx,
+ EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx,
const char *propq)
{
int rv = 0;
int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
const ASN1_BIT_STRING *signature, const void *data,
const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_MD_CTX *ctx;
int rv = -1;
int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
int ctype_nid, int econt_nid,
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
char bound[33], c;
int i;
#include "crypto/evp.h"
EVP_PKEY *d2i_PrivateKey_ex(int type, EVP_PKEY **a, const unsigned char **pp,
- long length, OPENSSL_CTX *libctx, const char *propq)
+ long length, OSSL_LIB_CTX *libctx,
+ const char *propq)
{
EVP_PKEY *ret;
const unsigned char *p = *pp;
*/
EVP_PKEY *d2i_AutoPrivateKey_ex(EVP_PKEY **a, const unsigned char **pp,
- long length, OPENSSL_CTX *libctx,
+ long length, OSSL_LIB_CTX *libctx,
const char *propq)
{
STACK_OF(ASN1_TYPE) *inkey;
int (*func)(void *), void *args, size_t size)
{
async_ctx *ctx;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))
return ASYNC_ERR;
* Restore the default libctx to what it was the last time the
* fibre ran
*/
- libctx = OPENSSL_CTX_set0_default(ctx->currjob->libctx);
+ libctx = OSSL_LIB_CTX_set0_default(ctx->currjob->libctx);
/* Resume previous job */
if (!async_fibre_swapcontext(&ctx->dispatcher,
&ctx->currjob->fibrectx, 1)) {
* again to what it was originally, and remember what it had
* been changed to.
*/
- ctx->currjob->libctx = OPENSSL_CTX_set0_default(libctx);
+ ctx->currjob->libctx = OSSL_LIB_CTX_set0_default(libctx);
continue;
}
ctx->currjob->func = func;
ctx->currjob->waitctx = wctx;
- libctx = openssl_ctx_get_concrete(NULL);
+ libctx = ossl_lib_ctx_get_concrete(NULL);
if (!async_fibre_swapcontext(&ctx->dispatcher,
&ctx->currjob->fibrectx, 1)) {
ASYNCerr(ASYNC_F_ASYNC_START_JOB, ASYNC_R_FAILED_TO_SWAP_CONTEXT);
* In case the fibre changed the default libctx we set it back again
* to what it was, and remember what it had been changed to.
*/
- ctx->currjob->libctx = OPENSSL_CTX_set0_default(libctx);
+ ctx->currjob->libctx = OSSL_LIB_CTX_set0_default(libctx);
}
err:
int ret;
int status;
ASYNC_WAIT_CTX *waitctx;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
};
struct fd_lookup_st {
/* Flags. */
int flags;
/* The library context */
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
};
#ifndef FIPS_MODULE
# define CTXDBG(str, ctx) do {} while(0)
#endif /* FIPS_MODULE */
-BN_CTX *BN_CTX_new_ex(OPENSSL_CTX *ctx)
+BN_CTX *BN_CTX_new_ex(OSSL_LIB_CTX *ctx)
{
BN_CTX *ret;
}
#endif
-BN_CTX *BN_CTX_secure_new_ex(OPENSSL_CTX *ctx)
+BN_CTX *BN_CTX_secure_new_ex(OSSL_LIB_CTX *ctx)
{
BN_CTX *ret = BN_CTX_new_ex(ctx);
return ret;
}
-OPENSSL_CTX *bn_get_lib_ctx(BN_CTX *ctx)
+OSSL_LIB_CTX *bn_get_lib_ctx(BN_CTX *ctx)
{
if (ctx == NULL)
return NULL;
{
unsigned char *buf = NULL;
int b, ret = 0, bit, bytes, mask;
- OPENSSL_CTX *libctx = bn_get_lib_ctx(ctx);
+ OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx);
if (bits == 0) {
if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
unsigned char *k_bytes = NULL;
int ret = 0;
EVP_MD *md = NULL;
- OPENSSL_CTX *libctx = bn_get_lib_ctx(ctx);
+ OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx);
if (mdctx == NULL)
goto err;
* Allocates and initializes OSSL_CMP_CTX context structure with default values.
* Returns new context on success, NULL on error
*/
-OSSL_CMP_CTX *OSSL_CMP_CTX_new(OPENSSL_CTX *libctx, const char *propq)
+OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_CMP_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
* this structure is used to store the context for CMP sessions
*/
struct ossl_cmp_ctx_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propq;
OSSL_CMP_log_cb_t log_cb; /* log callback for error/debug/etc. output */
OSSL_CMP_severity log_verbosity; /* level of verbosity of log output */
int ossl_cmp_asn1_octet_string_set1_bytes(ASN1_OCTET_STRING **tgt,
const unsigned char *bytes, int len);
STACK_OF(X509)
- *ossl_cmp_build_cert_chain(OPENSSL_CTX *libctx, const char *propq,
+ *ossl_cmp_build_cert_chain(OSSL_LIB_CTX *libctx, const char *propq,
X509_STORE *store,
STACK_OF(X509) *certs, X509 *cert);
OPENSSL_free(srv_ctx);
}
-OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OPENSSL_CTX *libctx, const char *propq)
+OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_CMP_SRV_CTX *ctx = OPENSSL_zalloc(sizeof(OSSL_CMP_SRV_CTX));
*/
/* TODO this should be of more general interest and thus be exported. */
STACK_OF(X509)
- *ossl_cmp_build_cert_chain(OPENSSL_CTX *libctx, const char *propq,
+ *ossl_cmp_build_cert_chain(OSSL_LIB_CTX *libctx, const char *propq,
X509_STORE *store,
STACK_OF(X509) *certs, X509 *cert)
{
/* CMS CompressedData Utilities */
-CMS_ContentInfo *cms_CompressedData_create(int comp_nid, OPENSSL_CTX *libctx,
+CMS_ContentInfo *cms_CompressedData_create(int comp_nid, OSSL_LIB_CTX *libctx,
const char *propq)
{
CMS_ContentInfo *cms;
/* CMS DigestedData Utilities */
CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx,
+ const char *propq)
{
CMS_ContentInfo *cms;
CMS_DigestedData *dd;
#ifndef OPENSSL_NO_EC
static EVP_PKEY *pkey_type2param(int ptype, const void *pval,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_PKEY *pkey = NULL;
EVP_PKEY_CTX *pctx = NULL;
}
CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
CMS_ContentInfo *cms;
}
CMS_ContentInfo *
-CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OPENSSL_CTX *libctx,
+CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
const char *propq)
{
CMS_ContentInfo *cms;
CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
unsigned char *id, int idlen, int allorfirst,
STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
CMS_ReceiptRequest *rr;
return ASN1_item_i2d((const ASN1_VALUE *)a, out, (CMS_ContentInfo_it()));
}
-CMS_ContentInfo *CMS_ContentInfo_new_ex(OPENSSL_CTX *libctx, const char *propq)
+CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
{
CMS_ContentInfo *ci;
return cms != NULL ? &cms->ctx : NULL;
}
-OPENSSL_CTX *cms_ctx_get0_libctx(const CMS_CTX *ctx)
+OSSL_LIB_CTX *cms_ctx_get0_libctx(const CMS_CTX *ctx)
{
return ctx->libctx;
}
return cms->contentType;
}
-CMS_ContentInfo *cms_Data_create(OPENSSL_CTX *libctx, const char *propq)
+CMS_ContentInfo *cms_Data_create(OSSL_LIB_CTX *libctx, const char *propq)
{
CMS_ContentInfo *cms = CMS_ContentInfo_new_ex(libctx, propq);
typedef struct CMS_CTX_st CMS_CTX;
struct CMS_CTX_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
};
BIO *cms_content_bio(CMS_ContentInfo *cms);
const CMS_CTX *cms_get0_cmsctx(const CMS_ContentInfo *cms);
-OPENSSL_CTX *cms_ctx_get0_libctx(const CMS_CTX *ctx);
+OSSL_LIB_CTX *cms_ctx_get0_libctx(const CMS_CTX *ctx);
const char *cms_ctx_get0_propq(const CMS_CTX *ctx);
void cms_resolve_libctx(CMS_ContentInfo *ci);
-CMS_ContentInfo *cms_Data_create(OPENSSL_CTX *ctx, const char *propq);
+CMS_ContentInfo *cms_Data_create(OSSL_LIB_CTX *ctx, const char *propq);
CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx,
+ const char *propq);
BIO *cms_DigestedData_init_bio(const CMS_ContentInfo *cms);
-int cms_DigestedData_do_final(const CMS_ContentInfo *cms, BIO *chain, int verify);
+int cms_DigestedData_do_final(const CMS_ContentInfo *cms,
+ BIO *chain, int verify);
BIO *cms_SignedData_init_bio(CMS_ContentInfo *cms);
int cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain);
ASN1_INTEGER **sno);
int cms_SignerIdentifier_cert_cmp(CMS_SignerIdentifier *sid, X509 *cert);
-CMS_ContentInfo *cms_CompressedData_create(int comp_nid, OPENSSL_CTX *libctx,
+CMS_ContentInfo *cms_CompressedData_create(int comp_nid, OSSL_LIB_CTX *libctx,
const char *propq);
BIO *cms_CompressedData_init_bio(const CMS_ContentInfo *cms);
}
CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
CMS_ContentInfo *cms = cms_Data_create(libctx, propq);
}
CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
- unsigned int flags, OPENSSL_CTX *ctx,
+ unsigned int flags, OSSL_LIB_CTX *ctx,
const char *propq)
{
CMS_ContentInfo *cms;
CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
const unsigned char *key,
size_t keylen, unsigned int flags,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
CMS_ContentInfo *cms;
CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
STACK_OF(X509) *certs, BIO *data,
- unsigned int flags, OPENSSL_CTX *libctx,
+ unsigned int flags, OSSL_LIB_CTX *libctx,
const char *propq)
{
CMS_ContentInfo *cms;
CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *data,
const EVP_CIPHER *cipher, unsigned int flags,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
CMS_ContentInfo *cms;
int i;
* the "CONF classic" functions, for consistency.
*/
-CONF *NCONF_new_ex(OPENSSL_CTX *libctx, CONF_METHOD *meth)
+CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth)
{
CONF *ret;
}
-int CONF_modules_load_file_ex(OPENSSL_CTX *libctx, const char *filename,
+int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
const char *appname, unsigned long flags)
{
char *file = NULL;
#include "internal/thread_once.h"
#include "internal/property.h"
-struct openssl_ctx_onfree_list_st {
- openssl_ctx_onfree_fn *fn;
- struct openssl_ctx_onfree_list_st *next;
+struct ossl_lib_ctx_onfree_list_st {
+ ossl_lib_ctx_onfree_fn *fn;
+ struct ossl_lib_ctx_onfree_list_st *next;
};
-struct openssl_ctx_st {
+struct ossl_lib_ctx_st {
CRYPTO_RWLOCK *lock;
CRYPTO_EX_DATA data;
/*
- * For most data in the OPENSSL_CTX we just use ex_data to store it. But
+ * For most data in the OSSL_LIB_CTX we just use ex_data to store it. But
* that doesn't work for ex_data itself - so we store that directly.
*/
OSSL_EX_DATA_GLOBAL global;
/* Map internal static indexes to dynamically created indexes */
- int dyn_indexes[OPENSSL_CTX_MAX_INDEXES];
+ int dyn_indexes[OSSL_LIB_CTX_MAX_INDEXES];
/* Keep a separate lock for each index */
- CRYPTO_RWLOCK *index_locks[OPENSSL_CTX_MAX_INDEXES];
+ CRYPTO_RWLOCK *index_locks[OSSL_LIB_CTX_MAX_INDEXES];
CRYPTO_RWLOCK *oncelock;
- int run_once_done[OPENSSL_CTX_MAX_RUN_ONCE];
- int run_once_ret[OPENSSL_CTX_MAX_RUN_ONCE];
- struct openssl_ctx_onfree_list_st *onfreelist;
+ int run_once_done[OSSL_LIB_CTX_MAX_RUN_ONCE];
+ int run_once_ret[OSSL_LIB_CTX_MAX_RUN_ONCE];
+ struct ossl_lib_ctx_onfree_list_st *onfreelist;
};
-static int context_init(OPENSSL_CTX *ctx)
+static int context_init(OSSL_LIB_CTX *ctx)
{
size_t i;
int exdata_done = 0;
if (ctx->oncelock == NULL)
goto err;
- for (i = 0; i < OPENSSL_CTX_MAX_INDEXES; i++) {
+ for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++) {
ctx->index_locks[i] = CRYPTO_THREAD_lock_new();
ctx->dyn_indexes[i] = -1;
if (ctx->index_locks[i] == NULL)
goto err;
}
- /* OPENSSL_CTX is built on top of ex_data so we initialise that directly */
+ /* OSSL_LIB_CTX is built on top of ex_data so we initialise that directly */
if (!do_ex_data_init(ctx))
goto err;
exdata_done = 1;
- if (!crypto_new_ex_data_ex(ctx, CRYPTO_EX_INDEX_OPENSSL_CTX, NULL,
+ if (!crypto_new_ex_data_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL,
&ctx->data)) {
crypto_cleanup_all_ex_data_int(ctx);
goto err;
return 0;
}
-static int context_deinit(OPENSSL_CTX *ctx)
+static int context_deinit(OSSL_LIB_CTX *ctx)
{
- struct openssl_ctx_onfree_list_st *tmp, *onfree;
+ struct ossl_lib_ctx_onfree_list_st *tmp, *onfree;
int i;
if (ctx == NULL)
onfree = onfree->next;
OPENSSL_free(tmp);
}
- CRYPTO_free_ex_data(CRYPTO_EX_INDEX_OPENSSL_CTX, NULL, &ctx->data);
+ CRYPTO_free_ex_data(CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL, &ctx->data);
crypto_cleanup_all_ex_data_int(ctx);
- for (i = 0; i < OPENSSL_CTX_MAX_INDEXES; i++)
+ for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++)
CRYPTO_THREAD_lock_free(ctx->index_locks[i]);
CRYPTO_THREAD_lock_free(ctx->oncelock);
#ifndef FIPS_MODULE
/* The default default context */
-static OPENSSL_CTX default_context_int;
+static OSSL_LIB_CTX default_context_int;
static CRYPTO_ONCE default_context_init = CRYPTO_ONCE_STATIC_INIT;
static CRYPTO_THREAD_LOCAL default_context_thread_local;
&& context_init(&default_context_int);
}
-void openssl_ctx_default_deinit(void)
+void ossl_lib_ctx_default_deinit(void)
{
context_deinit(&default_context_int);
}
-static OPENSSL_CTX *get_thread_default_context(void)
+static OSSL_LIB_CTX *get_thread_default_context(void)
{
if (!RUN_ONCE(&default_context_init, default_context_do_init))
return NULL;
return CRYPTO_THREAD_get_local(&default_context_thread_local);
}
-static OPENSSL_CTX *get_default_context(void)
+static OSSL_LIB_CTX *get_default_context(void)
{
- OPENSSL_CTX *current_defctx = get_thread_default_context();
+ OSSL_LIB_CTX *current_defctx = get_thread_default_context();
if (current_defctx == NULL)
current_defctx = &default_context_int;
return current_defctx;
}
-static int set_default_context(OPENSSL_CTX *defctx)
+static int set_default_context(OSSL_LIB_CTX *defctx)
{
if (defctx == &default_context_int)
defctx = NULL;
}
#endif
-OPENSSL_CTX *OPENSSL_CTX_new(void)
+OSSL_LIB_CTX *OSSL_LIB_CTX_new(void)
{
- OPENSSL_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
+ OSSL_LIB_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
if (ctx != NULL && !context_init(ctx)) {
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
ctx = NULL;
}
return ctx;
}
#ifndef FIPS_MODULE
-int OPENSSL_CTX_load_config(OPENSSL_CTX *ctx, const char *config_file)
+int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file)
{
return CONF_modules_load_file_ex(ctx, config_file, NULL, 0) > 0;
}
#endif
-void OPENSSL_CTX_free(OPENSSL_CTX *ctx)
+void OSSL_LIB_CTX_free(OSSL_LIB_CTX *ctx)
{
- if (openssl_ctx_is_default(ctx))
+ if (ossl_lib_ctx_is_default(ctx))
return;
context_deinit(ctx);
OPENSSL_free(ctx);
}
-OPENSSL_CTX *OPENSSL_CTX_set0_default(OPENSSL_CTX *libctx)
+OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx)
{
#ifndef FIPS_MODULE
- OPENSSL_CTX *current_defctx;
+ OSSL_LIB_CTX *current_defctx;
if ((current_defctx = get_default_context()) != NULL
&& set_default_context(libctx))
return NULL;
}
-OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx)
+OSSL_LIB_CTX *ossl_lib_ctx_get_concrete(OSSL_LIB_CTX *ctx)
{
#ifndef FIPS_MODULE
if (ctx == NULL)
return ctx;
}
-int openssl_ctx_is_default(OPENSSL_CTX *ctx)
+int ossl_lib_ctx_is_default(OSSL_LIB_CTX *ctx)
{
#ifndef FIPS_MODULE
if (ctx == NULL || ctx == get_default_context())
return 0;
}
-int openssl_ctx_is_global_default(OPENSSL_CTX *ctx)
+int ossl_lib_ctx_is_global_default(OSSL_LIB_CTX *ctx)
{
#ifndef FIPS_MODULE
- if (openssl_ctx_get_concrete(ctx) == &default_context_int)
+ if (ossl_lib_ctx_get_concrete(ctx) == &default_context_int)
return 1;
#endif
return 0;
}
-static void openssl_ctx_generic_new(void *parent_ign, void *ptr_ign,
- CRYPTO_EX_DATA *ad, int index,
- long argl_ign, void *argp)
+static void ossl_lib_ctx_generic_new(void *parent_ign, void *ptr_ign,
+ CRYPTO_EX_DATA *ad, int index,
+ long argl_ign, void *argp)
{
- const OPENSSL_CTX_METHOD *meth = argp;
- void *ptr = meth->new_func(crypto_ex_data_get_openssl_ctx(ad));
+ const OSSL_LIB_CTX_METHOD *meth = argp;
+ void *ptr = meth->new_func(crypto_ex_data_get_ossl_lib_ctx(ad));
if (ptr != NULL)
CRYPTO_set_ex_data(ad, index, ptr);
}
-static void openssl_ctx_generic_free(void *parent_ign, void *ptr,
- CRYPTO_EX_DATA *ad, int index,
- long argl_ign, void *argp)
+static void ossl_lib_ctx_generic_free(void *parent_ign, void *ptr,
+ CRYPTO_EX_DATA *ad, int index,
+ long argl_ign, void *argp)
{
- const OPENSSL_CTX_METHOD *meth = argp;
+ const OSSL_LIB_CTX_METHOD *meth = argp;
meth->free_func(ptr);
}
/* Non-static so we can use it in context_internal_test */
-static int openssl_ctx_init_index(OPENSSL_CTX *ctx, int static_index,
- const OPENSSL_CTX_METHOD *meth)
+static int ossl_lib_ctx_init_index(OSSL_LIB_CTX *ctx, int static_index,
+ const OSSL_LIB_CTX_METHOD *meth)
{
int idx;
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
if (ctx == NULL)
return 0;
- idx = crypto_get_ex_new_index_ex(ctx, CRYPTO_EX_INDEX_OPENSSL_CTX, 0,
+ idx = crypto_get_ex_new_index_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, 0,
(void *)meth,
- openssl_ctx_generic_new,
- NULL, openssl_ctx_generic_free);
+ ossl_lib_ctx_generic_new,
+ NULL, ossl_lib_ctx_generic_free);
if (idx < 0)
return 0;
return 1;
}
-void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index,
- const OPENSSL_CTX_METHOD *meth)
+void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *ctx, int index,
+ const OSSL_LIB_CTX_METHOD *meth)
{
void *data = NULL;
int dynidx;
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
if (ctx == NULL)
return NULL;
return data;
}
- if (!openssl_ctx_init_index(ctx, index, meth)) {
+ if (!ossl_lib_ctx_init_index(ctx, index, meth)) {
CRYPTO_THREAD_unlock(ctx->lock);
CRYPTO_THREAD_unlock(ctx->index_locks[index]);
return NULL;
CRYPTO_THREAD_unlock(ctx->lock);
/* The alloc call ensures there's a value there */
- if (CRYPTO_alloc_ex_data(CRYPTO_EX_INDEX_OPENSSL_CTX, NULL,
+ if (CRYPTO_alloc_ex_data(CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL,
&ctx->data, ctx->dyn_indexes[index]))
data = CRYPTO_get_ex_data(&ctx->data, ctx->dyn_indexes[index]);
return data;
}
-OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx)
+OSSL_EX_DATA_GLOBAL *ossl_lib_ctx_get_ex_data_global(OSSL_LIB_CTX *ctx)
{
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
if (ctx == NULL)
return NULL;
return &ctx->global;
}
-int openssl_ctx_run_once(OPENSSL_CTX *ctx, unsigned int idx,
- openssl_ctx_run_once_fn run_once_fn)
+int ossl_lib_ctx_run_once(OSSL_LIB_CTX *ctx, unsigned int idx,
+ ossl_lib_ctx_run_once_fn run_once_fn)
{
int done = 0, ret = 0;
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
if (ctx == NULL)
return 0;
return ret;
}
-int openssl_ctx_onfree(OPENSSL_CTX *ctx, openssl_ctx_onfree_fn onfreefn)
+int ossl_lib_ctx_onfree(OSSL_LIB_CTX *ctx, ossl_lib_ctx_onfree_fn onfreefn)
{
- struct openssl_ctx_onfree_list_st *newonfree
+ struct ossl_lib_ctx_onfree_list_st *newonfree
= OPENSSL_malloc(sizeof(*newonfree));
if (newonfree == NULL)
#include "internal/provider.h"
struct algorithm_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
int operation_id; /* May be zero for finding them all */
int (*pre)(OSSL_PROVIDER *, int operation_id, void *data, int *result);
void (*fn)(OSSL_PROVIDER *, const OSSL_ALGORITHM *, int no_store,
return ok;
}
-void ossl_algorithm_do_all(OPENSSL_CTX *libctx, int operation_id,
+void ossl_algorithm_do_all(OSSL_LIB_CTX *libctx, int operation_id,
OSSL_PROVIDER *provider,
int (*pre)(OSSL_PROVIDER *, int operation_id,
void *data, int *result),
#include "internal/provider.h"
struct construct_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
OSSL_METHOD_STORE *store;
int operation_id;
int force_store;
data->mcm->destruct(method, data->mcm_data);
}
-void *ossl_method_construct(OPENSSL_CTX *libctx, int operation_id,
+void *ossl_method_construct(OSSL_LIB_CTX *libctx, int operation_id,
int force_store,
OSSL_METHOD_CONSTRUCT_METHOD *mcm, void *mcm_data)
{
OPENSSL_free(n);
}
-/* OPENSSL_CTX_METHOD functions for a namemap stored in a library context */
+/* OSSL_LIB_CTX_METHOD functions for a namemap stored in a library context */
-static void *stored_namemap_new(OPENSSL_CTX *libctx)
+static void *stored_namemap_new(OSSL_LIB_CTX *libctx)
{
OSSL_NAMEMAP *namemap = ossl_namemap_new();
}
}
-static const OPENSSL_CTX_METHOD stored_namemap_method = {
+static const OSSL_LIB_CTX_METHOD stored_namemap_method = {
stored_namemap_new,
stored_namemap_free,
};
* ==========================
*/
-OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx)
+OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx)
{
OSSL_NAMEMAP *namemap =
- openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX,
- &stored_namemap_method);
+ ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX,
+ &stored_namemap_method);
#ifndef FIPS_MODULE
if (namemap != NULL && ossl_namemap_empty(namemap)) {
static int create_popo_signature(OSSL_CRMF_POPOSIGNINGKEY *ps,
const OSSL_CRMF_CERTREQUEST *cr,
EVP_PKEY *pkey, const EVP_MD *digest,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
if (ps == NULL || cr == NULL || pkey == NULL) {
CRMFerr(0, CRMF_R_NULL_ARGUMENT);
int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
EVP_PKEY *pkey, const EVP_MD *digest,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_CRMF_POPO *pp = NULL;
ASN1_INTEGER *tag = NULL;
/* verifies the Proof-of-Possession of the request with the given rid in reqs */
int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
int rid, int acceptRAVerified,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_CRMF_MSG *req = NULL;
X509_PUBKEY *pubkey = NULL;
*/
X509
*OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
EVP_PKEY *pkey)
{
X509 *cert = NULL; /* decrypted certificate */
* |macnid| e.g., NID_hmac_sha1
* returns pointer to OSSL_CRMF_PBMPARAMETER on success, NULL on error
*/
-OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OPENSSL_CTX *libctx, size_t slen,
+OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t slen,
int owfnid, size_t itercnt,
int macnid)
{
* returns 1 on success, 0 on error
*/
/* TODO try to combine with other MAC calculations in the libray */
-int OSSL_CRMF_pbm_new(OPENSSL_CTX *libctx, const char *propq,
+int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
const OSSL_CRMF_PBMPARAMETER *pbmp,
const unsigned char *msg, size_t msglen,
const unsigned char *sec, size_t seclen,
* -1 on internal (malloc) failure
*/
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
- const char *name, OPENSSL_CTX *libctx,
+ const char *name, OSSL_LIB_CTX *libctx,
const char *propq)
{
unsigned char *pkey_der = NULL;
/* milliseconds since epoch (to check that the SCT isn't from the future) */
uint64_t epoch_time_in_ms;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
};
/* milliseconds since epoch (to check that SCTs aren't from the future) */
uint64_t epoch_time_in_ms;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
};
/*
* Creates a new context for verifying an SCT.
*/
-SCT_CTX *SCT_CTX_new(OPENSSL_CTX *ctx, const char *propq);
+SCT_CTX *SCT_CTX_new(OSSL_LIB_CTX *ctx, const char *propq);
/*
* Deletes an SCT verification context.
*/
* Information about a CT log server.
*/
struct ctlog_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
char *name;
uint8_t log_id[CT_V1_HASHLEN];
* It takes ownership of any CTLOG instances added to it.
*/
struct ctlog_store_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
STACK_OF(CTLOG) *logs;
};
return ret;
}
-CTLOG_STORE *CTLOG_STORE_new_ex(OPENSSL_CTX *libctx, const char *propq)
+CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
{
CTLOG_STORE *ret = OPENSSL_zalloc(sizeof(*ret));
* Takes ownership of the public key.
* Copies the name.
*/
-CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OPENSSL_CTX *libctx,
+CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx,
const char *propq)
{
CTLOG *ret = OPENSSL_zalloc(sizeof(*ret));
*/
static const time_t SCT_CLOCK_DRIFT_TOLERANCE = 300;
-CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OPENSSL_CTX *libctx,
+CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
const char *propq)
{
CT_POLICY_EVAL_CTX *ctx = OPENSSL_zalloc(sizeof(CT_POLICY_EVAL_CTX));
#include "ct_local.h"
-SCT_CTX *SCT_CTX_new(OPENSSL_CTX *libctx, const char *propq)
+SCT_CTX *SCT_CTX_new(OSSL_LIB_CTX *libctx, const char *propq)
{
SCT_CTX *sctx = OPENSSL_zalloc(sizeof(*sctx));
}
static int dh_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq)
{
DH *dh = from->pkey.dh;
#ifdef FIPS_MODULE
-static int dh_gen_named_group(OPENSSL_CTX *libctx, DH *ret, int prime_len)
+static int dh_gen_named_group(OSSL_LIB_CTX *libctx, DH *ret, int prime_len)
{
DH *dh;
int ok = 0;
return NULL;
}
-static DH *dh_param_init(OPENSSL_CTX *libctx, int uid, const BIGNUM *p,
+static DH *dh_param_init(OSSL_LIB_CTX *libctx, int uid, const BIGNUM *p,
const BIGNUM *q, const BIGNUM *g)
{
DH *dh = dh_new_ex(libctx);
return dh;
}
-static DH *dh_new_by_group_name(OPENSSL_CTX *libctx, const char *name)
+static DH *dh_new_by_group_name(OSSL_LIB_CTX *libctx, const char *name)
{
int i;
return NULL;
}
-DH *dh_new_by_nid_ex(OPENSSL_CTX *libctx, int nid)
+DH *dh_new_by_nid_ex(OSSL_LIB_CTX *libctx, int nid)
{
const char *name = ossl_ffc_named_group_from_uid(nid);
const unsigned char *Z, size_t Zlen,
const char *cek_alg,
const unsigned char *ukm, size_t ukmlen, const EVP_MD *md,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int ret = 0;
EVP_KDF_CTX *kctx = NULL;
int nid;
const char *key_alg = NULL;
const OSSL_PROVIDER *prov = EVP_MD_provider(md);
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
nid = OBJ_obj2nid(key_oid);
if (nid == NID_undef)
#include "crypto/dh.h"
#include "dh_local.h"
-static DH *dh_new_intern(ENGINE *engine, OPENSSL_CTX *libctx);
+static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
#ifndef FIPS_MODULE
int DH_set_method(DH *dh, const DH_METHOD *meth)
}
#endif /* !FIPS_MODULE */
-DH *dh_new_ex(OPENSSL_CTX *libctx)
+DH *dh_new_ex(OSSL_LIB_CTX *libctx)
{
return dh_new_intern(NULL, libctx);
}
-static DH *dh_new_intern(ENGINE *engine, OPENSSL_CTX *libctx)
+static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
{
DH *ret = OPENSSL_zalloc(sizeof(*ret));
CRYPTO_EX_DATA ex_data;
ENGINE *engine;
#endif
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const DH_METHOD *meth;
CRYPTO_RWLOCK *lock;
return -2;
}
-static DH *ffc_params_generate(OPENSSL_CTX *libctx, DH_PKEY_CTX *dctx,
+static DH *ffc_params_generate(OSSL_LIB_CTX *libctx, DH_PKEY_CTX *dctx,
BN_GENCB *pcb)
{
DH *ret;
}
static int dsa_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq)
{
DSA *dsa = from->pkey.dsa;
#include "crypto/dsa.h"
#include "crypto/dh.h" /* required by DSA_dup_DH() */
-static DSA *dsa_new_intern(ENGINE *engine, OPENSSL_CTX *libctx);
+static DSA *dsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
#ifndef FIPS_MODULE
return d->meth;
}
-static DSA *dsa_new_intern(ENGINE *engine, OPENSSL_CTX *libctx)
+static DSA *dsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
{
DSA *ret = OPENSSL_zalloc(sizeof(*ret));
return dsa_new_intern(engine, NULL);
}
-DSA *dsa_new_with_ctx(OPENSSL_CTX *libctx)
+DSA *dsa_new_with_ctx(OSSL_LIB_CTX *libctx)
{
return dsa_new_intern(NULL, libctx);
}
/* functional reference if 'meth' is ENGINE-provided */
ENGINE *engine;
CRYPTO_RWLOCK *lock;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
/* Provider data */
size_t dirty_cnt; /* If any key material changes, increment this */
int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len,
const uint8_t public_key[32], const uint8_t private_key[32],
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
uint8_t az[SHA512_DIGEST_LENGTH];
uint8_t nonce[SHA512_DIGEST_LENGTH];
int ED25519_verify(const uint8_t *message, size_t message_len,
const uint8_t signature[64], const uint8_t public_key[32],
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int i;
ge_p3 A;
return res;
}
-int ED25519_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[32],
+int ED25519_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[32],
const uint8_t private_key[32], const char *propq)
{
uint8_t az[SHA512_DIGEST_LENGTH];
# define OSSL_CRYPTO_EC_CURVE448_LOCAL_H
# include "curve448utils.h"
-int ED448ph_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64],
+int ED448ph_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64],
const uint8_t public_key[57], const uint8_t private_key[57],
const uint8_t *context, size_t context_len, const char *propq);
-int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64],
+int ED448ph_verify(OSSL_LIB_CTX *ctx, const uint8_t hash[64],
const uint8_t signature[114], const uint8_t public_key[57],
const uint8_t *context, size_t context_len, const char *propq);
* privkey (in): The private key.
*/
c448_error_t c448_ed448_derive_public_key(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t pubkey [EDDSA_448_PUBLIC_BYTES],
const uint8_t privkey [EDDSA_448_PRIVATE_BYTES],
const char *propq);
* disambiguation. For Ed448 it is safe.
*/
c448_error_t c448_ed448_sign(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
* disambiguation. For Ed448 it is safe.
*/
c448_error_t c448_ed448_sign_prehash(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
* non-prehashed messages, at least without some very careful protocol-level
* disambiguation. For Ed448 it is safe.
*/
-c448_error_t c448_ed448_verify(OPENSSL_CTX *ctx,
+c448_error_t c448_ed448_verify(OSSL_LIB_CTX *ctx,
const uint8_t
signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t
* disambiguation. For Ed448 it is safe.
*/
c448_error_t c448_ed448_verify_prehash(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
const uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
const uint8_t hash[64],
* ed (in): The EdDSA private key
*/
c448_error_t c448_ed448_convert_private_key_to_x448(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t x[X448_PRIVATE_BYTES],
const uint8_t ed[EDDSA_448_PRIVATE_BYTES],
const char *propq);
#define COFACTOR 4
-static c448_error_t oneshot_hash(OPENSSL_CTX *ctx, uint8_t *out, size_t outlen,
+static c448_error_t oneshot_hash(OSSL_LIB_CTX *ctx, uint8_t *out, size_t outlen,
const uint8_t *in, size_t inlen,
const char *propq)
{
secret_scalar_ser[EDDSA_448_PRIVATE_BYTES - 2] |= 0x80;
}
-static c448_error_t hash_init_with_dom(OPENSSL_CTX *ctx, EVP_MD_CTX *hashctx,
+static c448_error_t hash_init_with_dom(OSSL_LIB_CTX *ctx, EVP_MD_CTX *hashctx,
uint8_t prehashed,
uint8_t for_prehash,
const uint8_t *context,
/* In this file because it uses the hash */
c448_error_t c448_ed448_convert_private_key_to_x448(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t x[X448_PRIVATE_BYTES],
const uint8_t ed [EDDSA_448_PRIVATE_BYTES],
const char *propq)
}
c448_error_t c448_ed448_derive_public_key(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
const char *propq)
}
c448_error_t c448_ed448_sign(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
}
c448_error_t c448_ed448_sign_prehash(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
}
c448_error_t c448_ed448_verify(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
const uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
const uint8_t *message, size_t message_len,
}
c448_error_t c448_ed448_verify_prehash(
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
const uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
const uint8_t hash[64], const uint8_t *context,
context_len, propq);
}
-int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message,
+int ED448_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t *message,
size_t message_len, const uint8_t public_key[57],
const uint8_t private_key[57], const uint8_t *context,
size_t context_len, const char *propq)
== C448_SUCCESS;
}
-int ED448_verify(OPENSSL_CTX *ctx, const uint8_t *message, size_t message_len,
+int ED448_verify(OSSL_LIB_CTX *ctx, const uint8_t *message, size_t message_len,
const uint8_t signature[114], const uint8_t public_key[57],
const uint8_t *context, size_t context_len, const char *propq)
{
propq) == C448_SUCCESS;
}
-int ED448ph_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64],
+int ED448ph_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64],
const uint8_t public_key[57], const uint8_t private_key[57],
const uint8_t *context, size_t context_len, const char *propq)
{
}
-int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64],
+int ED448ph_verify(OSSL_LIB_CTX *ctx, const uint8_t hash[64],
const uint8_t signature[114], const uint8_t public_key[57],
const uint8_t *context, size_t context_len, const char *propq)
{
(uint8_t)context_len, propq) == C448_SUCCESS;
}
-int ED448_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[57],
+int ED448_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[57],
const uint8_t private_key[57], const char *propq)
{
return c448_ed448_derive_public_key(ctx, out_public_key, private_key, propq)
}
static EC_KEY *eckey_type2param(int ptype, const void *pval,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EC_KEY *eckey = NULL;
EC_GROUP *group = NULL;
int ptype, pklen;
EC_KEY *eckey = NULL;
X509_ALGOR *palg;
- OPENSSL_CTX *libctx = NULL;
+ OSSL_LIB_CTX *libctx = NULL;
const char *propq = NULL;
if (!X509_PUBKEY_get0_libctx(&libctx, &propq, pubkey)
}
static int eckey_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
const unsigned char *p = NULL;
const void *pval;
static
int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq)
{
const EC_KEY *eckey = NULL;
}
int ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
- OSSL_PARAM params[], OPENSSL_CTX *libctx, const char *propq,
+ OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
+ const char *propq,
BN_CTX *bnctx, unsigned char **genbuf)
{
int ret = 0, curve_nid, encoding_flag;
return NID_undef;
}
-static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx,
+static EC_GROUP *ec_group_new_from_data(OSSL_LIB_CTX *libctx,
const char *propq,
const ec_list_element curve)
{
return group;
}
-EC_GROUP *EC_GROUP_new_by_curve_name_ex(OPENSSL_CTX *libctx, const char *propq,
+EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
int nid)
{
EC_GROUP *ret = NULL;
}
#endif
-EC_KEY *EC_KEY_new_ex(OPENSSL_CTX *ctx, const char *propq)
+EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq)
{
return ec_key_new_method_int(ctx, propq, NULL);
}
-EC_KEY *EC_KEY_new_by_curve_name_ex(OPENSSL_CTX *ctx, const char *propq,
+EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, const char *propq,
int nid)
{
EC_KEY *ret = EC_KEY_new_ex(ctx, propq);
}
-OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *key)
+OSSL_LIB_CTX *ec_key_get_libctx(const EC_KEY *key)
{
return key->libctx;
}
return 1;
}
-EC_KEY *ec_key_new_method_int(OPENSSL_CTX *libctx, const char *propq,
+EC_KEY *ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq,
ENGINE *engine)
{
EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
/* functions for EC_GROUP objects */
-EC_GROUP *ec_group_new_ex(OPENSSL_CTX *libctx, const char *propq,
+EC_GROUP *ec_group_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
const EC_METHOD *meth)
{
EC_GROUP *ret;
* mathematically wrong anyway and should not be used.
*/
static EC_GROUP *ec_group_explicit_to_named(const EC_GROUP *group,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq,
BN_CTX *ctx)
{
}
static EC_GROUP *group_new_from_name(const OSSL_PARAM *p,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int ok = 0, nid;
const char *curve_name = NULL;
}
EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
const OSSL_PARAM *ptmp, *pa, *pb;
int ok = 0;
EC_PRE_COMP *ec;
} pre_comp;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
};
CRYPTO_EX_DATA ex_data;
#endif
CRYPTO_RWLOCK *lock;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
/* Provider data */
* \param meth EC_METHOD to use
* \return newly created EC_GROUP object or NULL in case of an error.
*/
-EC_GROUP *ec_group_new_ex(OPENSSL_CTX *libctx, const char *propq,
+EC_GROUP *ec_group_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
const EC_METHOD *meth);
#ifdef ECP_NISTZ256_ASM
#define EC_KEY_METHOD_DYNAMIC 1
-EC_KEY *ec_key_new_method_int(OPENSSL_CTX *libctx, const char *propq,
+EC_KEY *ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq,
ENGINE *engine);
int ossl_ec_key_gen(EC_KEY *eckey);
const unsigned char *Z, size_t Zlen,
const unsigned char *sinfo, size_t sinfolen,
const EVP_MD *md,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int ret = 0;
EVP_KDF_CTX *kctx = NULL;
#include <openssl/err.h>
#include "crypto/ecx.h"
-ECX_KEY *ecx_key_new(OPENSSL_CTX *libctx, ECX_KEY_TYPE type, int haspubkey,
+ECX_KEY *ecx_key_new(OSSL_LIB_CTX *libctx, ECX_KEY_TYPE type, int haspubkey,
const char *propq)
{
ECX_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
/* Setup EVP_PKEY using public, private or generation */
static int ecx_key_op(EVP_PKEY *pkey, int id, const X509_ALGOR *palg,
const unsigned char *p, int plen, ecx_key_op_t op,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
ECX_KEY *key = NULL;
unsigned char *privkey, *pubkey;
}
static int ecx_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
const unsigned char *p;
int plen;
}
static int ecx_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq)
{
const ECX_KEY *key = from->pkey.ecx;
}
int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
/*
* This function goes through existing decoder methods in
ossl_method_store_free(vstore);
}
-static void *decoder_store_new(OPENSSL_CTX *ctx)
+static void *decoder_store_new(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
-static const OPENSSL_CTX_METHOD decoder_store_method = {
+static const OSSL_LIB_CTX_METHOD decoder_store_method = {
decoder_store_new,
decoder_store_free,
};
/* Data to be passed through ossl_method_construct() */
struct decoder_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
OSSL_METHOD_CONSTRUCT_METHOD *mcm;
int id; /* For get_decoder_from_store() */
const char *names; /* For get_decoder_from_store() */
*/
/* Temporary decoder method store, constructor and destructor */
-static void *alloc_tmp_decoder_store(OPENSSL_CTX *ctx)
+static void *alloc_tmp_decoder_store(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
}
/* Get the permanent decoder store */
-static OSSL_METHOD_STORE *get_decoder_store(OPENSSL_CTX *libctx)
+static OSSL_METHOD_STORE *get_decoder_store(OSSL_LIB_CTX *libctx)
{
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_DECODER_STORE_INDEX,
- &decoder_store_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX,
+ &decoder_store_method);
}
/* Get decoder methods from a store, or put one in */
-static void *get_decoder_from_store(OPENSSL_CTX *libctx, void *store,
+static void *get_decoder_from_store(OSSL_LIB_CTX *libctx, void *store,
void *data)
{
struct decoder_data_st *methdata = data;
return method;
}
-static int put_decoder_in_store(OPENSSL_CTX *libctx, void *store,
+static int put_decoder_in_store(OSSL_LIB_CTX *libctx, void *store,
void *method, const OSSL_PROVIDER *prov,
int operation_id, const char *names,
const char *propdef, void *unused)
* namemap entry, this is it. Should the name already exist there, we
* know that ossl_namemap_add() will return its corresponding number.
*/
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *names = algodef->algorithm_names;
int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
}
/* Fetching support. Can fetch by numeric identity or by name */
-static OSSL_DECODER *inner_ossl_decoder_fetch(OPENSSL_CTX *libctx, int id,
+static OSSL_DECODER *inner_ossl_decoder_fetch(OSSL_LIB_CTX *libctx, int id,
const char *name,
const char *properties)
{
return method;
}
-OSSL_DECODER *OSSL_DECODER_fetch(OPENSSL_CTX *libctx, const char *name,
+OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
const char *properties)
{
return inner_ossl_decoder_fetch(libctx, 0, name, properties);
}
-OSSL_DECODER *ossl_decoder_fetch_by_number(OPENSSL_CTX *libctx, int id,
+OSSL_DECODER *ossl_decoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id,
const char *properties)
{
return inner_ossl_decoder_fetch(libctx, id, NULL, properties);
int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name)
{
if (decoder->base.prov != NULL) {
- OPENSSL_CTX *libctx = ossl_provider_library_context(decoder->base.prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(decoder->base.prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
return ossl_namemap_name2num(namemap, name) == decoder->base.id;
int no_store, void *vdata)
{
struct decoder_do_all_data_st *data = vdata;
- OPENSSL_CTX *libctx = ossl_provider_library_context(provider);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *names = algodef->algorithm_names;
int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
}
}
-void OSSL_DECODER_do_all_provided(OPENSSL_CTX *libctx,
+void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_DECODER *decoder, void *arg),
void *arg)
{
return;
if (decoder->base.prov != NULL) {
- OPENSSL_CTX *libctx = ossl_provider_library_context(decoder->base.prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(decoder->base.prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
ossl_namemap_doall_names(namemap, decoder->base.id, fn, data);
int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx,
EVP_PKEY **pkey, const char *keytype,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propquery)
{
struct collected_data_st *data = NULL;
OSSL_DECODER_CTX *
OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey,
const char *input_type, const char *keytype,
- OPENSSL_CTX *libctx, const char *propquery)
+ OSSL_LIB_CTX *libctx, const char *propquery)
{
OSSL_DECODER_CTX *ctx = NULL;
}
int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
return 1;
}
ossl_method_store_free(vstore);
}
-static void *encoder_store_new(OPENSSL_CTX *ctx)
+static void *encoder_store_new(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
-static const OPENSSL_CTX_METHOD encoder_store_method = {
+static const OSSL_LIB_CTX_METHOD encoder_store_method = {
encoder_store_new,
encoder_store_free,
};
/* Data to be passed through ossl_method_construct() */
struct encoder_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
OSSL_METHOD_CONSTRUCT_METHOD *mcm;
int id; /* For get_encoder_from_store() */
const char *names; /* For get_encoder_from_store() */
*/
/* Temporary encoder method store, constructor and destructor */
-static void *alloc_tmp_encoder_store(OPENSSL_CTX *ctx)
+static void *alloc_tmp_encoder_store(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
}
/* Get the permanent encoder store */
-static OSSL_METHOD_STORE *get_encoder_store(OPENSSL_CTX *libctx)
+static OSSL_METHOD_STORE *get_encoder_store(OSSL_LIB_CTX *libctx)
{
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_ENCODER_STORE_INDEX,
- &encoder_store_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX,
+ &encoder_store_method);
}
/* Get encoder methods from a store, or put one in */
-static void *get_encoder_from_store(OPENSSL_CTX *libctx, void *store,
+static void *get_encoder_from_store(OSSL_LIB_CTX *libctx, void *store,
void *data)
{
struct encoder_data_st *methdata = data;
return method;
}
-static int put_encoder_in_store(OPENSSL_CTX *libctx, void *store,
+static int put_encoder_in_store(OSSL_LIB_CTX *libctx, void *store,
void *method, const OSSL_PROVIDER *prov,
int operation_id, const char *names,
const char *propdef, void *unused)
* namemap entry, this is it. Should the name already exist there, we
* know that ossl_namemap_add() will return its corresponding number.
*/
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *names = algodef->algorithm_names;
int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
}
/* Fetching support. Can fetch by numeric identity or by name */
-static OSSL_ENCODER *inner_ossl_encoder_fetch(OPENSSL_CTX *libctx,
+static OSSL_ENCODER *inner_ossl_encoder_fetch(OSSL_LIB_CTX *libctx,
int id, const char *name,
const char *properties)
{
return method;
}
-OSSL_ENCODER *OSSL_ENCODER_fetch(OPENSSL_CTX *libctx, const char *name,
+OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
const char *properties)
{
return inner_ossl_encoder_fetch(libctx, 0, name, properties);
}
-OSSL_ENCODER *ossl_encoder_fetch_by_number(OPENSSL_CTX *libctx, int id,
+OSSL_ENCODER *ossl_encoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id,
const char *properties)
{
return inner_ossl_encoder_fetch(libctx, id, NULL, properties);
int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name)
{
if (encoder->base.prov != NULL) {
- OPENSSL_CTX *libctx = ossl_provider_library_context(encoder->base.prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(encoder->base.prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
return ossl_namemap_name2num(namemap, name) == encoder->base.id;
int no_store, void *vdata)
{
struct encoder_do_all_data_st *data = vdata;
- OPENSSL_CTX *libctx = ossl_provider_library_context(provider);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *names = algodef->algorithm_names;
int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
}
}
-void OSSL_ENCODER_do_all_provided(OPENSSL_CTX *libctx,
+void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_ENCODER *encoder, void *arg),
void *arg)
{
return;
if (encoder->base.prov != NULL) {
- OPENSSL_CTX *libctx = ossl_provider_library_context(encoder->base.prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(encoder->base.prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
ossl_namemap_doall_names(namemap, encoder->base.id, fn, data);
static int ossl_encoder_ctx_setup_for_EVP_PKEY(OSSL_ENCODER_CTX *ctx,
const EVP_PKEY *pkey,
int selection,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propquery)
{
struct construct_data_st *data = NULL;
OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey,
const char *output_type,
int selection,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propquery)
{
OSSL_ENCODER_CTX *ctx = NULL;
return cipher->prov;
}
-EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(ctx, OSSL_OP_ASYM_CIPHER, algorithm, properties,
return cipher->name_id;
}
-void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_ASYM_CIPHER *cipher,
void *arg),
void *arg)
#ifndef FIPS_MODULE
EVP_MD_CTX *evp_md_ctx_new_ex(EVP_PKEY *pkey, const ASN1_OCTET_STRING *id,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_MD_CTX *ctx;
EVP_PKEY_CTX *pctx = NULL;
EVP_MD_free(md);
}
-EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
EVP_MD *md =
OPENSSL_free(md);
}
-void EVP_MD_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_MD_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MD *mac, void *arg),
void *arg)
{
}
#ifndef FIPS_MODULE
-static OPENSSL_CTX *EVP_CIPHER_CTX_get_libctx(EVP_CIPHER_CTX *ctx)
+static OSSL_LIB_CTX *EVP_CIPHER_CTX_get_libctx(EVP_CIPHER_CTX *ctx)
{
const EVP_CIPHER *cipher = ctx->cipher;
const OSSL_PROVIDER *prov;
#else
{
int kl;
- OPENSSL_CTX *libctx = EVP_CIPHER_CTX_get_libctx(ctx);
+ OSSL_LIB_CTX *libctx = EVP_CIPHER_CTX_get_libctx(ctx);
kl = EVP_CIPHER_CTX_key_length(ctx);
if (kl <= 0 || RAND_priv_bytes_ex(libctx, key, kl) <= 0)
EVP_CIPHER_free(cipher);
}
-EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
EVP_CIPHER *cipher =
OPENSSL_free(cipher);
}
-void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_CIPHER *mac, void *arg),
void *arg)
{
ossl_method_store_free(vstore);
}
-static void *evp_method_store_new(OPENSSL_CTX *ctx)
+static void *evp_method_store_new(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
-static const OPENSSL_CTX_METHOD evp_method_store_method = {
+static const OSSL_LIB_CTX_METHOD evp_method_store_method = {
evp_method_store_new,
evp_method_store_free,
};
/* Data to be passed through ossl_method_construct() */
struct evp_method_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
OSSL_METHOD_CONSTRUCT_METHOD *mcm;
int operation_id; /* For get_evp_method_from_store() */
int name_id; /* For get_evp_method_from_store() */
/*
* Generic routines to fetch / create EVP methods with ossl_method_construct()
*/
-static void *alloc_tmp_evp_method_store(OPENSSL_CTX *ctx)
+static void *alloc_tmp_evp_method_store(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
ossl_method_store_free(store);
}
-static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx)
+static OSSL_METHOD_STORE *get_evp_method_store(OSSL_LIB_CTX *libctx)
{
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_EVP_METHOD_STORE_INDEX,
- &evp_method_store_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX,
+ &evp_method_store_method);
}
/*
return ((name_id << 8) & 0xFFFFFF00) | (operation_id & 0x000000FF);
}
-static void *get_evp_method_from_store(OPENSSL_CTX *libctx, void *store,
+static void *get_evp_method_from_store(OSSL_LIB_CTX *libctx, void *store,
void *data)
{
struct evp_method_data_st *methdata = data;
return method;
}
-static int put_evp_method_in_store(OPENSSL_CTX *libctx, void *store,
+static int put_evp_method_in_store(OSSL_LIB_CTX *libctx, void *store,
void *method, const OSSL_PROVIDER *prov,
int operation_id, const char *names,
const char *propdef, void *data)
* number.
*/
struct evp_method_data_st *methdata = data;
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *names = algodef->algorithm_names;
int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
methdata->destruct_method(method);
}
-static const char *libctx_descriptor(OPENSSL_CTX *libctx)
+static const char *libctx_descriptor(OSSL_LIB_CTX *libctx)
{
#ifdef FIPS_MODULE
return "FIPS internal library context";
#else
- if (openssl_ctx_is_global_default(libctx))
+ if (ossl_lib_ctx_is_global_default(libctx))
return "Global default library context";
- if (openssl_ctx_is_default(libctx))
+ if (ossl_lib_ctx_is_default(libctx))
return "Thread-local default library context";
return "Non-default library context";
#endif
}
static void *
-inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
+inner_evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
int name_id, const char *name,
const char *properties,
void *(*new_method)(int name_id,
return method;
}
-void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
+void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
const char *name, const char *properties,
void *(*new_method)(int name_id,
const OSSL_DISPATCH *fns,
* This is meant to be used when one method needs to fetch an associated
* other method.
*/
-void *evp_generic_fetch_by_number(OPENSSL_CTX *libctx, int operation_id,
+void *evp_generic_fetch_by_number(OSSL_LIB_CTX *libctx, int operation_id,
int name_id, const char *properties,
void *(*new_method)(int name_id,
const OSSL_DISPATCH *fns,
free_method);
}
-void evp_method_store_flush(OPENSSL_CTX *libctx)
+void evp_method_store_flush(OSSL_LIB_CTX *libctx)
{
OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
ossl_method_store_flush_cache(store, 1);
}
-static int evp_set_parsed_default_properties(OPENSSL_CTX *libctx,
+static int evp_set_parsed_default_properties(OSSL_LIB_CTX *libctx,
OSSL_PROPERTY_LIST *def_prop,
int loadconfig)
{
return 0;
}
-int evp_set_default_properties_int(OPENSSL_CTX *libctx, const char *propq,
+int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq,
int loadconfig)
{
OSSL_PROPERTY_LIST *pl = NULL;
return evp_set_parsed_default_properties(libctx, pl, loadconfig);
}
-int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq)
+int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq)
{
return evp_set_default_properties_int(libctx, propq, 1);
}
-static int evp_default_properties_merge(OPENSSL_CTX *libctx, const char *propq)
+static int evp_default_properties_merge(OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_PROPERTY_LIST **plp = ossl_ctx_global_properties(libctx, 1);
OSSL_PROPERTY_LIST *pl1, *pl2;
return evp_set_parsed_default_properties(libctx, pl2, 0);
}
-static int evp_default_property_is_enabled(OPENSSL_CTX *libctx,
+static int evp_default_property_is_enabled(OSSL_LIB_CTX *libctx,
const char *prop_name)
{
OSSL_PROPERTY_LIST **plp = ossl_ctx_global_properties(libctx, 1);
return plp != NULL && ossl_property_is_enabled(libctx, prop_name, *plp);
}
-int EVP_default_properties_is_fips_enabled(OPENSSL_CTX *libctx)
+int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx)
{
return evp_default_property_is_enabled(libctx, "fips");
}
-int EVP_default_properties_enable_fips(OPENSSL_CTX *libctx, int enable)
+int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable)
{
const char *query = (enable != 0) ? "fips=yes" : "-fips";
int no_store, void *vdata)
{
struct do_all_data_st *data = vdata;
- OPENSSL_CTX *libctx = ossl_provider_library_context(provider);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
int name_id = ossl_namemap_add_names(namemap, 0, algo->algorithm_names,
NAME_SEPARATOR);
}
}
-void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id,
+void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id,
void (*user_fn)(void *method, void *arg),
void *user_arg,
void *(*new_method)(int name_id,
const char *evp_first_name(const OSSL_PROVIDER *prov, int name_id)
{
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
return ossl_namemap_num2name(namemap, name_id, 0);
/*
* For a |prov| that is NULL, the library context will be NULL
*/
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
if (prov == NULL)
void (*fn)(const char *name, void *data),
void *data)
{
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
ossl_namemap_doall_names(namemap, number, fn, data);
#include <openssl/types.h>
#include <openssl/core.h>
-void *evp_generic_fetch(OPENSSL_CTX *ctx, int operation_id,
+void *evp_generic_fetch(OSSL_LIB_CTX *ctx, int operation_id,
const char *name, const char *properties,
void *(*new_method)(int name_id,
const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *));
-void *evp_generic_fetch_by_number(OPENSSL_CTX *ctx, int operation_id,
+void *evp_generic_fetch_by_number(OSSL_LIB_CTX *ctx, int operation_id,
int name_id, const char *properties,
void *(*new_method)(int name_id,
const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *));
-void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id,
+void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id,
void (*user_fn)(void *method, void *arg),
void *user_arg,
void *(*new_method)(int name_id,
void (*free_method)(void *));
/* Internal fetchers for method types that are to be combined with others */
-EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OPENSSL_CTX *ctx, int name_id,
+EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OSSL_LIB_CTX *ctx, int name_id,
const char *properties);
/* Internal structure constructors for fetched methods */
/* Extract a private key from a PKCS8 structure */
-EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OPENSSL_CTX *libctx,
+EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
const char *propq)
{
EVP_PKEY *pkey = NULL;
return rand;
}
-EVP_RAND *EVP_RAND_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
ossl_provider_ctx(EVP_RAND_provider(rand)));
}
-void EVP_RAND_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_RAND *rand, void *arg),
void *arg)
{
return exchange->prov;
}
-EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties,
return evp_is_a(keyexch->prov, keyexch->name_id, NULL, name);
}
-void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYEXCH *keyexch, void *arg),
void *arg)
{
return kdf;
}
-EVP_KDF *EVP_KDF_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(libctx, OSSL_OP_KDF, algorithm, properties,
return kdf->settable_ctx_params(ossl_provider_ctx(EVP_KDF_provider(kdf)));
}
-void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KDF *kdf, void *arg),
void *arg)
{
return kem->prov;
}
-EVP_KEM *EVP_KEM_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(ctx, OSSL_OP_KEM, algorithm, properties,
return kem->name_id;
}
-void EVP_KEM_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEM *kem, void *arg),
void *arg)
{
return keymgmt;
}
-EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OPENSSL_CTX *ctx, int name_id,
+EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OSSL_LIB_CTX *ctx, int name_id,
const char *properties)
{
return evp_generic_fetch_by_number(ctx,
(void (*)(void *))EVP_KEYMGMT_free);
}
-EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(ctx, OSSL_OP_KEYMGMT, algorithm, properties,
return evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
}
-void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
void *arg)
{
static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, const char *mdname,
- OPENSSL_CTX *libctx, const char *props,
+ OSSL_LIB_CTX *libctx, const char *props,
ENGINE *e, EVP_PKEY *pkey, int ver)
{
EVP_PKEY_CTX *locpctx = NULL;
}
int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const char *mdname, OPENSSL_CTX *libctx,
+ const char *mdname, OSSL_LIB_CTX *libctx,
const char *props, EVP_PKEY *pkey)
{
return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 0);
}
int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const char *mdname, OPENSSL_CTX *libctx,
+ const char *mdname, OSSL_LIB_CTX *libctx,
const char *props, EVP_PKEY *pkey)
{
return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 1);
return mac;
}
-EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(libctx, OSSL_OP_MAC, algorithm, properties,
return mac->settable_ctx_params(ossl_provider_ctx(EVP_MAC_provider(mac)));
}
-void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MAC *mac, void *arg),
void *arg)
{
return evp_get_cipherbyname_ex(NULL, name);
}
-const EVP_CIPHER *evp_get_cipherbyname_ex(OPENSSL_CTX *libctx, const char *name)
+const EVP_CIPHER *evp_get_cipherbyname_ex(OSSL_LIB_CTX *libctx,
+ const char *name)
{
const EVP_CIPHER *cp;
OSSL_NAMEMAP *namemap;
return evp_get_digestbyname_ex(NULL, name);
}
-const EVP_MD *evp_get_digestbyname_ex(OPENSSL_CTX *libctx, const char *name)
+const EVP_MD *evp_get_digestbyname_ex(OSSL_LIB_CTX *libctx, const char *name)
{
const EVP_MD *dp;
OSSL_NAMEMAP *namemap;
int pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
const unsigned char *salt, int saltlen, int iter,
const EVP_MD *digest, int keylen, unsigned char *out,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
const char *empty = "";
int rv = 1, mode = 1;
}
-static EVP_PKEY *new_raw_key_int(OPENSSL_CTX *libctx,
+static EVP_PKEY *new_raw_key_int(OSSL_LIB_CTX *libctx,
const char *strtype,
const char *propq,
int nidtype,
return pkey;
}
-EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OPENSSL_CTX *libctx,
+EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *priv, size_t len)
return new_raw_key_int(NULL, NULL, NULL, type, e, priv, len, 1);
}
-EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OPENSSL_CTX *libctx,
+EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype, const char *propq,
const unsigned char *pub, size_t len)
{
static EVP_PKEY *new_cmac_key_int(const unsigned char *priv, size_t len,
const char *cipher_name,
- const EVP_CIPHER *cipher, OPENSSL_CTX *libctx,
+ const EVP_CIPHER *cipher,
+ OSSL_LIB_CTX *libctx,
const char *propq, ENGINE *e)
{
# ifndef OPENSSL_NO_CMAC
}
EVP_PKEY *EVP_PKEY_new_CMAC_key_ex(const unsigned char *priv, size_t len,
- const char *cipher_name, OPENSSL_CTX *libctx,
+ const char *cipher_name, OSSL_LIB_CTX *libctx,
const char *propq)
{
return new_cmac_key_int(priv, len, cipher_name, NULL, libctx, propq, NULL);
}
} else {
const OSSL_PROVIDER *prov = EVP_KEYMGMT_provider(pkey->keymgmt);
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
const char *supported_sig =
pkey->keymgmt->query_operation_name != NULL
? pkey->keymgmt->query_operation_name(OSSL_OP_SIGNATURE)
static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent,
int selection /* For provided encoding */,
- OPENSSL_CTX *libctx /* For provided encoding */,
+ OSSL_LIB_CTX *libctx /* For provided encoding */,
const char *propquery /* For provided encoding */,
int (*legacy_print)(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx),
return size;
}
-void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
+void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery)
{
* We perform the export in the same libctx as the keymgmt
* that we are using.
*/
- OPENSSL_CTX *libctx =
+ OSSL_LIB_CTX *libctx =
ossl_provider_library_context(keymgmt->prov);
EVP_PKEY_CTX *pctx =
EVP_PKEY_CTX_new_from_pkey(libctx, *dest, NULL);
#include "crypto/evp.h"
int EVP_SignFinal_ex(EVP_MD_CTX *ctx, unsigned char *sigret,
- unsigned int *siglen, EVP_PKEY *pkey, OPENSSL_CTX *libctx,
+ unsigned int *siglen, EVP_PKEY *pkey, OSSL_LIB_CTX *libctx,
const char *propq)
{
unsigned char m[EVP_MAX_MD_SIZE];
#include "crypto/evp.h"
int EVP_VerifyFinal_ex(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
- unsigned int siglen, EVP_PKEY *pkey, OPENSSL_CTX *libctx,
+ unsigned int siglen, EVP_PKEY *pkey, OSSL_LIB_CTX *libctx,
const char *propq)
{
unsigned char m[EVP_MAX_MD_SIZE];
if (maxmem == 0)
maxmem = SCRYPT_MAX_MEM;
- /* Use OPENSSL_CTX_set0_default() if you need a library context */
+ /* Use OSSL_LIB_CTX_set0_default() if you need a library context */
kdf = EVP_KDF_fetch(NULL, OSSL_KDF_NAME_SCRYPT, NULL);
kctx = EVP_KDF_CTX_new(kdf);
EVP_KDF_free(kdf);
}
#endif /* FIPS_MODULE */
-static EVP_PKEY_CTX *int_ctx_new(OPENSSL_CTX *libctx,
+static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx,
EVP_PKEY *pkey, ENGINE *e,
const char *keytype, const char *propquery,
int id)
/*- All methods below can also be used in FIPS_MODULE */
-EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OPENSSL_CTX *libctx,
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx,
const char *name,
const char *propquery)
{
return int_ctx_new(libctx, NULL, NULL, name, propquery, -1);
}
-EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OPENSSL_CTX *libctx, EVP_PKEY *pkey,
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx, EVP_PKEY *pkey,
const char *propquery)
{
return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
return ret;
}
-OPENSSL_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx)
+OSSL_LIB_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx)
{
return ctx->libctx;
}
return signature->prov;
}
-EVP_SIGNATURE *EVP_SIGNATURE_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(ctx, OSSL_OP_SIGNATURE, algorithm, properties,
return signature->name_id;
}
-void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_SIGNATURE *signature,
void *arg),
void *arg)
#include "crypto/cryptlib.h"
#include "internal/thread_once.h"
-int do_ex_data_init(OPENSSL_CTX *ctx)
+int do_ex_data_init(OSSL_LIB_CTX *ctx)
{
- OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
+ OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
if (global == NULL)
return 0;
* called under potential race-conditions anyway (it's for program shutdown
* after all).
*/
-void crypto_cleanup_all_ex_data_int(OPENSSL_CTX *ctx)
+void crypto_cleanup_all_ex_data_int(OSSL_LIB_CTX *ctx)
{
int i;
- OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
+ OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
if (global == NULL)
return;
return 1;
}
-int crypto_free_ex_index_ex(OPENSSL_CTX *ctx, int class_index, int idx)
+int crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx)
{
EX_CALLBACKS *ip;
EX_CALLBACK *a;
int toret = 0;
- OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
+ OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
if (global == NULL)
return 0;
/*
* Register a new index.
*/
-int crypto_get_ex_new_index_ex(OPENSSL_CTX *ctx, int class_index, long argl,
+int crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index, long argl,
void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func,
CRYPTO_EX_free *free_func)
int toret = -1;
EX_CALLBACK *a;
EX_CALLBACKS *ip;
- OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
+ OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
if (global == NULL)
return -1;
* in the lock, then using them outside the lock. Note this only applies
* to the global "ex_data" state (ie. class definitions), not 'ad' itself.
*/
-int crypto_new_ex_data_ex(OPENSSL_CTX *ctx, int class_index, void *obj,
+int crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
CRYPTO_EX_DATA *ad)
{
int mx, i;
EX_CALLBACK **storage = NULL;
EX_CALLBACK *stack[10];
EX_CALLBACKS *ip;
- OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
+ OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
if (global == NULL)
return 0;
/* Nothing to copy over */
return 1;
- global = openssl_ctx_get_ex_data_global(from->ctx);
+ global = ossl_lib_ctx_get_ex_data_global(from->ctx);
if (global == NULL)
return 0;
EX_CALLBACK *f;
EX_CALLBACK *stack[10];
EX_CALLBACK **storage = NULL;
- OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ad->ctx);
+ OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
if (global == NULL)
goto err;
if (curval != NULL)
return 1;
- global = openssl_ctx_get_ex_data_global(ad->ctx);
+ global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
if (global == NULL)
return 0;
return sk_void_value(ad->sk, idx);
}
-OPENSSL_CTX *crypto_ex_data_get_openssl_ctx(const CRYPTO_EX_DATA *ad)
+OSSL_LIB_CTX *crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad)
{
return ad->ctx;
}
unsigned char md[EVP_MAX_MD_SIZE];
int mdsize = EVP_MD_size(evpmd);
unsigned char *pmd;
- OPENSSL_CTX *libctx = bn_get_lib_ctx(ctx);
+ OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx);
/* find q */
for (;;) {
unsigned char buf2[EVP_MAX_MD_SIZE];
unsigned char md[EVP_MAX_MD_SIZE];
int i, r, ret = 0, m = *retm;
- OPENSSL_CTX *libctx = bn_get_lib_ctx(ctx);
+ OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx);
/* find q */
for (;;) {
* - FFC_PARAM_RET_STATUS_UNVERIFIABLE_G if the validation of G succeeded,
* but G is unverifiable.
*/
-int ossl_ffc_params_FIPS186_4_gen_verify(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_4_gen_verify(OSSL_LIB_CTX *libctx,
FFC_PARAMS *params, int mode, int type,
size_t L, size_t N, int *res,
BN_GENCB *cb)
}
/* Note this function is only used for verification in fips mode */
-int ossl_ffc_params_FIPS186_2_gen_verify(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_2_gen_verify(OSSL_LIB_CTX *libctx,
FFC_PARAMS *params, int mode, int type,
size_t L, size_t N, int *res,
BN_GENCB *cb)
return ok;
}
-int ossl_ffc_params_FIPS186_4_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+int ossl_ffc_params_FIPS186_4_generate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type, size_t L, size_t N,
int *res, BN_GENCB *cb)
{
}
/* This should no longer be used in FIPS mode */
-int ossl_ffc_params_FIPS186_2_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+int ossl_ffc_params_FIPS186_2_generate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type, size_t L, size_t N,
int *res, BN_GENCB *cb)
{
return 1;
}
-int ossl_ffc_params_FIPS186_4_validate(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_4_validate(OSSL_LIB_CTX *libctx,
const FFC_PARAMS *params, int type,
int *res, BN_GENCB *cb)
{
}
/* This may be used in FIPS mode to validate deprecated FIPS-186-2 Params */
-int ossl_ffc_params_FIPS186_2_validate(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_2_validate(OSSL_LIB_CTX *libctx,
const FFC_PARAMS *params, int type,
int *res, BN_GENCB *cb)
{
* extra parameters such as the digest and seed, which may not be available for
* this test.
*/
-int ossl_ffc_params_simple_validate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+int ossl_ffc_params_simple_validate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type)
{
int ret, res = 0;
/*
* TODO(3.0): This function needs looking at with a view to moving most/all
- * of this into onfree handlers in OPENSSL_CTX.
+ * of this into onfree handlers in OSSL_LIB_CTX.
*/
/* If we've not been inited then no need to deinit */
* - rand_cleanup_int could call an ENGINE's RAND cleanup function so
* must be called before engine_cleanup_int()
* - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
- * before the ex data handlers are wiped during default openssl_ctx deinit.
+ * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
* - conf_modules_free_int() can end up in ENGINE code so must be called
* before engine_cleanup_int()
* - ENGINEs and additional EVP algorithms might use added OIDs names so
ossl_store_cleanup_int();
#endif
- OSSL_TRACE(INIT, "OPENSSL_cleanup: openssl_ctx_default_deinit()\n");
- openssl_ctx_default_deinit();
+ OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
+ ossl_lib_ctx_default_deinit();
ossl_cleanup_thread();
{
/*
* TODO(3.0): This function needs looking at with a view to moving most/all
- * of this into OPENSSL_CTX.
+ * of this into OSSL_LIB_CTX.
*/
if (stopped) {
destructor_key.sane = -1;
}
-void OPENSSL_thread_stop_ex(OPENSSL_CTX *ctx)
+void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx)
{
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
/*
* TODO(3.0). It would be nice if we could figure out a way to do this on
- * all threads that have used the OPENSSL_CTX when the OPENSSL_CTX is freed.
+ * all threads that have used the OSSL_LIB_CTX when the context is freed.
* This is currently not possible due to the use of thread local variables.
*/
ossl_ctx_thread_stop(ctx);
#else
-static void *thread_event_ossl_ctx_new(OPENSSL_CTX *libctx)
+static void *thread_event_ossl_ctx_new(OSSL_LIB_CTX *libctx)
{
THREAD_EVENT_HANDLER **hands = NULL;
CRYPTO_THREAD_LOCAL *tlocal = OPENSSL_zalloc(sizeof(*tlocal));
OPENSSL_free(tlocal);
}
-static const OPENSSL_CTX_METHOD thread_event_ossl_ctx_method = {
+static const OSSL_LIB_CTX_METHOD thread_event_ossl_ctx_method = {
thread_event_ossl_ctx_new,
thread_event_ossl_ctx_free,
};
void ossl_ctx_thread_stop(void *arg)
{
THREAD_EVENT_HANDLER **hands;
- OPENSSL_CTX *ctx = arg;
+ OSSL_LIB_CTX *ctx = arg;
CRYPTO_THREAD_LOCAL *local
- = openssl_ctx_get_data(ctx, OPENSSL_CTX_THREAD_EVENT_HANDLER_INDEX,
- &thread_event_ossl_ctx_method);
+ = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX,
+ &thread_event_ossl_ctx_method);
if (local == NULL)
return;
THREAD_EVENT_HANDLER **hands;
THREAD_EVENT_HANDLER *hand;
#ifdef FIPS_MODULE
- OPENSSL_CTX *ctx = arg;
+ OSSL_LIB_CTX *ctx = arg;
/*
* In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
- * of OPENSSL_CTX and thread. This is because in FIPS mode each OPENSSL_CTX
- * gets informed about thread stop events individually.
+ * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
+ * OSSL_LIB_CTX gets informed about thread stop events individually.
*/
CRYPTO_THREAD_LOCAL *local
- = openssl_ctx_get_data(ctx, OPENSSL_CTX_THREAD_EVENT_HANDLER_INDEX,
- &thread_event_ossl_ctx_method);
+ = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX,
+ &thread_event_ossl_ctx_method);
#else
/*
* Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
- * thread, but may hold multiple OPENSSL_CTXs. We only get told about
+ * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
* thread stop events globally, so we have to ensure all affected
- * OPENSSL_CTXs are informed.
+ * OSSL_LIB_CTXs are informed.
*/
CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
#endif
*/
SIV128_CONTEXT *CRYPTO_siv128_new(const unsigned char *key, int klen,
EVP_CIPHER *cbc, EVP_CIPHER *ctr,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
SIV128_CONTEXT *ctx;
int ret;
*/
int CRYPTO_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen,
const EVP_CIPHER *cbc, const EVP_CIPHER *ctr,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
static const unsigned char zero[SIV_LEN] = { 0 };
size_t out_len = SIV_LEN;
}
int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
ASN1_OCTET_STRING *byKey = NULL;
unsigned char md[SHA_DIGEST_LENGTH];
return OCSP_RESPID_set_by_key_ex(respid, cert, NULL, NULL);
}
-int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OPENSSL_CTX *libctx,
+int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
const char *propq)
{
EVP_MD *sha1 = NULL;
#ifndef OPENSSL_NO_STDIO
STACK_OF(X509_INFO)
*PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx, const char *propq)
+ void *u, OSSL_LIB_CTX *libctx, const char *propq)
{
BIO *b;
STACK_OF(X509_INFO) *ret;
STACK_OF(X509_INFO)
*PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
- pem_password_cb *cb, void *u, OPENSSL_CTX *libctx,
+ pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx,
const char *propq)
{
X509_INFO *xi = NULL;
int nid, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
#ifndef OPENSSL_NO_STDIO
static int do_pk8pkey_fp(FILE *bp, const EVP_PKEY *x, int isder,
int nid, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
#endif
/*
* These functions write a private key in PKCS#8 format: it is a "drop in"
static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
const EVP_CIPHER *enc, const char *kstr, int klen,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int ret = 0;
const char *outtype = isder ? "DER" : "PEM";
static int do_pk8pkey_fp(FILE *fp, const EVP_PKEY *x, int isder, int nid,
const EVP_CIPHER *enc, const char *kstr, int klen,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
BIO *bp;
int ret;
static EVP_PKEY *pem_read_bio_key(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
int expected_store_info_type,
int try_secure)
{
EVP_PKEY *PEM_read_bio_PUBKEY_ex(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
return pem_read_bio_key(bp, x, cb, u, libctx, propq,
OSSL_STORE_INFO_PUBKEY, 0);
#ifndef OPENSSL_NO_STDIO
EVP_PKEY *PEM_read_PUBKEY_ex(FILE *fp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
BIO *b;
EVP_PKEY *ret;
EVP_PKEY *PEM_read_bio_PrivateKey_ex(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
return pem_read_bio_key(bp, x, cb, u, libctx, propq,
OSSL_STORE_INFO_PKEY, 1);
}
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
return pem_read_bio_key(bp, x, NULL, NULL, libctx, propq,
OSSL_STORE_INFO_PARAMS, 0);
#ifndef OPENSSL_NO_STDIO
EVP_PKEY *PEM_read_PrivateKey_ex(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx,
+ void *u, OSSL_LIB_CTX *libctx,
const char *propq)
{
BIO *b;
return (PKCS7 *)ASN1_item_new(ASN1_ITEM_rptr(PKCS7));
}
-PKCS7 *PKCS7_new_ex(OPENSSL_CTX *libctx, const char *propq)
+PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
{
PKCS7 *pkcs7 = PKCS7_new();
return p7 != NULL ? &p7->ctx : NULL;
}
-OPENSSL_CTX *pkcs7_ctx_get0_libctx(const PKCS7_CTX *ctx)
+OSSL_LIB_CTX *pkcs7_ctx_get0_libctx(const PKCS7_CTX *ctx)
{
return ctx != NULL ? ctx->libctx : NULL;
}
#include "crypto/pkcs7.h"
const PKCS7_CTX *pkcs7_get0_ctx(const PKCS7 *p7);
-OPENSSL_CTX *pkcs7_ctx_get0_libctx(const PKCS7_CTX *ctx);
+OSSL_LIB_CTX *pkcs7_ctx_get0_libctx(const PKCS7_CTX *ctx);
const char *pkcs7_ctx_get0_propq(const PKCS7_CTX *ctx);
static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
- BIO *data, int flags, OPENSSL_CTX *libctx,
+ BIO *data, int flags, OSSL_LIB_CTX *libctx,
const char *propq)
{
PKCS7 *p7;
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
const EVP_CIPHER *cipher, int flags,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
PKCS7 *p7;
BIO *p7bio = NULL;
}
}
-static void *property_defns_new(OPENSSL_CTX *ctx) {
+static void *property_defns_new(OSSL_LIB_CTX *ctx) {
return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
}
-static const OPENSSL_CTX_METHOD property_defns_method = {
+static const OSSL_LIB_CTX_METHOD property_defns_method = {
property_defns_new,
property_defns_free,
};
-OSSL_PROPERTY_LIST *ossl_prop_defn_get(OPENSSL_CTX *ctx, const char *prop)
+OSSL_PROPERTY_LIST *ossl_prop_defn_get(OSSL_LIB_CTX *ctx, const char *prop)
{
PROPERTY_DEFN_ELEM elem, *r;
LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
- property_defns = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_DEFN_INDEX,
- &property_defns_method);
+ property_defns = ossl_lib_ctx_get_data(ctx,
+ OSSL_LIB_CTX_PROPERTY_DEFN_INDEX,
+ &property_defns_method);
if (property_defns == NULL)
return NULL;
return r != NULL ? r->defn : NULL;
}
-int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
+int ossl_prop_defn_set(OSSL_LIB_CTX *ctx, const char *prop,
OSSL_PROPERTY_LIST *pl)
{
PROPERTY_DEFN_ELEM elem, *old, *p = NULL;
size_t len;
LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
- property_defns = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_DEFN_INDEX,
- &property_defns_method);
+ property_defns = ossl_lib_ctx_get_data(ctx,
+ OSSL_LIB_CTX_PROPERTY_DEFN_INDEX,
+ &property_defns_method);
if (property_defns == NULL)
return 0;
} ALGORITHM;
struct ossl_method_store_st {
- OPENSSL_CTX *ctx;
+ OSSL_LIB_CTX *ctx;
size_t nelem;
SPARSE_ARRAY_OF(ALGORITHM) *algs;
int need_flush;
}
}
-static void *ossl_ctx_global_properties_new(OPENSSL_CTX *ctx)
+static void *ossl_ctx_global_properties_new(OSSL_LIB_CTX *ctx)
{
return OPENSSL_zalloc(sizeof(OSSL_PROPERTY_LIST **));
}
-static const OPENSSL_CTX_METHOD ossl_ctx_global_properties_method = {
+static const OSSL_LIB_CTX_METHOD ossl_ctx_global_properties_method = {
ossl_ctx_global_properties_new,
ossl_ctx_global_properties_free,
};
-OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OPENSSL_CTX *libctx,
+OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *libctx,
int loadconfig)
{
#ifndef FIPS_MODULE
if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
return NULL;
#endif
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_GLOBAL_PROPERTIES,
- &ossl_ctx_global_properties_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES,
+ &ossl_ctx_global_properties_method);
}
static int ossl_method_up_ref(METHOD *method)
}
/*
- * The OPENSSL_CTX param here allows access to underlying property data needed
+ * The OSSL_LIB_CTX param here allows access to underlying property data needed
* for computation
*/
-OSSL_METHOD_STORE *ossl_method_store_new(OPENSSL_CTX *ctx)
+OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx)
{
OSSL_METHOD_STORE *res;
typedef int OSSL_PROPERTY_IDX;
/* Property string functions */
-OSSL_PROPERTY_IDX ossl_property_name(OPENSSL_CTX *ctx, const char *s,
+OSSL_PROPERTY_IDX ossl_property_name(OSSL_LIB_CTX *ctx, const char *s,
int create);
-OSSL_PROPERTY_IDX ossl_property_value(OPENSSL_CTX *ctx, const char *s,
+OSSL_PROPERTY_IDX ossl_property_value(OSSL_LIB_CTX *ctx, const char *s,
int create);
/* Property list functions */
int ossl_property_has_optional(const OSSL_PROPERTY_LIST *query);
/* Property definition cache functions */
-OSSL_PROPERTY_LIST *ossl_prop_defn_get(OPENSSL_CTX *ctx, const char *prop);
-int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
+OSSL_PROPERTY_LIST *ossl_prop_defn_get(OSSL_LIB_CTX *ctx, const char *prop);
+int ossl_prop_defn_set(OSSL_LIB_CTX *ctx, const char *prop,
OSSL_PROPERTY_LIST *pl);
/* Property cache lock / unlock */
return 0;
}
-static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create,
+static int parse_name(OSSL_LIB_CTX *ctx, const char *t[], int create,
OSSL_PROPERTY_IDX *idx)
{
char name[100];
return 1;
}
-static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim,
+static int parse_string(OSSL_LIB_CTX *ctx, const char *t[], char delim,
PROPERTY_DEFINITION *res, const int create)
{
char v[1000];
return !err;
}
-static int parse_unquoted(OPENSSL_CTX *ctx, const char *t[],
+static int parse_unquoted(OSSL_LIB_CTX *ctx, const char *t[],
PROPERTY_DEFINITION *res, const int create)
{
char v[1000];
return !err;
}
-static int parse_value(OPENSSL_CTX *ctx, const char *t[],
+static int parse_value(OSSL_LIB_CTX *ctx, const char *t[],
PROPERTY_DEFINITION *res, int create)
{
const char *s = *t;
return r;
}
-OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn)
+OSSL_PROPERTY_LIST *ossl_parse_property(OSSL_LIB_CTX *ctx, const char *defn)
{
PROPERTY_DEFINITION *prop = NULL;
OSSL_PROPERTY_LIST *res = NULL;
return res;
}
-OSSL_PROPERTY_LIST *ossl_parse_query(OPENSSL_CTX *ctx, const char *s)
+OSSL_PROPERTY_LIST *ossl_parse_query(OSSL_LIB_CTX *ctx, const char *s)
{
STACK_OF(PROPERTY_DEFINITION) *sk;
OSSL_PROPERTY_LIST *res = NULL;
return query->has_optional ? 1 : 0;
}
-int ossl_property_is_enabled(OPENSSL_CTX *ctx, const char *property_name,
+int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name,
const OSSL_PROPERTY_LIST *prop_list)
{
int i;
return r;
}
-int ossl_property_parse_init(OPENSSL_CTX *ctx)
+int ossl_property_parse_init(OSSL_LIB_CTX *ctx)
{
static const char *const predefined_names[] = {
"provider", /* Name of provider (default, legacy, fips) */
OPENSSL_free(propdata);
}
-static void *property_string_data_new(OPENSSL_CTX *ctx) {
+static void *property_string_data_new(OSSL_LIB_CTX *ctx) {
PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
if (propdata == NULL)
return NULL;
}
-static const OPENSSL_CTX_METHOD property_string_data_method = {
+static const OSSL_LIB_CTX_METHOD property_string_data_method = {
property_string_data_new,
property_string_data_free,
};
return ps != NULL ? ps->idx : 0;
}
-OSSL_PROPERTY_IDX ossl_property_name(OPENSSL_CTX *ctx, const char *s,
+OSSL_PROPERTY_IDX ossl_property_name(OSSL_LIB_CTX *ctx, const char *s,
int create)
{
PROPERTY_STRING_DATA *propdata
- = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_STRING_INDEX,
- &property_string_data_method);
+ = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX,
+ &property_string_data_method);
if (propdata == NULL)
return 0;
s);
}
-OSSL_PROPERTY_IDX ossl_property_value(OPENSSL_CTX *ctx, const char *s,
+OSSL_PROPERTY_IDX ossl_property_value(OSSL_LIB_CTX *ctx, const char *s,
int create)
{
PROPERTY_STRING_DATA *propdata
- = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_STRING_INDEX,
- &property_string_data_method);
+ = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX,
+ &property_string_data_method);
if (propdata == NULL)
return 0;
#include <openssl/core_names.h>
#include "internal/provider.h"
-OSSL_PROVIDER *OSSL_PROVIDER_try_load(OPENSSL_CTX *libctx, const char *name)
+OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *libctx, const char *name)
{
OSSL_PROVIDER *prov = NULL;
return prov;
}
-OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name)
+OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *libctx, const char *name)
{
/* Any attempt to load a provider disables auto-loading of defaults */
if (ossl_provider_disable_fallback_loading(libctx))
return 1;
}
-int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name)
+int OSSL_PROVIDER_available(OSSL_LIB_CTX *libctx, const char *name)
{
OSSL_PROVIDER *prov = NULL;
int available = 0;
return ossl_provider_get_capabilities(prov, capability, cb, arg);
}
-int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *libctx, const char *name,
+int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *libctx, const char *name,
OSSL_provider_init_fn *init_fn)
{
OSSL_PROVIDER *prov = NULL;
return ossl_provider_name(prov);
}
-int OSSL_PROVIDER_do_all(OPENSSL_CTX *ctx,
+int OSSL_PROVIDER_do_all(OSSL_LIB_CTX *ctx,
int (*cb)(OSSL_PROVIDER *provider,
void *cbdata),
void *cbdata)
return ok;
}
-static int provider_conf_load(OPENSSL_CTX *libctx, const char *name,
+static int provider_conf_load(OSSL_LIB_CTX *libctx, const char *name,
const char *value, const CONF *cnf)
{
int i;
DSO *module;
OSSL_provider_init_fn *init_function;
STACK_OF(INFOPAIR) *parameters;
- OPENSSL_CTX *libctx; /* The library context this instance is in */
+ OSSL_LIB_CTX *libctx; /* The library context this instance is in */
struct provider_store_st *store; /* The store this instance belongs to */
#ifndef FIPS_MODULE
/*
OPENSSL_free(store);
}
-static void *provider_store_new(OPENSSL_CTX *ctx)
+static void *provider_store_new(OSSL_LIB_CTX *ctx)
{
struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
const struct predefined_providers_st *p = NULL;
return store;
}
-static const OPENSSL_CTX_METHOD provider_store_method = {
+static const OSSL_LIB_CTX_METHOD provider_store_method = {
provider_store_new,
provider_store_free,
};
-static struct provider_store_st *get_provider_store(OPENSSL_CTX *libctx)
+static struct provider_store_st *get_provider_store(OSSL_LIB_CTX *libctx)
{
struct provider_store_st *store = NULL;
- store = openssl_ctx_get_data(libctx, OPENSSL_CTX_PROVIDER_STORE_INDEX,
- &provider_store_method);
+ store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX,
+ &provider_store_method);
if (store == NULL)
CRYPTOerr(CRYPTO_F_GET_PROVIDER_STORE, ERR_R_INTERNAL_ERROR);
return store;
}
-int ossl_provider_disable_fallback_loading(OPENSSL_CTX *libctx)
+int ossl_provider_disable_fallback_loading(OSSL_LIB_CTX *libctx)
{
struct provider_store_st *store;
return 0;
}
-OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name,
+OSSL_PROVIDER *ossl_provider_find(OSSL_LIB_CTX *libctx, const char *name,
int noconfig)
{
struct provider_store_st *store = NULL;
return ref;
}
-OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
+OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name,
OSSL_provider_init_fn *init_function,
int noconfig)
{
*/
static const OSSL_DISPATCH *core_dispatch; /* Define further down */
-int OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *libctx, const char *path)
+int OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *libctx,
+ const char *path)
{
struct provider_store_st *store;
char *p = NULL;
}
}
-int ossl_provider_forall_loaded(OPENSSL_CTX *ctx,
+int ossl_provider_forall_loaded(OSSL_LIB_CTX *ctx,
int (*cb)(OSSL_PROVIDER *provider,
void *cbdata),
void *cbdata)
return NULL;
}
-OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov)
+OSSL_LIB_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov)
{
/* TODO(3.0) just: return prov->libctx; */
return prov != NULL ? prov->libctx : NULL;
* the default method, then just call RAND_bytes(). Otherwise make
* sure we're instantiated and use the private DRBG.
*/
-int RAND_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num)
+int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num)
{
EVP_RAND_CTX *rand;
const RAND_METHOD *meth = RAND_get_rand_method();
return RAND_priv_bytes_ex(NULL, buf, num);
}
-int RAND_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num)
+int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num)
{
EVP_RAND_CTX *rand;
const RAND_METHOD *meth = RAND_get_rand_method();
} RAND_GLOBAL;
/*
- * Initialize the OPENSSL_CTX global DRBGs on first use.
+ * Initialize the OSSL_LIB_CTX global DRBGs on first use.
* Returns the allocated global data on success or NULL on failure.
*/
-static void *rand_ossl_ctx_new(OPENSSL_CTX *libctx)
+static void *rand_ossl_ctx_new(OSSL_LIB_CTX *libctx)
{
RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
OPENSSL_free(dgbl);
}
-static const OPENSSL_CTX_METHOD rand_drbg_ossl_ctx_method = {
+static const OSSL_LIB_CTX_METHOD rand_drbg_ossl_ctx_method = {
rand_ossl_ctx_new,
rand_ossl_ctx_free,
};
-static RAND_GLOBAL *rand_get_global(OPENSSL_CTX *libctx)
+static RAND_GLOBAL *rand_get_global(OSSL_LIB_CTX *libctx)
{
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_DRBG_INDEX,
- &rand_drbg_ossl_ctx_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX,
+ &rand_drbg_ossl_ctx_method);
}
static void rand_delete_thread_state(void *arg)
{
- OPENSSL_CTX *ctx = arg;
+ OSSL_LIB_CTX *ctx = arg;
RAND_GLOBAL *dgbl = rand_get_global(ctx);
EVP_RAND_CTX *rand;
EVP_RAND_CTX_free(rand);
}
-static EVP_RAND_CTX *rand_new_drbg(OPENSSL_CTX *libctx, EVP_RAND_CTX *parent,
+static EVP_RAND_CTX *rand_new_drbg(OSSL_LIB_CTX *libctx, EVP_RAND_CTX *parent,
unsigned int reseed_interval,
time_t reseed_time_interval)
{
* Returns pointer to its EVP_RAND_CTX on success, NULL on failure.
*
*/
-EVP_RAND_CTX *RAND_get0_primary(OPENSSL_CTX *ctx)
+EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx)
{
RAND_GLOBAL *dgbl = rand_get_global(ctx);
* Get the public random generator.
* Returns pointer to its EVP_RAND_CTX on success, NULL on failure.
*/
-EVP_RAND_CTX *RAND_get0_public(OPENSSL_CTX *ctx)
+EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx)
{
RAND_GLOBAL *dgbl = rand_get_global(ctx);
EVP_RAND_CTX *rand, *primary;
if (primary == NULL)
return NULL;
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
/*
* If the private is also NULL then this is the first time we've
* used this thread.
* Get the private random generator.
* Returns pointer to its EVP_RAND_CTX on success, NULL on failure.
*/
-EVP_RAND_CTX *RAND_get0_private(OPENSSL_CTX *ctx)
+EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx)
{
RAND_GLOBAL *dgbl = rand_get_global(ctx);
EVP_RAND_CTX *rand, *primary;
if (primary == NULL)
return NULL;
- ctx = openssl_ctx_get_concrete(ctx);
+ ctx = ossl_lib_ctx_get_concrete(ctx);
/*
* If the public is also NULL then this is the first time we've
* used this thread.
*/
static int rsa_int_export_to(const EVP_PKEY *from, int rsa_type,
void *to_keydata, EVP_KEYMGMT *to_keymgmt,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
RSA *rsa = from->pkey.rsa;
OSSL_PARAM_BLD *tmpl = OSSL_PARAM_BLD_new();
}
static int rsa_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq)
{
return rsa_int_export_to(from, RSA_FLAG_TYPE_RSA, to_keydata,
}
static int rsa_pss_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq)
{
return rsa_int_export_to(from, RSA_FLAG_TYPE_RSASSAPSS, to_keydata,
int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
const OSSL_PARAM params[],
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
const OSSL_PARAM *param_md, *param_mgf, *param_mgf1md, *param_saltlen;
const OSSL_PARAM *param_propq;
#include "rsa_local.h"
static int rsa_keygen_pairwise_test(RSA *rsa, OSSL_CALLBACK *cb, void *cbarg);
-static int rsa_keygen(OPENSSL_CTX *libctx, RSA *rsa, int bits, int primes,
+static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
BIGNUM *e_value, BN_GENCB *cb, int pairwise_test);
/*
}
#endif /* FIPS_MODULE */
-static int rsa_keygen(OPENSSL_CTX *libctx, RSA *rsa, int bits, int primes,
+static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
BIGNUM *e_value, BN_GENCB *cb, int pairwise_test)
{
int ok = 0;
#include "crypto/security_bits.h"
#include "rsa_local.h"
-static RSA *rsa_new_intern(ENGINE *engine, OPENSSL_CTX *libctx);
+static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
#ifndef FIPS_MODULE
RSA *RSA_new(void)
}
#endif
-RSA *ossl_rsa_new_with_ctx(OPENSSL_CTX *libctx)
+RSA *ossl_rsa_new_with_ctx(OSSL_LIB_CTX *libctx)
{
return rsa_new_intern(NULL, libctx);
}
-static RSA *rsa_new_intern(ENGINE *engine, OPENSSL_CTX *libctx)
+static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
{
RSA *ret = OPENSSL_zalloc(sizeof(*ret));
return i > 1 ? 1 : 0;
}
-OPENSSL_CTX *ossl_rsa_get0_libctx(RSA *r)
+OSSL_LIB_CTX *ossl_rsa_get0_libctx(RSA *r)
{
return r->libctx;
}
*/
int dummy_zero;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
int32_t version;
const RSA_METHOD *meth;
/* functional reference if 'meth' is ENGINE-provided */
int nbits, const BIGNUM *e, BN_CTX *ctx,
BN_GENCB *cb);
-int ossl_rsa_padding_add_SSLv23_ex(OPENSSL_CTX *libctx, unsigned char *to,
+int ossl_rsa_padding_add_SSLv23_ex(OSSL_LIB_CTX *libctx, unsigned char *to,
int tlen, const unsigned char *from,
int flen);
-int ossl_rsa_padding_add_PKCS1_type_2_ex(OPENSSL_CTX *libctx, unsigned char *to,
+int ossl_rsa_padding_add_PKCS1_type_2_ex(OSSL_LIB_CTX *libctx, unsigned char *to,
int tlen, const unsigned char *from,
int flen);
* Step numbers are included here but not in the constant time inverse below
* to avoid complicating an already difficult enough function.
*/
-int ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(OPENSSL_CTX *libctx,
+int ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(OSSL_LIB_CTX *libctx,
unsigned char *to, int tlen,
const unsigned char *from, int flen,
const unsigned char *param,
return j;
}
-int ossl_rsa_padding_add_PKCS1_type_2_ex(OPENSSL_CTX *libctx, unsigned char *to,
+int ossl_rsa_padding_add_PKCS1_type_2_ex(OSSL_LIB_CTX *libctx, unsigned char *to,
int tlen, const unsigned char *from,
int flen)
{
* decrypted data will be randomly generated (as per
* https://tools.ietf.org/html/rfc5246#section-7.4.7.1).
*/
-int ossl_rsa_padding_check_PKCS1_type_2_TLS(OPENSSL_CTX *libctx,
+int ossl_rsa_padding_check_PKCS1_type_2_TLS(OSSL_LIB_CTX *libctx,
unsigned char *to, size_t tlen,
const unsigned char *from,
size_t flen, int client_version,
#include "internal/constant_time.h"
#include "rsa_local.h"
-int ossl_rsa_padding_add_SSLv23_ex(OPENSSL_CTX *libctx, unsigned char *to,
+int ossl_rsa_padding_add_SSLv23_ex(OSSL_LIB_CTX *libctx, unsigned char *to,
int tlen, const unsigned char *from,
int flen)
{
};
#ifndef FIPS_MODULE
-static void *self_test_set_callback_new(OPENSSL_CTX *ctx)
+static void *self_test_set_callback_new(OSSL_LIB_CTX *ctx)
{
SELF_TEST_CB *stcb;
OPENSSL_free(stcb);
}
-static const OPENSSL_CTX_METHOD self_test_set_callback_method = {
+static const OSSL_LIB_CTX_METHOD self_test_set_callback_method = {
self_test_set_callback_new,
self_test_set_callback_free,
};
-static SELF_TEST_CB *get_self_test_callback(OPENSSL_CTX *libctx)
+static SELF_TEST_CB *get_self_test_callback(OSSL_LIB_CTX *libctx)
{
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_SELF_TEST_CB_INDEX,
- &self_test_set_callback_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_SELF_TEST_CB_INDEX,
+ &self_test_set_callback_method);
}
-void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK *cb,
+void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK *cb,
void *cbarg)
{
SELF_TEST_CB *stcb = get_self_test_callback(libctx);
}
}
-void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK **cb,
+void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK **cb,
void **cbarg)
{
SELF_TEST_CB *stcb = get_self_test_callback(libctx);
size_t field_size;
const int C3_size = EVP_MD_size(digest);
EVP_MD *fetched_digest = NULL;
- OPENSSL_CTX *libctx = ec_key_get_libctx(key);
+ OSSL_LIB_CTX *libctx = ec_key_get_libctx(key);
const char *propq = ec_key_get0_propq(key);
/* NULL these before any "goto done" */
const uint8_t *C3 = NULL;
int msg_len = 0;
EVP_MD_CTX *hash = NULL;
- OPENSSL_CTX *libctx = ec_key_get_libctx(key);
+ OSSL_LIB_CTX *libctx = ec_key_get_libctx(key);
const char *propq = ec_key_get0_propq(key);
if (field_size == 0 || hash_size <= 0)
uint8_t *z = NULL;
BIGNUM *e = NULL;
EVP_MD *fetched_digest = NULL;
- OPENSSL_CTX *libctx = ec_key_get_libctx(key);
+ OSSL_LIB_CTX *libctx = ec_key_get_libctx(key);
const char *propq = ec_key_get0_propq(key);
if (md_size < 0) {
BIGNUM *s = NULL;
BIGNUM *x1 = NULL;
BIGNUM *tmp = NULL;
- OPENSSL_CTX *libctx = ec_key_get_libctx(key);
+ OSSL_LIB_CTX *libctx = ec_key_get_libctx(key);
kG = EC_POINT_new(group);
ctx = BN_CTX_new_ex(libctx);
BIGNUM *x1 = NULL;
const BIGNUM *r = NULL;
const BIGNUM *s = NULL;
- OPENSSL_CTX *libctx = ec_key_get_libctx(key);
+ OSSL_LIB_CTX *libctx = ec_key_get_libctx(key);
ctx = BN_CTX_new_ex(libctx);
pt = EC_POINT_new(group);
/* calculate = SHA1(PAD(x) || PAD(y)) */
static BIGNUM *srp_Calc_xy(const BIGNUM *x, const BIGNUM *y, const BIGNUM *N,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
unsigned char digest[SHA_DIGEST_LENGTH];
unsigned char *tmp = NULL;
return res;
}
-static BIGNUM *srp_Calc_k(const BIGNUM *N, const BIGNUM *g, OPENSSL_CTX *libctx,
+static BIGNUM *srp_Calc_k(const BIGNUM *N, const BIGNUM *g,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
/* k = SHA1(N | PAD(g)) -- tls-srp RFC 5054 */
}
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
/* u = SHA1(PAD(A) || PAD(B) ) -- tls-srp RFC 5054 */
return srp_Calc_xy(A, B, N, libctx, propq);
}
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
- const BIGNUM *v, OPENSSL_CTX *libctx, const char *propq)
+ const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq)
{
BIGNUM *kv = NULL, *gb = NULL;
BIGNUM *B = NULL, *k = NULL;
}
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
unsigned char dig[SHA_DIGEST_LENGTH];
EVP_MD_CTX *ctxt;
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
BIGNUM *tmp = NULL, *tmp2 = NULL, *tmp3 = NULL, *k = NULL, *K = NULL;
BN_CTX *bn_ctx;
*/
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int len;
char *result = NULL, *vf = NULL;
*/
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N,
- const BIGNUM *g, OPENSSL_CTX *libctx,
+ const BIGNUM *g, OSSL_LIB_CTX *libctx,
const char *propq)
{
int result = 0;
static int ossl_store_close_it(OSSL_STORE_CTX *ctx);
OSSL_STORE_CTX *
-OSSL_STORE_open_ex(const char *uri, OPENSSL_CTX *libctx, const char *propq,
+OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data)
}
OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bp, const char *scheme,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data)
* Provider stuff
* -------------------
*/
-OSSL_STORE_LOADER *ossl_store_loader_fetch(OPENSSL_CTX *libctx,
+OSSL_STORE_LOADER *ossl_store_loader_fetch(OSSL_LIB_CTX *libctx,
const char *scheme,
const char *properties);
-OSSL_STORE_LOADER *ossl_store_loader_fetch_by_number(OPENSSL_CTX *libctx,
+OSSL_STORE_LOADER *ossl_store_loader_fetch_by_number(OSSL_LIB_CTX *libctx,
int scheme_id,
const char *properties);
ossl_method_store_free(vstore);
}
-static void *loader_store_new(OPENSSL_CTX *ctx)
+static void *loader_store_new(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
-static const OPENSSL_CTX_METHOD loader_store_method = {
+static const OSSL_LIB_CTX_METHOD loader_store_method = {
loader_store_new,
loader_store_free,
};
/* Data to be passed through ossl_method_construct() */
struct loader_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
OSSL_METHOD_CONSTRUCT_METHOD *mcm;
int scheme_id; /* For get_loader_from_store() */
const char *scheme; /* For get_loader_from_store() */
*/
/* Temporary loader method store, constructor and destructor */
-static void *alloc_tmp_loader_store(OPENSSL_CTX *ctx)
+static void *alloc_tmp_loader_store(OSSL_LIB_CTX *ctx)
{
return ossl_method_store_new(ctx);
}
}
/* Get the permanent loader store */
-static OSSL_METHOD_STORE *get_loader_store(OPENSSL_CTX *libctx)
+static OSSL_METHOD_STORE *get_loader_store(OSSL_LIB_CTX *libctx)
{
- return openssl_ctx_get_data(libctx, OPENSSL_CTX_STORE_LOADER_STORE_INDEX,
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX,
&loader_store_method);
}
/* Get loader methods from a store, or put one in */
-static void *get_loader_from_store(OPENSSL_CTX *libctx, void *store,
+static void *get_loader_from_store(OSSL_LIB_CTX *libctx, void *store,
void *data)
{
struct loader_data_st *methdata = data;
return method;
}
-static int put_loader_in_store(OPENSSL_CTX *libctx, void *store,
+static int put_loader_in_store(OSSL_LIB_CTX *libctx, void *store,
void *method, const OSSL_PROVIDER *prov,
int operation_id, const char *scheme,
const char *propdef, void *unused)
* namemap entry, this is it. Should the scheme already exist there, we
* know that ossl_namemap_add() will return its corresponding number.
*/
- OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *scheme = algodef->algorithm_names;
int id = ossl_namemap_add_name(namemap, 0, scheme);
}
/* Fetching support. Can fetch by numeric identity or by scheme */
-static OSSL_STORE_LOADER *inner_loader_fetch(OPENSSL_CTX *libctx,
+static OSSL_STORE_LOADER *inner_loader_fetch(OSSL_LIB_CTX *libctx,
int id, const char *scheme,
const char *properties)
{
}
OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(const char *scheme,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *properties)
{
return inner_loader_fetch(libctx, 0, scheme, properties);
}
-OSSL_STORE_LOADER *ossl_store_loader_fetch_by_number(OPENSSL_CTX *libctx,
+OSSL_STORE_LOADER *ossl_store_loader_fetch_by_number(OSSL_LIB_CTX *libctx,
int scheme_id,
const char *properties)
{
int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader, const char *name)
{
if (loader->prov != NULL) {
- OPENSSL_CTX *libctx = ossl_provider_library_context(loader->prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(loader->prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
return ossl_namemap_name2num(namemap, name) == loader->scheme_id;
int no_store, void *vdata)
{
struct loader_do_all_data_st *data = vdata;
- OPENSSL_CTX *libctx = ossl_provider_library_context(provider);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
const char *name = algodef->algorithm_names;
int id = ossl_namemap_add_name(namemap, 0, name);
}
}
-void OSSL_STORE_LOADER_do_all_provided(OPENSSL_CTX *libctx,
+void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_STORE_LOADER *loader,
void *arg),
void *arg)
return;
if (loader->prov != NULL) {
- OPENSSL_CTX *libctx = ossl_provider_library_context(loader->prov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(loader->prov);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
ossl_namemap_doall_names(namemap, loader->scheme_id, fn, data);
static int try_name(struct extracted_param_data_st *, OSSL_STORE_INFO **);
static int try_key(struct extracted_param_data_st *, OSSL_STORE_INFO **,
OSSL_STORE_CTX *, const OSSL_PROVIDER *,
- OPENSSL_CTX *, const char *);
+ OSSL_LIB_CTX *, const char *);
static int try_cert(struct extracted_param_data_st *, OSSL_STORE_INFO **,
- OPENSSL_CTX *, const char *);
+ OSSL_LIB_CTX *, const char *);
static int try_crl(struct extracted_param_data_st *, OSSL_STORE_INFO **,
- OPENSSL_CTX *, const char *);
+ OSSL_LIB_CTX *, const char *);
static int try_pkcs12(struct extracted_param_data_st *, OSSL_STORE_INFO **,
- OSSL_STORE_CTX *, OPENSSL_CTX *, const char *);
+ OSSL_STORE_CTX *, OSSL_LIB_CTX *, const char *);
#define SET_ERR_MARK() ERR_set_mark()
#define CLEAR_ERR_MARK() \
OSSL_STORE_CTX *ctx = cbdata->ctx;
const OSSL_PROVIDER *provider =
OSSL_STORE_LOADER_provider(ctx->fetched_loader);
- OPENSSL_CTX *libctx = ossl_provider_library_context(provider);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider);
const char *propq = ctx->properties;
const OSSL_PARAM *p;
struct extracted_param_data_st helper_data;
static EVP_PKEY *try_key_ref(struct extracted_param_data_st *data,
OSSL_STORE_CTX *ctx,
const OSSL_PROVIDER *provider,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_PKEY *pk = NULL;
EVP_KEYMGMT *keymgmt = NULL;
static EVP_PKEY *try_key_value(struct extracted_param_data_st *data,
OSSL_STORE_CTX *ctx,
OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_PKEY *pk = NULL;
OSSL_DECODER_CTX *decoderctx = NULL;
store_info_new_fn **store_info_new,
OSSL_STORE_CTX *ctx,
OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
EVP_PKEY *pk = NULL;
const unsigned char *der = data->octet_data, *derp;
static int try_key(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
OSSL_STORE_CTX *ctx, const OSSL_PROVIDER *provider,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
store_info_new_fn *store_info_new = NULL;
}
static int try_cert(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
if (data->object_type == OSSL_OBJECT_UNKNOWN
|| data->object_type == OSSL_OBJECT_CERT) {
}
static int try_crl(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
if (data->object_type == OSSL_OBJECT_UNKNOWN
|| data->object_type == OSSL_OBJECT_CRL) {
static int try_pkcs12(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
OSSL_STORE_CTX *ctx,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
/* There is no specific object type for PKCS12 */
if (data->object_type == OSSL_OBJECT_UNKNOWN) {
const X509_NAME *name, X509_OBJECT *ret);
static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
static X509_LOOKUP_METHOD x509_dir_lookup = {
"Load certs from files in a directory",
new_dir, /* new_item */
static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
BY_DIR *ctx;
union {
static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc,
- long argl, char **ret, OPENSSL_CTX *libctx,
+ long argl, char **ret, OSSL_LIB_CTX *libctx,
const char *propq);
}
static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argp,
- long argl, char **ret, OPENSSL_CTX *libctx,
+ long argl, char **ret, OSSL_LIB_CTX *libctx,
const char *propq)
{
int ok = 0;
}
int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int ret = 0;
BIO *in = NULL;
}
int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
STACK_OF(X509_INFO) *inf;
X509_INFO *itmp;
/* Generic object loader, given expected type and criterion */
static int cache_objects(X509_LOOKUP *lctx, const char *uri,
const OSSL_STORE_SEARCH *criterion,
- int depth, OPENSSL_CTX *libctx, const char *propq)
+ int depth, OSSL_LIB_CTX *libctx, const char *propq)
{
int ok = 0;
OSSL_STORE_CTX *ctx = NULL;
}
static int by_store_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argp,
- long argl, char **retp, OPENSSL_CTX *libctx,
+ long argl, char **retp, OSSL_LIB_CTX *libctx,
const char *propq)
{
switch (cmd) {
static int by_store(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const OSSL_STORE_SEARCH *criterion, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
STACK_OF(OPENSSL_STRING) *uris = X509_LOOKUP_get_method_data(ctx);
int i;
static int by_store_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
OSSL_STORE_SEARCH *criterion =
OSSL_STORE_SEARCH_by_name((X509_NAME *)name); /* won't modify it */
#include <openssl/crypto.h>
#include <openssl/x509.h>
-int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OPENSSL_CTX *libctx,
+int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
const char *propq)
{
X509_LOOKUP *lookup;
}
int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
X509_LOOKUP *lookup;
}
int X509_STORE_load_store_ex(X509_STORE *ctx, const char *uri,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
X509_LOOKUP *lookup;
}
int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
- const char *path, OPENSSL_CTX *libctx,
+ const char *path, OSSL_LIB_CTX *libctx,
const char *propq)
{
if (file == NULL && path == NULL)
const char *str, int len, X509_OBJECT *ret);
int (*get_by_subject_ex) (X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int (*ctrl_ex) (X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
- char **ret, OPENSSL_CTX *libctx, const char *propq);
+ char **ret, OSSL_LIB_CTX *libctx, const char *propq);
};
/* This is the functions plus an instance of the local variables. */
}
int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
- char **ret, OPENSSL_CTX *libctx, const char *propq)
+ char **ret, OSSL_LIB_CTX *libctx, const char *propq)
{
if (ctx->method == NULL)
return -1;
int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
if (ctx->skip
|| ctx->method == NULL
return 1;
}
-X509_STORE_CTX *X509_STORE_CTX_new_ex(OPENSSL_CTX *libctx, const char *propq)
+X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
{
X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
a->distinguishing_id, r, a->libctx, a->propq);
}
-int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OPENSSL_CTX *libctx,
+int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx,
const char *propq)
{
return ASN1_item_verify_ex(ASN1_ITEM_rptr(X509_REQ_INFO), &a->sig_alg,
return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, fp, a);
}
-EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OPENSSL_CTX *libctx,
+EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
const char *propq)
{
BIO *b;
return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, bp, a);
}
-EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OPENSSL_CTX *libctx,
+EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
const char *propq)
{
BUF_MEM *b = NULL;
return crl->meth_data;
}
-int x509_crl_set0_libctx(X509_CRL *x, OPENSSL_CTX *libctx, const char *propq)
+int x509_crl_set0_libctx(X509_CRL *x, OSSL_LIB_CTX *libctx, const char *propq)
{
if (x != NULL) {
x->libctx = libctx;
EVP_PKEY *pkey;
/* extra data for the callback, used by d2i_PUBKEY_ex */
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propq;
};
}
} else if (evp_pkey_is_provided(pkey)) {
const OSSL_PROVIDER *pkprov = EVP_KEYMGMT_provider(pkey->keymgmt);
- OPENSSL_CTX *libctx = ossl_provider_library_context(pkprov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(pkprov);
unsigned char *der = NULL;
size_t derlen = 0;
int selection = (OSSL_KEYMGMT_SELECT_PUBLIC_KEY
*/
EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
X509_PUBKEY *xpk, *xpk2 = NULL, **pxpk = NULL;
EVP_PKEY *pktmp = NULL;
X509_PUBKEY_free(xpk);
} else if (a->keymgmt != NULL) {
const OSSL_PROVIDER *pkprov = EVP_KEYMGMT_provider(a->keymgmt);
- OPENSSL_CTX *libctx = ossl_provider_library_context(pkprov);
+ OSSL_LIB_CTX *libctx = ossl_provider_library_context(pkprov);
int selection = (OSSL_KEYMGMT_SELECT_PUBLIC_KEY
| OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS);
OSSL_ENCODER_CTX *ctx =
return EVP_PKEY_eq(pA, pB);
}
-int X509_PUBKEY_get0_libctx(OPENSSL_CTX **plibctx, const char **ppropq,
+int X509_PUBKEY_get0_libctx(OSSL_LIB_CTX **plibctx, const char **ppropq,
const X509_PUBKEY *key)
{
if (plibctx)
* asn1 object and it needs a libctx to operate.
* Use X509_new_ex() instead if possible.
*/
-int x509_set0_libctx(X509 *x, OPENSSL_CTX *libctx, const char *propq)
+int x509_set0_libctx(X509 *x, OSSL_LIB_CTX *libctx, const char *propq)
{
if (x != NULL) {
x->libctx = libctx;
return 1;
}
-X509 *X509_new_ex(OPENSSL_CTX *libctx, const char *propq)
+X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
{
X509 *cert = NULL;
typedef struct ossl_method_store_st OSSL_METHOD_STORE;
- OSSL_METHOD_STORE *ossl_method_store_new(OPENSSL_CTX *ctx);
+ OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx);
void ossl_method_store_free(OSSL_METHOD_STORE *store);
- int ossl_method_store_init(OPENSSL_CTX *ctx);
- void ossl_method_store_cleanup(OPENSSL_CTX *ctx);
+ int ossl_method_store_init(OSSL_LIB_CTX *ctx);
+ void ossl_method_store_cleanup(OSSL_LIB_CTX *ctx);
int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
int nid, const char *properties, void *method,
int (*method_up_ref)(void *),
/* Only for EVP source */
#include "evp_local.h"
- void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
+ void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
const char *name, const char *properties,
void *(*new_method)(int name_id,
const OSSL_DISPATCH *fns,
int (*up_ref_method)(void *),
void (*free_method)(void *));
- void *evp_generic_fetch_by_number(OPENSSL_CTX *ctx, int operation_id,
+ void *evp_generic_fetch_by_number(OSSL_LIB_CTX *ctx, int operation_id,
int name_id, const char *properties,
void *(*new_method)(int name_id,
const OSSL_DISPATCH *fns,
EVP_FOO_meth_free(vfoo);
}
- EVP_FOO *EVP_FOO_fetch(OPENSSL_CTX *ctx,
+ EVP_FOO *EVP_FOO_fetch(OSSL_LIB_CTX *ctx,
const char *name,
const char *properties)
{
/* Only for EVP source */
#include "evp_local.h"
- void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
+ void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery);
int evp_pkey_copy_downgraded(EVP_PKEY **dest, const EVP_PKEY *src);
=head1 SEE ALSO
-L<OPENSSL_CTX(3)>, L<EVP_KEYMGMT(3)>
+L<OSSL_LIB_CTX(3)>, L<EVP_KEYMGMT(3)>
=head1 HISTORY
=head1 SYNOPSIS
- void ossl_algorithm_do_all(OPENSSL_CTX *libctx, int operation_id,
+ void ossl_algorithm_do_all(OSSL_LIB_CTX *libctx, int operation_id,
OSSL_PROVIDER *provider,
void (*fn)(OSSL_PROVIDER *provider,
const OSSL_ALGORITHM *algo,
#include "apps/cmp_mock_srv.h"
- OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OPENSSL_CTX *libctx, const char *propq);
+ OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq);
void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx);
int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert);
#include "cmp_local.h"
STACK_OF(X509)
- *ossl_cmp_build_cert_chain(OPENSSL_CTX *libctx, const char *propq,
+ *ossl_cmp_build_cert_chain(OSSL_LIB_CTX *libctx, const char *propq,
X509_STORE *store,
STACK_OF(X509) *certs, X509 *cert);
ASN1_BIT_STRING *ossl_cmp_calc_protection(const OSSL_CMP_CTX *ctx,
=head1 NAME
-openssl_ctx_get_data, openssl_ctx_run_once, openssl_ctx_onfree
-- internal OPENSSL_CTX routines
+ossl_lib_ctx_get_data, ossl_lib_ctx_run_once, ossl_lib_ctx_onfree
+- internal OSSL_LIB_CTX routines
=head1 SYNOPSIS
#include <openssl/types.h>
#include "internal/cryptlib.h"
- typedef struct openssl_ctx_method {
- void *(*new_func)(OPENSSL_CTX *ctx);
+ typedef struct ossl_lib_ctx_method {
+ void *(*new_func)(OSSL_LIB_CTX *ctx);
void (*free_func)(void *);
- } OPENSSL_CTX_METHOD;
+ } OSSL_LIB_CTX_METHOD;
- void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index,
- const OPENSSL_CTX_METHOD *meth);
+ void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *ctx, int index,
+ const OSSL_LIB_CTX_METHOD *meth);
- int openssl_ctx_run_once(OPENSSL_CTX *ctx, unsigned int idx,
- openssl_ctx_run_once_fn run_once_fn);
- int openssl_ctx_onfree(OPENSSL_CTX *ctx, openssl_ctx_onfree_fn onfreefn);
+ int ossl_lib_ctx_run_once(OSSL_LIB_CTX *ctx, unsigned int idx,
+ ossl_lib_ctx_run_once_fn run_once_fn);
+ int ossl_lib_ctx_onfree(OSSL_LIB_CTX *ctx, ossl_lib_ctx_onfree_fn onfreefn);
=head1 DESCRIPTION
-Internally, the OpenSSL library context B<OPENSSL_CTX> is implemented
+Internally, the OpenSSL library context B<OSSL_LIB_CTX> is implemented
as a B<CRYPTO_EX_DATA>, which allows data from diverse parts of the
library to be added and removed dynamically.
Each such data item must have a corresponding CRYPTO_EX_DATA index
indexes internally to the implementation.
See the example further down to see how that's done.
-openssl_ctx_get_data() is used to retrieve a pointer to the data in
+ossl_lib_ctx_get_data() is used to retrieve a pointer to the data in
the library context I<ctx> associated with the given I<index>. An
-OPENSSL_CTX_METHOD must be defined and given in the I<meth> parameter. The index
+OSSL_LIB_CTX_METHOD must be defined and given in the I<meth> parameter. The index
for it should be defined in cryptlib.h. The functions through the method are
used to create or free items that are stored at that index whenever a library
context is created or freed, meaning that the code that use a data item of that
Deallocation of an index happens automatically when the library
context is freed.
-openssl_ctx_run_once is used to run some initialisation routine I<run_once_fn>
+ossl_lib_ctx_run_once is used to run some initialisation routine I<run_once_fn>
exactly once per library context I<ctx> object. Each initialisation routine
should be allocate a unique run once index in cryptlib.h.
Any resources allocated via a run once initialisation routine can be cleaned up
-using openssl_ctx_onfree. This associates an "on free" routine I<onfreefn> with
+using ossl_lib_ctx_onfree. This associates an "on free" routine I<onfreefn> with
the library context I<ctx>. When I<ctx> is freed all associated "on free"
routines are called.
=head1 RETURN VALUES
-openssl_ctx_get_data() returns a pointer on success, or NULL on
+ossl_lib_ctx_get_data() returns a pointer on success, or NULL on
failure.
=head1 EXAMPLES
void *data;
} FOO;
- static void *foo_new(OPENSSL_CTX *ctx)
+ static void *foo_new(OSSL_LIB_CTX *ctx)
{
FOO *ptr = OPENSSL_zalloc(sizeof(*foo));
if (ptr != NULL)
/*
* Include a reference to this in the methods table in context.c
- * OPENSSL_CTX_FOO_INDEX should be added to internal/cryptlib.h
+ * OSSL_LIB_CTX_FOO_INDEX should be added to internal/cryptlib.h
*/
- const OPENSSL_CTX_METHOD foo_method = {
+ const OSSL_LIB_CTX_METHOD foo_method = {
foo_new,
foo_free
};
/*
* ctx is received from a caller,
*/
- FOO *data = openssl_ctx_get_data(ctx, OPENSSL_CTX_FOO_INDEX, &foo_method);
+ FOO *data = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_FOO_INDEX, &foo_method);
=head2 Run Once
- void foo_cleanup(OPENSSL_CTX *ctx)
+ void foo_cleanup(OSSL_LIB_CTX *ctx)
{
/* Free foo resources associated with ctx */
}
- static openssl_ctx_run_once_fn do_foo_init;
- static int do_foo_init(OPENSSL_CTX *ctx)
+ static ossl_lib_ctx_run_once_fn do_foo_init;
+ static int do_foo_init(OSSL_LIB_CTX *ctx)
{
/* Allocate and initialise some foo resources and associated with ctx */
- return openssl_ctx_onfree(ctx, &foo_cleanup)
+ return ossl_lib_ctx_onfree(ctx, &foo_cleanup)
}
- int foo_some_function(OPENSSL_CTX *ctx)
+ int foo_some_function(OSSL_LIB_CTX *ctx)
{
- if (!openssl_ctx_run_once(ctx,
- OPENSSL_CTX_FOO_RUN_ONCE_INDEX,
- do_foo_init))
+ if (!ossl_lib_ctx_run_once(ctx,
+ OSSL_LIB_CTX_FOO_RUN_ONCE_INDEX,
+ do_foo_init))
return 0;
/* Do some work using foo resources in ctx */
=head1 SEE ALSO
-L<OPENSSL_CTX(3)>
+L<OSSL_LIB_CTX(3)>
=head1 COPYRIGHT
struct ossl_method_construct_method_st {
/* Create store */
- void *(*alloc_tmp_store)(OPENSSL_CTX *ctx);
+ void *(*alloc_tmp_store)(OSSL_LIB_CTX *ctx);
/* Remove a store */
void (*dealloc_tmp_store)(void *store);
/* Get an already existing method from a store */
- void *(*get)(OPENSSL_CTX *libctx, void *store, void *data);
+ void *(*get)(OSSL_LIB_CTX *libctx, void *store, void *data);
/* Store a method in a store */
- int (*put)(OPENSSL_CTX *libctx, void *store, void *method,
+ int (*put)(OSSL_LIB_CTX *libctx, void *store, void *method,
const OSSL_PROVIDER *prov, int operation_id, const char *name,
const char *propdef, void *data);
/* Construct a new method */
};
typedef struct ossl_method_construct_method OSSL_METHOD_CONSTRUCT_METHOD;
- void *ossl_method_construct(OPENSSL_CTX *ctx, int operation_id,
+ void *ossl_method_construct(OSSL_LIB_CTX *ctx, int operation_id,
int force_cache,
OSSL_METHOD_CONSTRUCT_METHOD *mcm, void *mcm_data);
#include "internal/cryptlib.h"
- OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx);
+ OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx);
OSSL_NAMEMAP *ossl_namemap_new(void);
void ossl_namemap_free(OSSL_NAMEMAP *namemap);
#include "internal/provider.h"
- OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name,
+ OSSL_PROVIDER *ossl_provider_find(OSSL_LIB_CTX *libctx, const char *name,
int noconfig);
- OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
+ OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name,
ossl_provider_init_fn *init_function
int noconfig);
int ossl_provider_up_ref(OSSL_PROVIDER *prov);
void *ossl_provider_ctx(const OSSL_PROVIDER *prov);
/* Iterate over all loaded providers */
- int ossl_provider_forall_loaded(OPENSSL_CTX *,
+ int ossl_provider_forall_loaded(OSSL_LIB_CTX *,
int (*cb)(OSSL_PROVIDER *provider,
void *cbdata),
void *cbdata);
const DSO *ossl_provider_dso(OSSL_PROVIDER *prov);
const char *ossl_provider_module_name(OSSL_PROVIDER *prov);
const char *ossl_provider_module_path(OSSL_PROVIDER *prov);
- OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov);
+ OSSL_LIB_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov);
/* Thin wrappers around calls to the provider */
void ossl_provider_teardown(const OSSL_PROVIDER *prov);
#include <openssl/x509v3.h>
- int x509v3_cache_extensions(X509 *x, OPENSSL_CTX *libctx, const char *propq);
+ int x509v3_cache_extensions(X509 *x, OSSL_LIB_CTX *libctx, const char *propq);
=head1 DESCRIPTION
#include <openssl/bn.h>
- BN_CTX *BN_CTX_new_ex(OPENSSL_CTX *ctx);
+ BN_CTX *BN_CTX_new_ex(OSSL_LIB_CTX *ctx);
BN_CTX *BN_CTX_new(void);
- BN_CTX *BN_CTX_secure_new_ex(OPENSSL_CTX *ctx);
+ BN_CTX *BN_CTX_secure_new_ex(OSSL_LIB_CTX *ctx);
BN_CTX *BN_CTX_secure_new(void);
void BN_CTX_free(BN_CTX *c);
The random generator must be seeded prior to calling BN_generate_prime_ex().
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
external circumstances (see L<RAND(7)>), the operation will fail.
-The random number generator configured for the OPENSSL_CTX associated with
+The random number generator configured for the OSSL_LIB_CTX associated with
B<ctx> will be used.
BN_generate_prime_ex() is the same as BN_generate_prime_ex2() except that no
B<ctx> parameter is passed.
-In this case the random number generator associated with the default OPENSSL_CTX
+In this case the random number generator associated with the default OSSL_LIB_CTX
will be used.
BN_check_prime(), BN_is_prime_ex(), BN_is_prime_fasttest_ex(), BN_is_prime()
const unsigned char *key,
size_t keylen,
unsigned int flags,
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
const char *propq);
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in,
#include <openssl/cms.h>
CMS_ContentInfo *
- CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher, OPENSSL_CTX *libctx,
+ CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
const char *propq);
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
CMS_ContentInfo *
- CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OPENSSL_CTX *libctx,
+ CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
const char *propq);
CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
#include <openssl/cms.h>
CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
=head1 DESCRIPTION
#include <openssl/cms.h>
CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
- unsigned int flags, OPENSSL_CTX *ctx,
+ unsigned int flags, OSSL_LIB_CTX *ctx,
const char *propq);
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
const EVP_CIPHER *cipher, unsigned int flags,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
const EVP_CIPHER *cipher, unsigned int flags);
CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
unsigned char *id, int idlen, int allorfirst,
STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
unsigned char *id, int idlen, int allorfirst,
STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo);
CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
STACK_OF(X509) *certs, BIO *data,
- unsigned int flags, OPENSSL_CTX *ctx,
+ unsigned int flags, OSSL_LIB_CTX *ctx,
const char *propq);
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, unsigned int flags);
#include <openssl/conf.h>
- int CONF_modules_load_file_ex(OPENSSL_CTX *libctx, const char *filename,
+ int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
const char *appname, unsigned long flags);
int CONF_modules_load_file(const char *filename, const char *appname,
unsigned long flags);
#include <openssl/ct.h>
- CTLOG_STORE *CTLOG_STORE_new_ex(OPENSSL_CTX *libctx, const char *propq);
+ CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
CTLOG_STORE *CTLOG_STORE_new(void);
void CTLOG_STORE_free(CTLOG_STORE *store);
#include <openssl/ct.h>
CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
- const char *name, OPENSSL_CTX *libctx,
+ const char *name, OSSL_LIB_CTX *libctx,
const char *propq);
int CTLOG_new_from_base64(CTLOG ** ct_log,
const char *pkey_base64, const char *name);
#include <openssl/ct.h>
- CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OPENSSL_CTX *libctx,
+ CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
const char *propq);
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
#include <openssl/ec.h>
EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params);
EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params);
void EC_GROUP_free(EC_GROUP *group);
const BIGNUM *b, BN_CTX *ctx);
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
const BIGNUM *b, BN_CTX *ctx);
- EC_GROUP *EC_GROUP_new_by_curve_name_ex(OPENSSL_CTX *libctx, const char *propq,
+ EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
int nid);
EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
Although deprecated since OpenSSL 3.0 and should no longer be used,
a new curve can be constructed by calling EC_GROUP_new(), using the
implementation provided by I<meth> (see L<EC_GFp_simple_method(3)>) and
-associated with the library context I<ctx> (see L<OPENSSL_CTX(3)>).
+associated with the library context I<ctx> (see L<OSSL_LIB_CTX(3)>).
The I<ctx> parameter may be NULL in which case the default library context is
used.
It is then necessary to call EC_GROUP_set_curve() to set the curve parameters.
Applications should instead use one of the other EC_GROUP_new_* constructors.
EC_GROUP_new_from_params() creates a group with parameters specified by I<params>.
-The library context I<libctx> (see L<OPENSSL_CTX(3)>) and property query string
+The library context I<libctx> (see L<OSSL_LIB_CTX(3)>) and property query string
I<propq> are used to fetch algorithms from providers.
I<params> may be either a list of explicit params or a named group,
The values for I<ctx> and I<propq> may be NULL.
In order to construct a built-in curve use the function
EC_GROUP_new_by_curve_name_ex() and provide the I<nid> of the curve to
be constructed, the associated library context to be used in I<ctx> (see
-L<OPENSSL_CTX(3)>) and any property query string in I<propq>. The I<ctx> value
+L<OSSL_LIB_CTX(3)>) and any property query string in I<propq>. The I<ctx> value
may be NULL in which case the default library context is used. The I<propq>
value may also be NULL.
L<crypto(7)>, L<EC_GROUP_copy(3)>,
L<EC_POINT_new(3)>, L<EC_POINT_add(3)>, L<EC_KEY_new(3)>,
L<EC_GFp_simple_method(3)>, L<d2i_ECPKParameters(3)>,
-L<OPENSSL_CTX(3)>, L<EVP_PKEY-EC(7)>
+L<OSSL_LIB_CTX(3)>, L<EVP_PKEY-EC(7)>
=head1 HISTORY
#include <openssl/ec.h>
- EC_KEY *EC_KEY_new_ex(OPENSSL_CTX *ctx, const char *propq);
+ EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq);
EC_KEY *EC_KEY_new(void);
int EC_KEY_get_flags(const EC_KEY *key);
void EC_KEY_set_flags(EC_KEY *key, int flags);
void EC_KEY_clear_flags(EC_KEY *key, int flags);
- EC_KEY *EC_KEY_new_by_curve_name_ex(OPENSSL_CTX *ctx, const char *propq,
+ EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, const char *propq,
int nid);
EC_KEY *EC_KEY_new_by_curve_name(int nid);
void EC_KEY_free(EC_KEY *key);
key.
A new EC_KEY with no associated curve can be constructed by calling
EC_KEY_new_ex() and specifying the associated library context in I<ctx>
-(see L<OPENSSL_CTX(3)>) and property query string I<propq>.
+(see L<OSSL_LIB_CTX(3)>) and property query string I<propq>.
The I<ctx> parameter may be NULL in which case the default library context is
used.
The reference count for the newly created EC_KEY is initially
Alternatively a new EC_KEY can be constructed by calling
EC_KEY_new_by_curve_name_ex() and supplying the nid of the associated
-curve, the library context to be used I<ctx> (see L<OPENSSL_CTX(3)>) and any
+curve, the library context to be used I<ctx> (see L<OSSL_LIB_CTX(3)>) and any
property query string I<propq>.
The I<ctx> parameter may be NULL in which case the default library context is
used. The I<propq> value may also be NULL.
L<EC_POINT_add(3)>,
L<EC_GFp_simple_method(3)>,
L<d2i_ECPKParameters(3)>,
-L<OPENSSL_CTX(3)>
+L<OSSL_LIB_CTX(3)>
=head1 HISTORY
#include <openssl/evp.h>
- EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_number(const EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name);
OSSL_PROVIDER *EVP_ASYM_CIPHER_provider(const EVP_ASYM_CIPHER *cipher);
- void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_ASYM_CIPHER *cipher,
void *arg),
void *arg);
EVP_ASYM_CIPHER_fetch() fetches the implementation for the given
B<algorithm> from any provider offering it, within the criteria given
by the B<properties> and in the scope of the given library context B<ctx> (see
-L<OPENSSL_CTX(3)>). The algorithm will be one offering functions for performing
+L<OSSL_LIB_CTX(3)>). The algorithm will be one offering functions for performing
asymmetric cipher related tasks such as asymmetric encryption and decryption.
See L<provider(7)/Fetching algorithms> for further information.
#include <openssl/evp.h>
- EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_MD_up_ref(EVP_MD *md);
void EVP_MD_free(EVP_MD *md);
EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx);
void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
- void EVP_MD_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_MD_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MD *mac, void *arg),
void *arg);
If I<md> is a legacy digest (it's the return value from the likes of
EVP_sha256() rather than the result of an EVP_MD_fetch()), only cipher
names registered with the default library context (see
-L<OPENSSL_CTX(3)>) will be considered.
+L<OSSL_LIB_CTX(3)>) will be considered.
=item EVP_MD_number()
#include <openssl/evp.h>
int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const char *mdname, OPENSSL_CTX *libctx,
+ const char *mdname, OSSL_LIB_CTX *libctx,
const char *props, EVP_PKEY *pkey);
int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
(which means the EVP_PKEY_CTX is created inside EVP_DigestSignInit_ex()
and it will be freed automatically when the EVP_MD_CTX is freed). If the
EVP_PKEY_CTX to be used is created by EVP_DigestSignInit_ex then it
-will use the B<OPENSSL_CTX> specified in I<libctx> and the property query string
+will use the B<OSSL_LIB_CTX> specified in I<libctx> and the property query string
specified in I<props>.
The digest I<mdname> may be NULL if the signing algorithm supports it. The
#include <openssl/evp.h>
int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const char *mdname, OPENSSL_CTX *libctx,
+ const char *mdname, OSSL_LIB_CTX *libctx,
const char *props, EVP_PKEY *pkey);
int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
(which means the EVP_PKEY_CTX is created inside
EVP_DigestVerifyInit_ex() and it will be freed automatically when the
EVP_MD_CTX is freed). If the EVP_PKEY_CTX to be used is created by
-EVP_DigestVerifyInit_ex then it will use the B<OPENSSL_CTX> specified
+EVP_DigestVerifyInit_ex then it will use the B<OSSL_LIB_CTX> specified
in I<libctx> and the property query string specified in I<props>.
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit_ex() if the
#include <openssl/evp.h>
- EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_CIPHER_up_ref(EVP_CIPHER *cipher);
void EVP_CIPHER_free(EVP_CIPHER *cipher);
int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
- void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_CIPHER *cipher, void *arg),
void *arg);
If I<cipher> is a legacy cipher (it's the return value from the likes
of EVP_aes128() rather than the result of an EVP_CIPHER_fetch()), only
cipher names registered with the default library context (see
-L<OPENSSL_CTX(3)>) will be considered.
+L<OSSL_LIB_CTX(3)>) will be considered.
EVP_CIPHER_number() returns the internal dynamic number assigned to
the I<cipher>. This is only useful with fetched B<EVP_CIPHER>s.
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
int EVP_KDF_up_ref(EVP_KDF *kdf);
void EVP_KDF_free(EVP_KDF *kdf);
- EVP_KDF *EVP_KDF_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+ EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
int EVP_KDF_number(const EVP_KDF *kdf);
int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name);
const char *EVP_KDF_name(const EVP_KDF *kdf);
const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf);
- void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KDF *kdf, void *arg),
void *arg);
void EVP_KDF_names_do_all(const EVP_KDF *kdf,
#include <openssl/evp.h>
- EVP_KEM *EVP_KEM_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_KEM_free(EVP_KEM *kem);
int EVP_KEM_up_ref(EVP_KEM *kem);
int EVP_KEM_number(const EVP_KEM *kem);
int EVP_KEM_is_a(const EVP_KEM *kem, const char *name);
OSSL_PROVIDER *EVP_KEM_provider(const EVP_KEM *kem);
- void EVP_KEM_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEM *kem, void *arg), void *arg);
void EVP_KEM_names_do_all(const EVP_KEM *kem,
void (*fn)(const char *name, void *data), void *data);
EVP_KEM_fetch() fetches the implementation for the given B<algorithm> from any
provider offering it, within the criteria given by the B<properties> and in the
-scope of the given library context B<ctx> (see L<OPENSSL_CTX(3)>). The algorithm
+scope of the given library context B<ctx> (see L<OSSL_LIB_CTX(3)>). The algorithm
will be one offering functions for performing asymmetric kem related tasks such
as key encapsulation and decapsulation.
See L<provider(7)/Fetching algorithms> for further information.
#include <openssl/evp.h>
- EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange);
int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *exchange, const char *name);
int EVP_KEYEXCH_number(const EVP_KEYEXCH *exchange);
- void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYEXCH *exchange, void *arg),
void *arg);
void EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *exchange,
typedef struct evp_keymgmt_st EVP_KEYMGMT;
- EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt);
void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt);
int EVP_KEYMGMT_number(const EVP_KEYMGMT *keymgmt);
const char *EVP_KEYMGMT_get0_first_name(const EVP_KEYMGMT *keymgmt);
- void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
void *arg);
void EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt,
when needed.
EVP_KEYMGMT_fetch() looks for an algorithm within the provider that
-has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
+has been loaded into the B<OSSL_LIB_CTX> given by I<ctx>, having the
name given by I<algorithm> and the properties given by I<properties>.
EVP_KEYMGMT_up_ref() increments the reference count for the given
=head1 SEE ALSO
-L<EVP_MD_fetch(3)>, L<OPENSSL_CTX(3)>
+L<EVP_MD_fetch(3)>, L<OSSL_LIB_CTX(3)>
=head1 HISTORY
typedef struct evp_mac_st EVP_MAC;
typedef struct evp_mac_ctx_st EVP_MAC_CTX;
- EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+ EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
int EVP_MAC_up_ref(EVP_MAC *mac);
void EVP_MAC_free(EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
- void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MAC *mac, void *arg),
void *arg);
EVP_PKEY_CTX_get0_libctx,
EVP_PKEY_CTX_get0_propq
-- functions for getting OPENSSL_CTX and property query data from an EVP_PKEY_CTX
+- functions for getting OSSL_LIB_CTX and property query data from an EVP_PKEY_CTX
=head1 SYNOPSIS
#include <openssl/evp.h>
- OPENSSL_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx);
+ OSSL_LIB_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx);
const char *EVP_PKEY_CTX_get0_propq(EVP_PKEY_CTX *ctx);
=head1 DESCRIPTION
The EVP_PKEY_CTX_get0_libctx() and EVP_PKEY_CTX_get0_propq() functions obtain
-the OPENSSL_CTX and property query string values respectively that were
+the OSSL_LIB_CTX and property query string values respectively that were
associated with the EVP_PKEY_CTX when it was constructed.
=head1 RETURN VALUES
EVP_PKEY_CTX_get0_libctx() and EVP_PKEY_CTX_get0_propq() functions return the
-OPENSSL_CTX and property query string associated with the EVP_PKEY_CTX or NULL
+OSSL_LIB_CTX and property query string associated with the EVP_PKEY_CTX or NULL
if they are not set. The returned values should not be freed by the caller.
=head1 SEE ALSO
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
- EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OPENSSL_CTX *libctx,
+ EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx,
const char *name,
const char *propquery);
- EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OPENSSL_CTX *libctx,
+ EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx,
EVP_PKEY *pkey,
const char *propquery);
EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx);
using the key type specified by I<id> and ENGINE I<e>.
The EVP_PKEY_CTX_new_from_name() function allocates a public key algorithm
-context using the library context I<libctx> (see L<OPENSSL_CTX(3)>), the
+context using the library context I<libctx> (see L<OSSL_LIB_CTX(3)>), the
key type specified by I<name> and the property query I<propquery>. None
of the arguments are duplicated, so they must remain unchanged for the
lifetime of the returned B<EVP_PKEY_CTX> or of any of its duplicates. Read
further about the possible names in L</NOTES> below.
The EVP_PKEY_CTX_new_from_pkey() function allocates a public key algorithm
-context using the library context I<libctx> (see L<OPENSSL_CTX(3)>) and the
+context using the library context I<libctx> (see L<OSSL_LIB_CTX(3)>) and the
algorithm specified by I<pkey> and the property query I<propquery>. None of the
arguments are duplicated, so they must remain unchanged for the lifetime of the
returned B<EVP_PKEY_CTX> or any of its duplicates.
int EVP_PKEY_up_ref(EVP_PKEY *key);
void EVP_PKEY_free(EVP_PKEY *key);
- EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OPENSSL_CTX *libctx,
+ EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *key,
size_t keylen);
EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
const unsigned char *key, size_t keylen);
- EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OPENSSL_CTX *libctx,
+ EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *key,
const unsigned char *key, size_t keylen);
EVP_PKEY *EVP_PKEY_new_CMAC_key_ex(const unsigned char *priv, size_t len,
const char *cipher_name,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
size_t len, const EVP_CIPHER *cipher);
EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, const unsigned char *key,
typedef struct evp_rand_st EVP_RAND;
typedef struct evp_rand_ctx_st EVP_RAND_CTX;
- EVP_RAND *EVP_RAND_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+ EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
int EVP_RAND_up_ref(EVP_RAND *rand);
void EVP_RAND_free(EVP_RAND *rand);
const char *EVP_RAND_name(const EVP_RAND *rand);
int EVP_RAND_is_a(const EVP_RAND *rand, const char *name);
const OSSL_PROVIDER *EVP_RAND_provider(const EVP_RAND *rand);
- void EVP_RAND_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_RAND *rand, void *arg),
void *arg);
void EVP_RAND_names_do_all(const EVP_RAND *rand,
#include <openssl/evp.h>
- EVP_SIGNATURE *EVP_SIGNATURE_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+ EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_SIGNATURE_free(EVP_SIGNATURE *signature);
int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature);
int EVP_SIGNATURE_number(const EVP_SIGNATURE *signature);
int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name);
OSSL_PROVIDER *EVP_SIGNATURE_provider(const EVP_SIGNATURE *signature);
- void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx,
+ void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_SIGNATURE *signature,
void *arg),
void *arg);
int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
int EVP_SignFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
- EVP_PKEY *pkey, OPENSSL_CTX *libctx, const char *propq);
+ EVP_PKEY *pkey, OSSL_LIB_CTX *libctx, const char *propq);
int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sig, unsigned int *s,
EVP_PKEY *pkey);
int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
int EVP_VerifyFinal_ex(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
unsigned int siglen, EVP_PKEY *pkey,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, unsigned int siglen,
EVP_PKEY *pkey);
#include <openssl/evp.h>
- int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq);
- int EVP_default_properties_enable_fips(OPENSSL_CTX *libctx, int enable);
- int EVP_default_properties_is_fips_enabled(OPENSSL_CTX *libctx);
+ int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq);
+ int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable);
+ int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx);
=head1 DESCRIPTION
#include <openssl/conf.h>
- CONF *NCONF_new_ex(OPENSSL_CTX *libctx, CONF_METHOD *meth);
+ CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
CONF *NCONF_new(CONF_METHOD *meth);
void NCONF_free(CONF *conf);
CONF_METHOD *NCONF_default(void);
int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
- int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OPENSSL_CTX *libctx,
+ int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
const char *propq);
int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
void OPENSSL_cleanup(void);
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
int OPENSSL_atexit(void (*handler)(void));
- void OPENSSL_thread_stop_ex(OPENSSL_CTX *ctx);
+ void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx);
void OPENSSL_thread_stop(void);
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
registered, no guarantees are made about the order of execution.
The OPENSSL_thread_stop_ex() function deallocates resources associated
-with the current thread for the given OPENSSL_CTX B<ctx>. The B<ctx> parameter
-can be NULL in which case the default OPENSSL_CTX is used.
+with the current thread for the given OSSL_LIB_CTX B<ctx>. The B<ctx> parameter
+can be NULL in which case the default OSSL_LIB_CTX is used.
Typically, this function will be called automatically by the library when
-the thread exits as long as the OPENSSL_CTX has not been freed before the thread
-exits. If OPENSSL_CTX_free() is called OPENSSL_thread_stop_ex will be called
+the thread exits as long as the OSSL_LIB_CTX has not been freed before the thread
+exits. If OSSL_LIB_CTX_free() is called OPENSSL_thread_stop_ex will be called
automatically for the current thread (but not any other threads that may have
-used this OPENSSL_CTX).
+used this OSSL_LIB_CTX).
OPENSSL_thread_stop_ex should be called on all threads that will exit after the
-OPENSSL_CTX is freed.
-Typically this is not necessary for the default OPENSSL_CTX (because all
+OSSL_LIB_CTX is freed.
+Typically this is not necessary for the default OSSL_LIB_CTX (because all
resources are cleaned up on library exit) except if thread local resources
should be freed before library exit, or under the circumstances described in
the NOTES section below.
OPENSSL_thread_stop() is the same as OPENSSL_thread_stop_ex() except that the
-default OPENSSL_CTX is always used.
+default OSSL_LIB_CTX is always used.
The B<OPENSSL_INIT_LOAD_CONFIG> flag will load a configuration file, as with
L<CONF_modules_load_file(3)> with NULL filename and application name and the
#include <openssl/cmp.h>
- OSSL_CMP_CTX *OSSL_CMP_CTX_new(OPENSSL_CTX *libctx, const char *propq);
+ OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx);
int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx);
int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val);
const OSSL_CMP_MSG *req);
OSSL_CMP_MSG *OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx,
const OSSL_CMP_MSG *req);
- OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OPENSSL_CTX *libctx, const char *propq);
+ OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx);
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)(
X509
*OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
EVP_PKEY *pkey);
int OSSL_CRMF_MSG_get_certReqId(const OSSL_CRMF_MSG *crm);
OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert() decrypts the certificate in the given
encryptedValue I<ecert>, using the private key I<pkey>, library context
-I<libctx> and property query string I<propq> (see L<OPENSSL_CTX(3)>).
+I<libctx> and property query string I<propq> (see L<OSSL_LIB_CTX(3)>).
This is needed for the indirect POPO method as in RFC 4210 section 5.2.8.2.
The function returns the decrypted certificate as a copy, leaving its ownership
with the caller, who is responsible for freeing it.
int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
EVP_PKEY *pkey, const EVP_MD *digest,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
int rid, int acceptRAVerified,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
=head1 DESCRIPTION
#include <openssl/crmf.h>
- int OSSL_CRMF_pbm_new(OPENSSL_CTX *libctx, const char *propq,
+ int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
const OSSL_CRMF_PBMPARAMETER *pbmp,
const unsigned char *msg, size_t msglen,
const unsigned char *sec, size_t seclen,
unsigned char **mac, size_t *maclen);
- OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OPENSSL_CTX *libctx, size_t saltlen,
+ OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t saltlen,
int owfnid, size_t itercnt,
int macnid);
typedef struct ossl_decoder_st OSSL_DECODER;
- OSSL_DECODER *OSSL_DECODER_fetch(OPENSSL_CTX *ctx, const char *name,
+ OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
const char *properties);
int OSSL_DECODER_up_ref(OSSL_DECODER *decoder);
void OSSL_DECODER_free(OSSL_DECODER *decoder);
const char *OSSL_DECODER_properties(const OSSL_DECODER *decoder);
int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name);
int OSSL_DECODER_number(const OSSL_DECODER *decoder);
- void OSSL_DECODER_do_all_provided(OPENSSL_CTX *libctx,
+ void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_DECODER *decoder, void *arg),
void *arg);
void OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder,
of OpenSSL knows how to handle.
OSSL_DECODER_fetch() looks for an algorithm within the provider that
-has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
+has been loaded into the B<OSSL_LIB_CTX> given by I<ctx>, having the
name given by I<name> and the properties given by I<properties>.
The I<name> determines what type of object the fetched decoder
method is expected to be able to decode, and the properties are
=head1 SEE ALSO
L<provider(7)>, L<OSSL_DECODER_CTX(3)>, L<OSSL_DECODER_from_bio(3)>,
-L<OSSL_DECODER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
+L<OSSL_DECODER_CTX_new_by_EVP_PKEY(3)>, L<OSSL_LIB_CTX(3)>
=head1 HISTORY
OSSL_DECODER_CTX *
OSSL_DECODER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey,
const char *input_type, const char *keytype,
- OPENSSL_CTX *libctx, const char *propquery);
+ OSSL_LIB_CTX *libctx, const char *propquery);
int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx,
const unsigned char *kstr,
typedef struct ossl_encoder_st OSSL_ENCODER;
- OSSL_ENCODER *OSSL_ENCODER_fetch(OPENSSL_CTX *ctx, const char *name,
+ OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
const char *properties);
int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
const char *OSSL_ENCODER_properties(const OSSL_ENCODER *encoder);
int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
int OSSL_ENCODER_number(const OSSL_ENCODER *encoder);
- void OSSL_ENCODER_do_all_provided(OPENSSL_CTX *libctx,
+ void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_ENCODER *encoder, void *arg),
void *arg);
void OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
DER, or even human readable text.
OSSL_ENCODER_fetch() looks for an algorithm within the provider that
-has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
+has been loaded into the B<OSSL_LIB_CTX> given by I<ctx>, having the
name given by I<name> and the properties given by I<properties>.
The I<name> determines what type of object the fetched encoder
method is expected to be able to encode, and the properties are
=head1 SEE ALSO
L<provider(7)>, L<OSSL_ENCODER_CTX(3)>, L<OSSL_ENCODER_to_bio(3)>,
-L<OSSL_ENCODER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
+L<OSSL_ENCODER_CTX_new_by_EVP_PKEY(3)>, L<OSSL_LIB_CTX(3)>
=head1 HISTORY
int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder);
int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx);
typedef struct ossl_encoder_instance_st OSSL_ENCODER_INSTANCE;
OSSL_ENCODER_CTX *
OSSL_ENCODER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey,
const char *output_type, int selection,
- OPENSSL_CTX *libctx, const char *propquery);
+ OSSL_LIB_CTX *libctx, const char *propquery);
int OSSL_ENCODER_CTX_set_cipher(OSSL_ENCODER_CTX *ctx,
const char *cipher_name,
=head1 NAME
-OPENSSL_CTX, OPENSSL_CTX_new, OPENSSL_CTX_free, OPENSSL_CTX_load_config,
-OPENSSL_CTX_set0_default
+OSSL_LIB_CTX, OSSL_LIB_CTX_new, OSSL_LIB_CTX_free, OSSL_LIB_CTX_load_config,
+OSSL_LIB_CTX_set0_default
- OpenSSL library context
=head1 SYNOPSIS
#include <openssl/crypto.h>
- typedef struct openssl_ctx_st OPENSSL_CTX;
+ typedef struct ossl_lib_ctx_st OSSL_LIB_CTX;
- OPENSSL_CTX *OPENSSL_CTX_new(void);
- int OPENSSL_CTX_load_config(OPENSSL_CTX *ctx, const char *config_file);
- void OPENSSL_CTX_free(OPENSSL_CTX *ctx);
- OPENSSL_CTX *OPENSSL_CTX_set0_default(OPENSSL_CTX *ctx);
+ OSSL_LIB_CTX *OSSL_LIB_CTX_new(void);
+ int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file);
+ void OSSL_LIB_CTX_free(OSSL_LIB_CTX *ctx);
+ OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *ctx);
=head1 DESCRIPTION
-B<OPENSSL_CTX> is an internal OpenSSL library context type.
+B<OSSL_LIB_CTX> is an internal OpenSSL library context type.
Applications may allocate their own, but may also use NULL to use
-a default context with functions that take an B<OPENSSL_CTX>
+a default context with functions that take an B<OSSL_LIB_CTX>
argument.
When a non default library context is in use care should be taken with
multi-threaded applications to properly clean up thread local resources before
-the OPENSSL_CTX is freed.
+the OSSL_LIB_CTX is freed.
See L<OPENSSL_thread_stop_ex(3)> for more information.
-OPENSSL_CTX_new() creates a new OpenSSL library context.
+OSSL_LIB_CTX_new() creates a new OpenSSL library context.
-OPENSSL_CTX_load_config() loads a configuration file using the given C<ctx>.
+OSSL_LIB_CTX_load_config() loads a configuration file using the given C<ctx>.
This can be used to associate a library context with providers that are loaded
from a configuration.
-OPENSSL_CTX_free() frees the given I<ctx>, unless it happens to be the
+OSSL_LIB_CTX_free() frees the given I<ctx>, unless it happens to be the
default OpenSSL library context.
-OPENSSL_CTX_set0_default() sets the default OpenSSL library context to be
+OSSL_LIB_CTX_set0_default() sets the default OpenSSL library context to be
I<ctx> in the current thread. The previous default library context is
returned. Care should be taken by the caller to restore the previous
default library context with a subsequent call of this function.
=head1 RETURN VALUES
-OPENSSL_CTX_new() and OPENSSL_CTX_set0_default() return a library context
+OSSL_LIB_CTX_new() and OSSL_LIB_CTX_set0_default() return a library context
pointer on success, or NULL on error.
-OPENSSL_CTX_free() doesn't return any value.
+OSSL_LIB_CTX_free() doesn't return any value.
=head1 HISTORY
-OPENSSL_CTX, OPENSSL_CTX_new(), OPENSSL_CTX_load_config(), OPENSSL_CTX_free()
-and OPENSSL_CTX_set0_default() were added in OpenSSL 3.0.
+OSSL_LIB_CTX, OSSL_LIB_CTX_new(), OSSL_LIB_CTX_load_config(), OSSL_LIB_CTX_free()
+and OSSL_LIB_CTX_set0_default() were added in OpenSSL 3.0.
=head1 COPYRIGHT
typedef struct ossl_provider_st OSSL_PROVIDER;
- void OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *libctx,
+ void OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *libctx,
const char *path);
- OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name);
- OSSL_PROVIDER *OSSL_PROVIDER_try_load(OPENSSL_CTX *libctx, const char *name);
+ OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *libctx, const char *name);
+ OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *libctx, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
- int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name);
- int OSSL_PROVIDER_do_all(OPENSSL_CTX *ctx,
+ int OSSL_PROVIDER_available(OSSL_LIB_CTX *libctx, const char *name);
+ int OSSL_PROVIDER_do_all(OSSL_LIB_CTX *ctx,
int (*cb)(OSSL_PROVIDER *provider, void *cbdata),
void *cbdata);
int *no_cache);
void *OSSL_PROVIDER_get0_provider_ctx(const OSSL_PROVIDER *prov);
- int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *libctx, const char *name,
+ int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *libctx, const char *name,
ossl_provider_init_fn *init_fn);
const char *OSSL_PROVIDER_name(const OSSL_PROVIDER *prov);
The functions described here handle both forms.
Some of these functions operate within a library context, please see
-L<OPENSSL_CTX(3)> for further details.
+L<OSSL_LIB_CTX(3)> for further details.
=head2 Functions
=head1 SEE ALSO
-L<openssl-core.h(7)>, L<OPENSSL_CTX(3)>, L<provider(7)>
+L<openssl-core.h(7)>, L<OSSL_LIB_CTX(3)>, L<provider(7)>
=head1 HISTORY
#include <openssl/self_test.h>
- void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *ctx, OSSL_CALLBACK *cb, void *cbarg);
- void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg);
+ void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *ctx, OSSL_CALLBACK *cb, void *cbarg);
+ void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg);
=head1 DESCRIPTION
Set or gets the optional application callback (and the callback argument) that
is called during self testing.
-The application callback B<OSSL_CALLBACK> is associated with a B<OPENSSL_CTX>.
+The application callback B<OSSL_CALLBACK> is associated with a B<OSSL_LIB_CTX>.
The application callback function receives information about a running self test,
and may return a result to the calling self test.
See L<openssl-core.h(7)> for further information on the callback.
L<openssl-core.h(7)>,
L<OSSL_PROVIDER-FIPS(7)>
L<OSSL_SELF_TEST_new(3)>
-L<OPENSSL_CTX(3)>
+L<OSSL_LIB_CTX(3)>
=head1 HISTORY
typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(const char *scheme,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *properties);
int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader);
void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader,
const char *scheme);
- void OSSL_STORE_LOADER_do_all_provided(OPENSSL_CTX *libctx,
+ void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_STORE_LOADER *loader,
void *arg),
void *arg);
OSSL_STORE_open_ex_fn store_open_ex_function);
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)
(const OSSL_STORE_LOADER *loader, BIO *bio,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data);
int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader,
OSSL_STORE_attach_fn attach_function);
storage schemes.
OSSL_STORE_LOADER_fetch() looks for an implementation for a storage
-I<scheme> within the providers that has been loaded into the B<OPENSSL_CTX>
+I<scheme> within the providers that has been loaded into the B<OSSL_LIB_CTX>
given by I<ctx>, and with the properties given by I<properties>.
OSSL_STORE_LOADER_up_ref() increments the reference count for the given
=head1 SEE ALSO
-L<ossl_store(7)>, L<OSSL_STORE_open(3)>, L<OPENSSL_CTX(3)>,
+L<ossl_store(7)>, L<OSSL_STORE_open(3)>, L<OSSL_LIB_CTX(3)>,
L<provider-storemgmt(7)>
=head1 HISTORY
#include <openssl/store.h>
OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bio, const char *scheme,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
OSSL_STORE_CTX *
- OSSL_STORE_open_ex(const char *uri, OPENSSL_CTX *libctx, const char *propq,
+ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
STACK_OF(X509_INFO) *PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq);
STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bio,
STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq);
=head1 DESCRIPTION
typedef int pem_password_cb(char *buf, int size, int rwflag, void *u);
EVP_PKEY *PEM_read_bio_PrivateKey_ex(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx,
+ void *u, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u);
EVP_PKEY *PEM_read_PrivateKey_ex(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx,
+ void *u, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x,
pem_password_cb *cb, void *u);
EVP_PKEY *PEM_read_bio_PUBKEY_ex(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EVP_PKEY *PEM_read_bio_PUBKEY(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u);
EVP_PKEY *PEM_read_PUBKEY_ex(FILE *fp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EVP_PKEY *PEM_read_PUBKEY(FILE *fp, EVP_PKEY **x,
pem_password_cb *cb, void *u);
int PEM_write_bio_PUBKEY(BIO *bp, EVP_PKEY *x);
int PEM_write_DSA_PUBKEY(FILE *fp, DSA *x);
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
const EVP_CIPHER *cipher, int flags,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
int flags);
#include <openssl/pkcs7.h>
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
- BIO *data, int flags, OPENSSL_CTX *libctx,
+ BIO *data, int flags, OSSL_LIB_CTX *libctx,
const char *propq);
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, int flags);
int RAND_bytes(unsigned char *buf, int num);
int RAND_priv_bytes(unsigned char *buf, int num);
- int RAND_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
- int RAND_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
+ int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num);
+ int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num);
Deprecated since OpenSSL 1.1.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
RAND_priv_bytes() except that they both take an additional I<ctx> parameter.
The DRBG used for the operation is the public or private DRBG associated with
the specified I<ctx>. The parameter can be NULL, in which case
-the default library context is used (see L<OPENSSL_CTX(3)>.
+the default library context is used (see L<OSSL_LIB_CTX(3)>.
If the default RAND_METHOD has been changed then for compatibility reasons the
RAND_METHOD will be used in preference and the DRBG of the library context
ignored.
#include <openssl/rand.h>
- EVP_RAND_CTX *RAND_get0_primary(OPENSSL_CTX *ctx);
- EVP_RAND_CTX *RAND_get0_public(OPENSSL_CTX *ctx);
- EVP_RAND_CTX *RAND_get0_private(OPENSSL_CTX *ctx);
+ EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx);
+ EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx);
+ EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx);
=head1 DESCRIPTION
=head1 RETURN VALUES
RAND_get0_primary() returns a pointer to the I<primary> DRBG instance
-for the given OPENSSL_CTX B<ctx>.
+for the given OSSL_LIB_CTX B<ctx>.
RAND_get0_public() returns a pointer to the I<public> DRBG instance
-for the given OPENSSL_CTX B<ctx>.
+for the given OSSL_LIB_CTX B<ctx>.
RAND_get0_private() returns a pointer to the I<private> DRBG instance
-for the given OPENSSL_CTX B<ctx>.
+for the given OSSL_LIB_CTX B<ctx>.
In all the above cases the B<ctx> parameter can
-be NULL in which case the default OPENSSL_CTX is used.
+be NULL in which case the default OSSL_LIB_CTX is used.
=head1 NOTES
int SMIME_write_ASN1_ex(BIO *out, ASN1_VALUE *val, BIO *data, int flags,
int ctype_nid, int econt_nid,
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int SMIME_write_ASN1(BIO *out,
ASN1_VALUE *val, BIO *data, int flags, int ctype_nid, int econt_nid,
BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
const BIGNUM *b, const BIGNUM *N);
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
- const BIGNUM *v, OPENSSL_CTX *libctx, const char *propq);
+ const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
const BIGNUM *v);
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
/* client side .... */
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N,
- const BIGNUM *g, OPENSSL_CTX *libctx,
+ const BIGNUM *g, OSSL_LIB_CTX *libctx,
const char *propq);
char *SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N, const BIGNUM *g);
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g);
#include <openssl/ssl.h>
- SSL_CTX *SSL_CTX_new_ex(OPENSSL_CTX *libctx, const char *propq,
+ SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
const SSL_METHOD *method);
SSL_CTX *SSL_CTX_new(const SSL_METHOD *method);
int SSL_CTX_up_ref(SSL_CTX *ctx);
SSL_CTX_new_ex() creates a new B<SSL_CTX> object as a framework to
establish TLS/SSL or DTLS enabled connections using the library context
-I<libctx> (see L<OPENSSL_CTX(3)>). Any cryptographic algorithms that are used
+I<libctx> (see L<OSSL_LIB_CTX(3)>). Any cryptographic algorithms that are used
by any B<SSL> objects created from this B<SSL_CTX> will be fetched from the
I<libctx> using the property query string I<propq> (see
L<provider(7)/Fetching algorithms>. Either or both the I<libctx> or I<propq>
#include <openssl/ssl.h>
STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq);
STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
- char **ret, OPENSSL_CTX *libctx, const char *propq);
+ char **ret, OSSL_LIB_CTX *libctx, const char *propq);
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
int X509_LOOKUP_load_file_ex(X509_LOOKUP *ctx, char *name, long type,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_LOOKUP_load_file(X509_LOOKUP *ctx, char *name, long type);
int X509_LOOKUP_load_file_ex(X509_LOOKUP *ctx, char *name, long type,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_LOOKUP_add_dir(X509_LOOKUP *ctx, char *name, long type);
- int X509_LOOKUP_add_store_ex(X509_LOOKUP *ctx, char *uri, OPENSSL_CTX *libctx,
+ int X509_LOOKUP_add_store_ex(X509_LOOKUP *ctx, char *uri, OSSL_LIB_CTX *libctx,
const char *propq);
int X509_LOOKUP_add_store(X509_LOOKUP *ctx, char *uri);
- int X509_LOOKUP_load_store_ex(X509_LOOKUP *ctx, char *uri, OPENSSL_CTX *libctx,
+ int X509_LOOKUP_load_store_ex(X509_LOOKUP *ctx, char *uri, OSSL_LIB_CTX *libctx,
const char *propq);
int X509_LOOKUP_load_store(X509_LOOKUP *ctx, char *uri);
int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret);
int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
X509_LOOKUP_METHOD *X509_LOOKUP_store(void);
int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
=head1 DESCRIPTION
EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key);
EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length);
int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp);
#include <openssl/x509_vfy.h>
- X509_STORE_CTX *X509_STORE_CTX_new_ex(OPENSSL_CTX *libctx, const char *propq);
+ X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
X509_STORE_CTX *X509_STORE_CTX_new(void);
void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *store,
X509_LOOKUP_METHOD *meth);
- int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OPENSSL_CTX *libctx,
+ int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
const char *propq);
int X509_STORE_set_default_paths(X509_STORE *ctx);
int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_STORE_load_file(X509_STORE *ctx, const char *file);
int X509_STORE_load_path(X509_STORE *ctx, const char *dir);
int X509_STORE_load_store_ex(X509_STORE *ctx, const char *uri,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_STORE_load_store(X509_STORE *ctx, const char *uri);
int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
- const char *dir, OPENSSL_CTX *libctx,
+ const char *dir, OSSL_LIB_CTX *libctx,
const char *propq);
int X509_STORE_load_locations(X509_STORE *ctx,
const char *file, const char *dir);
#include <openssl/x509.h>
X509 *X509_new(void);
- X509 *X509_new_ex(OPENSSL_CTX *libctx, const char *propq);
+ X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
void X509_free(X509 *a);
int X509_up_ref(X509 *a);
STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *x);
int X509_verify(X509 *x, EVP_PKEY *pkey);
int X509_self_signed(X509 *cert, int verify_signature);
- int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *pkey, OPENSSL_CTX *libctx,
+ int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *pkey, OSSL_LIB_CTX *libctx,
const char *propq);
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
L<X509_NAME_print_ex(3)>,
L<X509V3_get_d2i(3)>,
L<X509_verify_cert(3)>,
-L<OPENSSL_CTX(3)>
+L<OSSL_LIB_CTX(3)>
=head1 HISTORY
#include <openssl/evp.h>
EVP_PKEY *d2i_PrivateKey_ex(int type, EVP_PKEY **a, const unsigned char **pp,
- long length, OPENSSL_CTX *libctx,
+ long length, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
long length);
EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
long length);
EVP_PKEY *d2i_AutoPrivateKey_ex(EVP_PKEY **a, const unsigned char **pp,
- long length, OPENSSL_CTX *libctx,
+ long length, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
long length);
#include <openssl/x509.h>
- EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OPENSSL_CTX *libctx,
+ EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
- EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OPENSSL_CTX *libctx,
+ EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
=item The library context
-See L<OPENSSL_CTX(3)> for a more detailed description.
+See L<OSSL_LIB_CTX(3)> for a more detailed description.
This may be NULL to signify the default (global) library context, or a
context created by the user.
Only providers loaded in this library context (see
=head1 SEE ALSO
L<EVP_DigestInit_ex(3)>, L<EVP_EncryptInit_ex(3)>,
-L<OPENSSL_CTX(3)>,
+L<OSSL_LIB_CTX(3)>,
L<EVP_set_default_properties(3)>,
L<EVP_MD_fetch(3)>,
L<EVP_CIPHER_fetch(3)>,
int *matchcount,
const UI_METHOD *ui_method,
void *ui_data, const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq);
/*
* The eof function should return 1 if there's no more data to be found
int *matchcount,
const UI_METHOD *ui_method,
void *ui_data, const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
OSSL_STORE_INFO *store_info = NULL;
const UI_METHOD *ui_method,
void *ui_data,
const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
X509_SIG *p8 = NULL;
int *matchcount,
const UI_METHOD *ui_method,
void *ui_data, const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
OSSL_STORE_INFO *store_info = NULL;
int *matchcount,
const UI_METHOD *ui_method,
void *ui_data, const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
OSSL_STORE_INFO *store_info = NULL;
int *matchcount,
const UI_METHOD *ui_method,
void *ui_data, const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
OSSL_STORE_INFO *store_info = NULL;
const UI_METHOD *ui_method,
void *ui_data,
const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
OSSL_STORE_INFO *store_info = NULL;
int *matchcount,
const UI_METHOD *ui_method,
void *ui_data, const char *uri,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
OSSL_STORE_INFO *store_info = NULL;
/* Expected object type. May be unspecified */
int expected_type;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
};
static OSSL_STORE_LOADER_CTX *file_open_ex
(const OSSL_STORE_LOADER *loader, const char *uri,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data)
{
OSSL_STORE_LOADER_CTX *ctx = NULL;
static OSSL_STORE_LOADER_CTX *file_attach
(const OSSL_STORE_LOADER *loader, BIO *bp,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data)
{
OSSL_STORE_LOADER_CTX *ctx = NULL;
/* Exports and imports to / from providers */
size_t (*dirty_cnt) (const EVP_PKEY *pk);
int (*export_to) (const EVP_PKEY *pk, void *to_keydata,
- EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx,
const char *propq);
OSSL_CALLBACK *import_from;
int (*priv_decode_ex) (EVP_PKEY *pk,
const PKCS8_PRIV_KEY_INFO *p8inf,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq);
} /* EVP_PKEY_ASN1_METHOD */ ;
const BIGNUM *r1, const BIGNUM *r2, int nlen,
const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb);
-OPENSSL_CTX *bn_get_lib_ctx(BN_CTX *ctx);
+OSSL_LIB_CTX *bn_get_lib_ctx(BN_CTX *ctx);
extern const BIGNUM bn_inv_sqrt_2;
# include <openssl/decoder.h>
-OSSL_DECODER *ossl_decoder_fetch_by_number(OPENSSL_CTX *libctx,
+OSSL_DECODER *ossl_decoder_fetch_by_number(OSSL_LIB_CTX *libctx,
int id,
const char *properties);
int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx,
EVP_PKEY **pkey, const char *keytype,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propquery);
#endif
#include <openssl/dh.h>
#include "internal/ffc.h"
-DH *dh_new_by_nid_ex(OPENSSL_CTX *libctx, int nid);
-DH *dh_new_ex(OPENSSL_CTX *libctx);
+DH *dh_new_by_nid_ex(OSSL_LIB_CTX *libctx, int nid);
+DH *dh_new_ex(OSSL_LIB_CTX *libctx);
int dh_generate_ffc_parameters(DH *dh, int type, int pbits, int qbits,
BN_GENCB *cb);
const unsigned char *Z, size_t Zlen,
const char *cek_alg,
const unsigned char *ukm, size_t ukmlen, const EVP_MD *md,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
#define DSA_PARAMGEN_TYPE_FIPS_186_4 0 /* Use FIPS186-4 standard */
#define DSA_PARAMGEN_TYPE_FIPS_186_2 1 /* Use legacy FIPS186-2 standard */
-DSA *dsa_new_with_ctx(OPENSSL_CTX *libctx);
+DSA *dsa_new_with_ctx(OSSL_LIB_CTX *libctx);
int dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits,
BN_GENCB *cb);
int ecdh_KDF_X9_63(unsigned char *out, size_t outlen,
const unsigned char *Z, size_t Zlen,
const unsigned char *sinfo, size_t sinfolen,
- const EVP_MD *md, OPENSSL_CTX *libctx, const char *propq);
+ const EVP_MD *md, OSSL_LIB_CTX *libctx, const char *propq);
int ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx);
int ec_key_private_check(const EC_KEY *eckey);
int ec_key_pairwise_check(const EC_KEY *eckey, BN_CTX *ctx);
-OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *eckey);
+OSSL_LIB_CTX *ec_key_get_libctx(const EC_KEY *eckey);
const char *ec_key_get0_propq(const EC_KEY *eckey);
const char *ec_curve_nid2name(int nid);
int ec_curve_name2nid(const char *name);
/* Backend support */
int ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
- OSSL_PARAM params[], OPENSSL_CTX *libctx, const char *propq,
+ OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
+ const char *propq,
BN_CTX *bnctx, unsigned char **genbuf);
int ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[]);
int ec_key_fromdata(EC_KEY *ecx, const OSSL_PARAM params[], int include_private);
: EVP_PKEY_ED448)))
struct ecx_key_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
unsigned int haspubkey:1;
unsigned char pubkey[MAX_KEYLEN];
typedef struct ecx_key_st ECX_KEY;
size_t ecx_key_length(ECX_KEY_TYPE type);
-ECX_KEY *ecx_key_new(OPENSSL_CTX *libctx, ECX_KEY_TYPE type, int haspubkey,
+ECX_KEY *ecx_key_new(OSSL_LIB_CTX *libctx, ECX_KEY_TYPE type, int haspubkey,
const char *propq);
unsigned char *ecx_key_allocate_privkey(ECX_KEY *key);
void ecx_key_free(ECX_KEY *key);
void X25519_public_from_private(uint8_t out_public_value[32],
const uint8_t private_key[32]);
-int ED25519_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[32],
+int ED25519_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[32],
const uint8_t private_key[32], const char *propq);
int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len,
const uint8_t public_key[32], const uint8_t private_key[32],
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int ED25519_verify(const uint8_t *message, size_t message_len,
const uint8_t signature[64], const uint8_t public_key[32],
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
-int ED448_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[57],
+int ED448_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[57],
const uint8_t private_key[57], const char *propq);
-int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message,
+int ED448_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t *message,
size_t message_len, const uint8_t public_key[57],
const uint8_t private_key[57], const uint8_t *context,
size_t context_len, const char *propq);
-int ED448_verify(OPENSSL_CTX *ctx, const uint8_t *message, size_t message_len,
+int ED448_verify(OSSL_LIB_CTX *ctx, const uint8_t *message, size_t message_len,
const uint8_t signature[114], const uint8_t public_key[57],
const uint8_t *context, size_t context_len, const char *propq);
#include <openssl/types.h>
-OSSL_ENCODER *ossl_encoder_fetch_by_number(OPENSSL_CTX *libctx, int id,
+OSSL_ENCODER *ossl_encoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id,
const char *properties);
* Library context, property query, keytype and keymgmt associated with
* this context
*/
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propquery;
const char *keytype;
EVP_KEYMGMT *keymgmt;
void openssl_add_all_digests_int(void);
void evp_cleanup_int(void);
void evp_app_cleanup_int(void);
-void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
+void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery);
#ifndef FIPS_MODULE
/* Use the SRP base64 alphabet instead of the standard one */
#define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2
-const EVP_CIPHER *evp_get_cipherbyname_ex(OPENSSL_CTX *libctx, const char *name);
-const EVP_MD *evp_get_digestbyname_ex(OPENSSL_CTX *libctx, const char *name);
+const EVP_CIPHER *evp_get_cipherbyname_ex(OSSL_LIB_CTX *libctx,
+ const char *name);
+const EVP_MD *evp_get_digestbyname_ex(OSSL_LIB_CTX *libctx,
+ const char *name);
int pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
const unsigned char *salt, int saltlen, int iter,
const EVP_MD *digest, int keylen, unsigned char *out,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
#ifndef FIPS_MODULE
/*
int evp_pkey_ctx_get_params_strict(EVP_PKEY_CTX *ctx, OSSL_PARAM *params);
EVP_MD_CTX *evp_md_ctx_new_ex(EVP_PKEY *pkey, const ASN1_OCTET_STRING *id,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int evp_pkey_name2type(const char *name);
int evp_pkey_ctx_set1_id_prov(EVP_PKEY_CTX *ctx, const void *id, int len);
int evp_pkey_ctx_use_cached_data(EVP_PKEY_CTX *ctx);
#endif /* !defined(FIPS_MODULE) */
-void evp_method_store_flush(OPENSSL_CTX *libctx);
-int evp_set_default_properties_int(OPENSSL_CTX *libctx, const char *propq,
+void evp_method_store_flush(OSSL_LIB_CTX *libctx);
+int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq,
int loadconfig);
void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force);
int ossl_rsa_oaeppss_md2nid(const EVP_MD *md);
const char *ossl_rsa_oaeppss_nid2name(int md);
-RSA *ossl_rsa_new_with_ctx(OPENSSL_CTX *libctx);
-OPENSSL_CTX *ossl_rsa_get0_libctx(RSA *r);
+RSA *ossl_rsa_new_with_ctx(OSSL_LIB_CTX *libctx);
+OSSL_LIB_CTX *ossl_rsa_get0_libctx(RSA *r);
int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
const STACK_OF(BIGNUM) *exps,
OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
const OSSL_PARAM params[],
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
-int ossl_rsa_padding_check_PKCS1_type_2_TLS(OPENSSL_CTX *ctx, unsigned char *to,
+int ossl_rsa_padding_check_PKCS1_type_2_TLS(OSSL_LIB_CTX *ctx, unsigned char *to,
size_t tlen,
const unsigned char *from,
size_t flen, int client_version,
int alt_version);
-int ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(OPENSSL_CTX *libctx,
+int ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(OSSL_LIB_CTX *libctx,
unsigned char *to, int tlen,
const unsigned char *from, int flen,
const unsigned char *param,
SIV128_CONTEXT *CRYPTO_siv128_new(const unsigned char *key, int klen,
EVP_CIPHER *cbc, EVP_CIPHER *ctr,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int CRYPTO_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen,
const EVP_CIPHER *cbc, const EVP_CIPHER *ctr,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int CRYPTO_siv128_copy_ctx(SIV128_CONTEXT *dest, SIV128_CONTEXT *src);
int CRYPTO_siv128_aad(SIV128_CONTEXT *ctx, const unsigned char *aad,
size_t len);
void *meth_data;
CRYPTO_RWLOCK *lock;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propq;
};
/* Set on live certificates for authentication purposes */
ASN1_OCTET_STRING *distinguishing_id;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propq;
} /* X509 */ ;
/* signed via bare TA public key, rather than CA certificate */
int bare_ta_signed;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
};
int x509_print_ex_brief(BIO *bio, X509 *cert, unsigned long neg_cflags);
int x509v3_cache_extensions(X509 *x);
int x509_init_sig_info(X509 *x);
-int x509_check_issued_int(X509 *issuer, X509 *subject, OPENSSL_CTX *libctx,
+int x509_check_issued_int(X509 *issuer, X509 *subject, OSSL_LIB_CTX *libctx,
const char *propq);
-int x509_set0_libctx(X509 *x, OPENSSL_CTX *libctx, const char *propq);
-int x509_crl_set0_libctx(X509_CRL *x, OPENSSL_CTX *libctx, const char *propq);
+int x509_set0_libctx(X509 *x, OSSL_LIB_CTX *libctx, const char *propq);
+int x509_crl_set0_libctx(X509_CRL *x, OSSL_LIB_CTX *libctx, const char *propq);
int x509_init_sig_info(X509 *x);
int asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *type, void *data,
unsigned char *md, unsigned int *len,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_add_cert_new(STACK_OF(X509) **sk, X509 *cert, int flags);
-int X509_PUBKEY_get0_libctx(OPENSSL_CTX **plibctx, const char **ppropq,
+int X509_PUBKEY_get0_libctx(OSSL_LIB_CTX **plibctx, const char **ppropq,
const X509_PUBKEY *key);
*/
typedef struct ossl_method_construct_method_st {
/* Create store */
- void *(*alloc_tmp_store)(OPENSSL_CTX *ctx);
+ void *(*alloc_tmp_store)(OSSL_LIB_CTX *ctx);
/* Remove a store */
void (*dealloc_tmp_store)(void *store);
/* Get an already existing method from a store */
- void *(*get)(OPENSSL_CTX *libctx, void *store, void *data);
+ void *(*get)(OSSL_LIB_CTX *libctx, void *store, void *data);
/* Store a method in a store */
- int (*put)(OPENSSL_CTX *libctx, void *store, void *method,
+ int (*put)(OSSL_LIB_CTX *libctx, void *store, void *method,
const OSSL_PROVIDER *prov, int operation_id, const char *name,
const char *propdef, void *data);
/* Construct a new method */
void (*destruct)(void *method, void *data);
} OSSL_METHOD_CONSTRUCT_METHOD;
-void *ossl_method_construct(OPENSSL_CTX *ctx, int operation_id,
+void *ossl_method_construct(OSSL_LIB_CTX *ctx, int operation_id,
int force_cache,
OSSL_METHOD_CONSTRUCT_METHOD *mcm, void *mcm_data);
-void ossl_algorithm_do_all(OPENSSL_CTX *libctx, int operation_id,
+void ossl_algorithm_do_all(OSSL_LIB_CTX *libctx, int operation_id,
OSSL_PROVIDER *provider,
int (*pre)(OSSL_PROVIDER *, int operation_id,
void *data, int *result),
extern unsigned int OPENSSL_ia32cap_P[];
#endif
void OPENSSL_showfatal(const char *fmta, ...);
-int do_ex_data_init(OPENSSL_CTX *ctx);
-void crypto_cleanup_all_ex_data_int(OPENSSL_CTX *ctx);
+int do_ex_data_init(OSSL_LIB_CTX *ctx);
+void crypto_cleanup_all_ex_data_int(OSSL_LIB_CTX *ctx);
int openssl_init_fork_handlers(void);
int openssl_get_fork_id(void);
} OSSL_EX_DATA_GLOBAL;
-/* OPENSSL_CTX */
-
-# define OPENSSL_CTX_PROVIDER_STORE_RUN_ONCE_INDEX 0
-# define OPENSSL_CTX_DEFAULT_METHOD_STORE_RUN_ONCE_INDEX 1
-# define OPENSSL_CTX_METHOD_STORE_RUN_ONCE_INDEX 2
-# define OPENSSL_CTX_MAX_RUN_ONCE 3
-
-# define OPENSSL_CTX_EVP_METHOD_STORE_INDEX 0
-# define OPENSSL_CTX_PROVIDER_STORE_INDEX 1
-# define OPENSSL_CTX_PROPERTY_DEFN_INDEX 2
-# define OPENSSL_CTX_PROPERTY_STRING_INDEX 3
-# define OPENSSL_CTX_NAMEMAP_INDEX 4
-# define OPENSSL_CTX_DRBG_INDEX 5
-# define OPENSSL_CTX_DRBG_NONCE_INDEX 6
-# define OPENSSL_CTX_RAND_CRNGT_INDEX 7
-# define OPENSSL_CTX_THREAD_EVENT_HANDLER_INDEX 8
-# define OPENSSL_CTX_FIPS_PROV_INDEX 9
-# define OPENSSL_CTX_ENCODER_STORE_INDEX 10
-# define OPENSSL_CTX_DECODER_STORE_INDEX 11
-# define OPENSSL_CTX_SELF_TEST_CB_INDEX 12
-# define OPENSSL_CTX_BIO_PROV_INDEX 13
-# define OPENSSL_CTX_GLOBAL_PROPERTIES 14
-# define OPENSSL_CTX_STORE_LOADER_STORE_INDEX 15
-# define OPENSSL_CTX_MAX_INDEXES 16
-
-typedef struct openssl_ctx_method {
- void *(*new_func)(OPENSSL_CTX *ctx);
+/* OSSL_LIB_CTX */
+
+# define OSSL_LIB_CTX_PROVIDER_STORE_RUN_ONCE_INDEX 0
+# define OSSL_LIB_CTX_DEFAULT_METHOD_STORE_RUN_ONCE_INDEX 1
+# define OSSL_LIB_CTX_METHOD_STORE_RUN_ONCE_INDEX 2
+# define OSSL_LIB_CTX_MAX_RUN_ONCE 3
+
+# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX 0
+# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX 1
+# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
+# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX 3
+# define OSSL_LIB_CTX_NAMEMAP_INDEX 4
+# define OSSL_LIB_CTX_DRBG_INDEX 5
+# define OSSL_LIB_CTX_DRBG_NONCE_INDEX 6
+# define OSSL_LIB_CTX_RAND_CRNGT_INDEX 7
+# define OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX 8
+# define OSSL_LIB_CTX_FIPS_PROV_INDEX 9
+# define OSSL_LIB_CTX_ENCODER_STORE_INDEX 10
+# define OSSL_LIB_CTX_DECODER_STORE_INDEX 11
+# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX 12
+# define OSSL_LIB_CTX_BIO_PROV_INDEX 13
+# define OSSL_LIB_CTX_GLOBAL_PROPERTIES 14
+# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX 15
+# define OSSL_LIB_CTX_MAX_INDEXES 16
+
+typedef struct ossl_lib_ctx_method {
+ void *(*new_func)(OSSL_LIB_CTX *ctx);
void (*free_func)(void *);
-} OPENSSL_CTX_METHOD;
+} OSSL_LIB_CTX_METHOD;
-OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx);
-int openssl_ctx_is_default(OPENSSL_CTX *ctx);
-int openssl_ctx_is_global_default(OPENSSL_CTX *ctx);
+OSSL_LIB_CTX *ossl_lib_ctx_get_concrete(OSSL_LIB_CTX *ctx);
+int ossl_lib_ctx_is_default(OSSL_LIB_CTX *ctx);
+int ossl_lib_ctx_is_global_default(OSSL_LIB_CTX *ctx);
/* Functions to retrieve pointers to data by index */
-void *openssl_ctx_get_data(OPENSSL_CTX *, int /* index */,
- const OPENSSL_CTX_METHOD * ctx);
+void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *, int /* index */,
+ const OSSL_LIB_CTX_METHOD * ctx);
-void openssl_ctx_default_deinit(void);
-OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx);
-typedef int (openssl_ctx_run_once_fn)(OPENSSL_CTX *ctx);
-typedef void (openssl_ctx_onfree_fn)(OPENSSL_CTX *ctx);
+void ossl_lib_ctx_default_deinit(void);
+OSSL_EX_DATA_GLOBAL *ossl_lib_ctx_get_ex_data_global(OSSL_LIB_CTX *ctx);
+typedef int (ossl_lib_ctx_run_once_fn)(OSSL_LIB_CTX *ctx);
+typedef void (ossl_lib_ctx_onfree_fn)(OSSL_LIB_CTX *ctx);
-int openssl_ctx_run_once(OPENSSL_CTX *ctx, unsigned int idx,
- openssl_ctx_run_once_fn run_once_fn);
-int openssl_ctx_onfree(OPENSSL_CTX *ctx, openssl_ctx_onfree_fn onfreefn);
+int ossl_lib_ctx_run_once(OSSL_LIB_CTX *ctx, unsigned int idx,
+ ossl_lib_ctx_run_once_fn run_once_fn);
+int ossl_lib_ctx_onfree(OSSL_LIB_CTX *ctx, ossl_lib_ctx_onfree_fn onfreefn);
-OPENSSL_CTX *crypto_ex_data_get_openssl_ctx(const CRYPTO_EX_DATA *ad);
-int crypto_new_ex_data_ex(OPENSSL_CTX *ctx, int class_index, void *obj,
+OSSL_LIB_CTX *crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad);
+int crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
CRYPTO_EX_DATA *ad);
-int crypto_get_ex_new_index_ex(OPENSSL_CTX *ctx, int class_index,
+int crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index,
long argl, void *argp,
CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func,
CRYPTO_EX_free *free_func);
-int crypto_free_ex_index_ex(OPENSSL_CTX *ctx, int class_index, int idx);
+int crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx);
/* Function for simple binary search */
#endif /* FIPS_MODULE */
-int ossl_ffc_params_FIPS186_4_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+int ossl_ffc_params_FIPS186_4_generate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type, size_t L, size_t N,
int *res, BN_GENCB *cb);
-int ossl_ffc_params_FIPS186_2_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+int ossl_ffc_params_FIPS186_2_generate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type, size_t L, size_t N,
int *res, BN_GENCB *cb);
-int ossl_ffc_params_FIPS186_4_gen_verify(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_4_gen_verify(OSSL_LIB_CTX *libctx,
FFC_PARAMS *params, int mode, int type,
size_t L, size_t N, int *res,
BN_GENCB *cb);
-int ossl_ffc_params_FIPS186_2_gen_verify(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_2_gen_verify(OSSL_LIB_CTX *libctx,
FFC_PARAMS *params, int mode, int type,
size_t L, size_t N, int *res,
BN_GENCB *cb);
-int ossl_ffc_params_simple_validate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+int ossl_ffc_params_simple_validate(OSSL_LIB_CTX *libctx, FFC_PARAMS *params,
int type);
-int ossl_ffc_params_FIPS186_4_validate(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_4_validate(OSSL_LIB_CTX *libctx,
const FFC_PARAMS *params,
int type, int *res, BN_GENCB *cb);
-int ossl_ffc_params_FIPS186_2_validate(OPENSSL_CTX *libctx,
+int ossl_ffc_params_FIPS186_2_validate(OSSL_LIB_CTX *libctx,
const FFC_PARAMS *params,
int type, int *res, BN_GENCB *cb);
typedef struct ossl_namemap_st OSSL_NAMEMAP;
-OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx);
+OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx);
OSSL_NAMEMAP *ossl_namemap_new(void);
void ossl_namemap_free(OSSL_NAMEMAP *namemap);
typedef struct ossl_property_list_st OSSL_PROPERTY_LIST;
/* Initialisation */
-int ossl_property_parse_init(OPENSSL_CTX *ctx);
+int ossl_property_parse_init(OSSL_LIB_CTX *ctx);
/* Property definition parser */
-OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn);
+OSSL_PROPERTY_LIST *ossl_parse_property(OSSL_LIB_CTX *ctx, const char *defn);
/* Property query parser */
-OSSL_PROPERTY_LIST *ossl_parse_query(OPENSSL_CTX *ctx, const char *s);
+OSSL_PROPERTY_LIST *ossl_parse_query(OSSL_LIB_CTX *ctx, const char *s);
/* Property checker of query vs definition */
int ossl_property_match_count(const OSSL_PROPERTY_LIST *query,
const OSSL_PROPERTY_LIST *defn);
-int ossl_property_is_enabled(OPENSSL_CTX *ctx, const char *property_name,
+int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name,
const OSSL_PROPERTY_LIST *prop_list);
/* Free a parsed property list */
void ossl_property_free(OSSL_PROPERTY_LIST *p);
/* Implementation store functions */
-OSSL_METHOD_STORE *ossl_method_store_new(OPENSSL_CTX *ctx);
+OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx);
void ossl_method_store_free(OSSL_METHOD_STORE *store);
int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
int nid, const char *properties, void *method,
const char *prop_query, void **method);
/* Get the global properties associate with the specified library context */
-OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OPENSSL_CTX *ctx, int loadconfig);
+OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *ctx,
+ int loadconfig);
/* property query cache functions */
int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
*/
/* Provider Object finder, constructor and destructor */
-OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name,
+OSSL_PROVIDER *ossl_provider_find(OSSL_LIB_CTX *libctx, const char *name,
int noconfig);
-OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
+OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name,
OSSL_provider_init_fn *init_function,
int noconfig);
int ossl_provider_up_ref(OSSL_PROVIDER *prov);
const char *value);
/* Disable fallback loading */
-int ossl_provider_disable_fallback_loading(OPENSSL_CTX *libctx);
+int ossl_provider_disable_fallback_loading(OSSL_LIB_CTX *libctx);
/*
* Activate the Provider
void *ossl_provider_ctx(const OSSL_PROVIDER *prov);
/* Iterate over all loaded providers */
-int ossl_provider_forall_loaded(OPENSSL_CTX *,
+int ossl_provider_forall_loaded(OSSL_LIB_CTX *,
int (*cb)(OSSL_PROVIDER *provider,
void *cbdata),
void *cbdata);
const char *ossl_provider_module_name(const OSSL_PROVIDER *prov);
const char *ossl_provider_module_path(const OSSL_PROVIDER *prov);
void *ossl_provider_prov_ctx(const OSSL_PROVIDER *prov);
-OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov);
+OSSL_LIB_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov);
/* Thin wrappers around calls to the provider */
void ossl_provider_teardown(const OSSL_PROVIDER *prov);
/*
* Initialisation of global data should never happen via "RUN_ONCE" inside the
* FIPS module. Global data should instead always be associated with a specific
- * OPENSSL_CTX object. In this way data will get cleaned up correctly when the
+ * OSSL_LIB_CTX object. In this way data will get cleaned up correctly when the
* module gets unloaded.
*/
#if !defined(FIPS_MODULE) || defined(ALLOW_RUN_ONCE_IN_FIPS)
int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1,
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
const void *data, const ASN1_OCTET_STRING *id,
- EVP_PKEY *pkey, const EVP_MD *md, OPENSSL_CTX *libctx,
+ EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx,
const char *propq);
int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
const ASN1_BIT_STRING *signature, const void *data,
const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
/* ASN1 alloc/free macros for when a type is only used internally */
int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
int ctype_nid, int econt_nid,
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, BIO **bcont, const ASN1_ITEM *it,
ASN1_VALUE **x);
const BIGNUM *BN_value_one(void);
char *BN_options(void);
-BN_CTX *BN_CTX_new_ex(OPENSSL_CTX *ctx);
+BN_CTX *BN_CTX_new_ex(OSSL_LIB_CTX *ctx);
BN_CTX *BN_CTX_new(void);
-BN_CTX *BN_CTX_secure_new_ex(OPENSSL_CTX *ctx);
+BN_CTX *BN_CTX_secure_new_ex(OSSL_LIB_CTX *ctx);
BN_CTX *BN_CTX_secure_new(void);
void BN_CTX_free(BN_CTX *c);
void BN_CTX_start(BN_CTX *ctx);
void OSSL_CMP_MSG_free(OSSL_CMP_MSG *msg);
/* from cmp_ctx.c */
-OSSL_CMP_CTX *OSSL_CMP_CTX_new(OPENSSL_CTX *libctx, const char *propq);
+OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx);
int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx);
/* various CMP options: */
const OSSL_CMP_MSG *req);
OSSL_CMP_MSG * OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx,
const OSSL_CMP_MSG *req);
-OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OPENSSL_CTX *libctx, const char *propq);
+OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx);
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)
(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *req, int certReqId,
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
-CMS_ContentInfo *CMS_ContentInfo_new_ex(OPENSSL_CTX *libctx, const char *propq);
+CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
# define CMS_SIGNERINFO_ISSUER_SERIAL 0
# define CMS_SIGNERINFO_KEYIDENTIFIER 1
unsigned int flags);
CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
STACK_OF(X509) *certs, BIO *data,
- unsigned int flags, OPENSSL_CTX *ctx,
+ unsigned int flags, OSSL_LIB_CTX *ctx,
const char *propq);
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
- OPENSSL_CTX *ctx, const char *propq);
+ OSSL_LIB_CTX *ctx, const char *propq);
int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
unsigned int flags);
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
unsigned int flags);
CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
- unsigned int flags, OPENSSL_CTX *ctx,
+ unsigned int flags, OSSL_LIB_CTX *ctx,
const char *propq);
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
const unsigned char *key,
size_t keylen, unsigned int flags,
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
const char *propq);
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
const EVP_CIPHER *cipher, unsigned int flags);
CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
const EVP_CIPHER *cipher, unsigned int flags,
- OPENSSL_CTX *ctx, const char *propq);
+ OSSL_LIB_CTX *ctx, const char *propq);
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
BIO *dcont, BIO *out, unsigned int flags);
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
CMS_ContentInfo *
-CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OPENSSL_CTX *ctx,
+CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *ctx,
const char *propq);
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
- OPENSSL_CTX *ctx,
+ OSSL_LIB_CTX *ctx,
const char *propq);
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
unsigned char *id, int idlen, int allorfirst,
STACK_OF(GENERAL_NAMES) *receiptList,
STACK_OF(GENERAL_NAMES) *receiptsTo,
- OPENSSL_CTX *ctx, const char *propq);
+ OSSL_LIB_CTX *ctx, const char *propq);
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
void *meth_data;
LHASH_OF(CONF_VALUE) *data;
unsigned int flag_dollarid:1;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
};
-CONF *NCONF_new_ex(OPENSSL_CTX *libctx, CONF_METHOD *meth);
+CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
CONF *NCONF_new(CONF_METHOD *meth);
CONF_METHOD *NCONF_default(void);
DEPRECATEDIN_3_0(CONF_METHOD *NCONF_WIN32(void))
int CONF_modules_load(const CONF *cnf, const char *appname,
unsigned long flags);
-int CONF_modules_load_file_ex(OPENSSL_CTX *libctx, const char *filename,
+int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
const char *appname, unsigned long flags);
int CONF_modules_load_file(const char *filename, const char *appname,
unsigned long flags);
typedef struct ossl_crmf_optionalvalidity_st OSSL_CRMF_OPTIONALVALIDITY;
/* crmf_pbm.c */
-OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OPENSSL_CTX *libctx, size_t slen,
+OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t slen,
int owfnid, size_t itercnt,
int macnid);
-int OSSL_CRMF_pbm_new(OPENSSL_CTX *libctx, const char *propq,
+int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
const OSSL_CRMF_PBMPARAMETER *pbmp,
const unsigned char *msg, size_t msglen,
const unsigned char *sec, size_t seclen,
# define OSSL_CRMF_POPO_KEYAGREE 3
int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
EVP_PKEY *pkey, const EVP_MD *digest,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
int rid, int acceptRAVerified,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
OSSL_CRMF_CERTTEMPLATE *OSSL_CRMF_MSG_get0_tmpl(const OSSL_CRMF_MSG *crm);
ASN1_INTEGER
*OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl);
const ASN1_INTEGER *serial);
X509
*OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
EVP_PKEY *pkey);
# ifdef __cplusplus
int OPENSSL_issetugid(void);
struct crypto_ex_data_st {
- OPENSSL_CTX *ctx;
+ OSSL_LIB_CTX *ctx;
STACK_OF(void) *sk;
};
# define CRYPTO_EX_INDEX_UI_METHOD 14
# define CRYPTO_EX_INDEX_RAND_DRBG 15
# define CRYPTO_EX_INDEX_DRBG CRYPTO_EX_INDEX_RAND_DRBG
-# define CRYPTO_EX_INDEX_OPENSSL_CTX 16
+# define CRYPTO_EX_INDEX_OSSL_LIB_CTX 16
# define CRYPTO_EX_INDEX_EVP_PKEY 17
# define CRYPTO_EX_INDEX__COUNT 18
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
int OPENSSL_atexit(void (*handler)(void));
void OPENSSL_thread_stop(void);
-void OPENSSL_thread_stop_ex(OPENSSL_CTX *ctx);
+void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx);
/* Low-level control of initialization */
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
-OPENSSL_CTX *OPENSSL_CTX_new(void);
-int OPENSSL_CTX_load_config(OPENSSL_CTX *ctx, const char *config_file);
-void OPENSSL_CTX_free(OPENSSL_CTX *);
-OPENSSL_CTX *OPENSSL_CTX_set0_default(OPENSSL_CTX *libctx);
+OSSL_LIB_CTX *OSSL_LIB_CTX_new(void);
+int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file);
+void OSSL_LIB_CTX_free(OSSL_LIB_CTX *);
+OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx);
# ifdef __cplusplus
}
* The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished
* with the CT_POLICY_EVAL_CTX.
*/
-CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OPENSSL_CTX *libctx,
+CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
const char *propq);
/*
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
* Should be deleted by the caller using CTLOG_free when no longer needed.
*/
-CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OPENSSL_CTX *libctx,
+CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx,
const char *propq);
/*
* Should be deleted by the caller using CTLOG_free when no longer needed.
*/
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
- const char *name, OPENSSL_CTX *libctx,
+ const char *name, OSSL_LIB_CTX *libctx,
const char *propq);
/*
* property query string.
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
*/
-CTLOG_STORE *CTLOG_STORE_new_ex(OPENSSL_CTX *libctx, const char *propq);
+CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
/*
* Same as CTLOG_STORE_new_ex except that the default libctx and
extern "C" {
# endif
-OSSL_DECODER *OSSL_DECODER_fetch(OPENSSL_CTX *libctx, const char *name,
+OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
const char *properties);
int OSSL_DECODER_up_ref(OSSL_DECODER *encoder);
void OSSL_DECODER_free(OSSL_DECODER *encoder);
int OSSL_DECODER_number(const OSSL_DECODER *encoder);
int OSSL_DECODER_is_a(const OSSL_DECODER *encoder, const char *name);
-void OSSL_DECODER_do_all_provided(OPENSSL_CTX *libctx,
+void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_DECODER *encoder, void *arg),
void *arg);
void OSSL_DECODER_names_do_all(const OSSL_DECODER *encoder,
const char *input_type);
int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder);
int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx);
typedef struct ossl_decoder_instance_st OSSL_DECODER_INSTANCE;
OSSL_DECODER_CTX *
OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey,
const char *input_type, const char *keytype,
- OPENSSL_CTX *libctx, const char *propquery);
+ OSSL_LIB_CTX *libctx, const char *propquery);
# ifdef __cplusplus
}
* if an error occurred
*/
EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
/**
* Creates a EC_GROUP object with a curve specified by a NID
* \return newly created EC_GROUP object with specified curve or NULL
* if an error occurred
*/
-EC_GROUP *EC_GROUP_new_by_curve_name_ex(OPENSSL_CTX *libctx, const char *propq,
+EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
int nid);
/**
* which case the default library context is used.
* \return EC_KEY object or NULL if an error occurred.
*/
-EC_KEY *EC_KEY_new_ex(OPENSSL_CTX *ctx, const char *propq);
+EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq);
/**
* Creates a new EC_KEY object. Same as calling EC_KEY_new_ex with a
* \param nid NID of the named curve.
* \return EC_KEY object or NULL if an error occurred.
*/
-EC_KEY *EC_KEY_new_by_curve_name_ex(OPENSSL_CTX *ctx, const char *propq,
+EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, const char *propq,
int nid);
/**
extern "C" {
# endif
-OSSL_ENCODER *OSSL_ENCODER_fetch(OPENSSL_CTX *libctx, const char *name,
+OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
const char *properties);
int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
int OSSL_ENCODER_number(const OSSL_ENCODER *encoder);
int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
-void OSSL_ENCODER_do_all_provided(OPENSSL_CTX *libctx,
+void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_ENCODER *encoder, void *arg),
void *arg);
void OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
/* Utilities to add encoders */
int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder);
int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx);
typedef struct ossl_encoder_instance_st OSSL_ENCODER_INSTANCE;
OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey,
const char *output_type,
int selection,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propquery);
# ifdef __cplusplus
extern "C" {
#endif
-int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq);
-int EVP_default_properties_is_fips_enabled(OPENSSL_CTX *libctx);
-int EVP_default_properties_enable_fips(OPENSSL_CTX *libctx, int enable);
+int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq);
+int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx);
+int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable);
# define EVP_PKEY_MO_SIGN 0x0001
# define EVP_PKEY_MO_VERIFY 0x0002
int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
int EVP_CIPHER_mode(const EVP_CIPHER *cipher);
-EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_CIPHER_up_ref(EVP_CIPHER *cipher);
void EVP_CIPHER_free(EVP_CIPHER *cipher);
__owur int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md,
size_t len);
-__owur EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+__owur EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_MD_up_ref(EVP_MD *md);
__owur int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
EVP_PKEY *pkey);
__owur int EVP_SignFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
- EVP_PKEY *pkey, OPENSSL_CTX *libctx,
+ EVP_PKEY *pkey, OSSL_LIB_CTX *libctx,
const char *propq);
__owur int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret,
unsigned int siglen, EVP_PKEY *pkey);
__owur int EVP_VerifyFinal_ex(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
unsigned int siglen, EVP_PKEY *pkey,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
__owur int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret,
size_t siglen, const unsigned char *tbs,
size_t tbslen);
int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const char *mdname, OPENSSL_CTX *libctx,
+ const char *mdname, OSSL_LIB_CTX *libctx,
const char *props, EVP_PKEY *pkey);
/*__owur*/ int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e,
size_t *siglen);
int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const char *mdname, OPENSSL_CTX *libctx,
+ const char *mdname, OSSL_LIB_CTX *libctx,
const char *props, EVP_PKEY *pkey);
__owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e,
void EVP_CIPHER_do_all_sorted(void (*fn)
(const EVP_CIPHER *ciph, const char *from,
const char *to, void *x), void *arg);
-void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_CIPHER *cipher, void *arg),
void *arg);
void EVP_MD_do_all_sorted(void (*fn)
(const EVP_MD *ciph, const char *from,
const char *to, void *x), void *arg);
-void EVP_MD_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_MD_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MD *md, void *arg),
void *arg);
/* MAC stuff */
-EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
int EVP_MAC_up_ref(EVP_MAC *mac);
void EVP_MAC_free(EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
-void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MAC *mac, void *arg),
void *arg);
void EVP_MAC_names_do_all(const EVP_MAC *mac,
void *data);
/* RAND stuff */
-EVP_RAND *EVP_RAND_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
int EVP_RAND_up_ref(EVP_RAND *rand);
void EVP_RAND_free(EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand);
-void EVP_RAND_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_RAND *rand, void *arg),
void *arg);
void EVP_RAND_names_do_all(const EVP_RAND *rand,
EVP_PKEY *d2i_PrivateKey_ex(int type, EVP_PKEY **a, const unsigned char **pp,
- long length, OPENSSL_CTX *libctx, const char *propq);
+ long length, OSSL_LIB_CTX *libctx,
+ const char *propq);
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
long length);
EVP_PKEY *d2i_AutoPrivateKey_ex(EVP_PKEY **a, const unsigned char **pp,
- long length, OPENSSL_CTX *libctx,
+ long length, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
long length);
DEPRECATEDIN_3_0(size_t EVP_PKEY_meth_get_count(void))
DEPRECATEDIN_3_0(const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx))
-EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt);
void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt);
const char *EVP_KEYMGMT_get0_first_name(const EVP_KEYMGMT *keymgmt);
int EVP_KEYMGMT_number(const EVP_KEYMGMT *keymgmt);
int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name);
-void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
void *arg);
void EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt,
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
-EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OPENSSL_CTX *libctx,
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx,
const char *name,
const char *propquery);
-EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OPENSSL_CTX *libctx,
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx,
EVP_PKEY *pkey, const char *propquery);
EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx);
void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
const unsigned char *key, int keylen);
-EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OPENSSL_CTX *libctx,
+EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *priv, size_t len);
EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
const unsigned char *priv,
size_t len);
-EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OPENSSL_CTX *libctx,
+EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype, const char *propq,
const unsigned char *pub, size_t len);
EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
size_t *len);
EVP_PKEY *EVP_PKEY_new_CMAC_key_ex(const unsigned char *priv, size_t len,
- const char *cipher_name, OPENSSL_CTX *libctx,
+ const char *cipher_name, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
size_t len, const EVP_CIPHER *cipher);
void EVP_SIGNATURE_free(EVP_SIGNATURE *signature);
int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature);
OSSL_PROVIDER *EVP_SIGNATURE_provider(const EVP_SIGNATURE *signature);
-EVP_SIGNATURE *EVP_SIGNATURE_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name);
int EVP_SIGNATURE_number(const EVP_SIGNATURE *signature);
-void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_SIGNATURE *signature,
void *data),
void *data);
void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher);
OSSL_PROVIDER *EVP_ASYM_CIPHER_provider(const EVP_ASYM_CIPHER *cipher);
-EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name);
int EVP_ASYM_CIPHER_number(const EVP_ASYM_CIPHER *cipher);
-void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_ASYM_CIPHER *cipher,
void *arg),
void *arg);
void EVP_KEM_free(EVP_KEM *wrap);
int EVP_KEM_up_ref(EVP_KEM *wrap);
OSSL_PROVIDER *EVP_KEM_provider(const EVP_KEM *wrap);
-EVP_KEM *EVP_KEM_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_KEM_is_a(const EVP_KEM *wrap, const char *name);
int EVP_KEM_number(const EVP_KEM *wrap);
-void EVP_KEM_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEM *wrap, void *arg), void *arg);
void EVP_KEM_names_do_all(const EVP_KEM *wrap,
void (*fn)(const char *name, void *data), void *data);
void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
-EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm,
+EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange);
int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name);
int EVP_KEYEXCH_number(const EVP_KEYEXCH *keyexch);
-void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYEXCH *keyexch, void *data),
void *data);
void EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *keyexch,
int EVP_PKEY_CTX_set_group_name(EVP_PKEY_CTX *ctx, const char *name);
int EVP_PKEY_CTX_get_group_name(EVP_PKEY_CTX *ctx, char *name, size_t namelen);
-OPENSSL_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx);
+OSSL_LIB_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx);
const char *EVP_PKEY_CTX_get0_propq(EVP_PKEY_CTX *ctx);
# ifdef __cplusplus
int EVP_KDF_up_ref(EVP_KDF *kdf);
void EVP_KDF_free(EVP_KDF *kdf);
-EVP_KDF *EVP_KDF_fetch(OPENSSL_CTX *libctx, const char *algorithm,
+EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
-void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx,
+void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KDF *kdf, void *arg),
void *arg);
void EVP_KDF_names_do_all(const EVP_KDF *kdf,
STACK_OF(X509) *certs, unsigned long flags);
int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
-int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OPENSSL_CTX *libctx,
+int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
const char *propq);
int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
pem_password_cb *cb, void *u);
STACK_OF(X509_INFO)
*PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
- pem_password_cb *cb, void *u, OPENSSL_CTX *libctx,
+ pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx,
const char *propq);
int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc,
pem_password_cb *cb, void *u);
STACK_OF(X509_INFO)
*PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx, const char *propq);
+ void *u, OSSL_LIB_CTX *libctx, const char *propq);
#endif
int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
EVP_PKEY *PEM_read_bio_PrivateKey_ex(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
# ifndef OPENSSL_NO_STDIO
EVP_PKEY *PEM_read_PrivateKey_ex(FILE *fp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
# endif
DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
EVP_PKEY *PEM_read_bio_PUBKEY_ex(BIO *bp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
# ifndef OPENSSL_NO_STDIO
EVP_PKEY *PEM_read_PUBKEY_ex(FILE *fp, EVP_PKEY **x,
pem_password_cb *cb, void *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
# endif
int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
pem_password_cb *cd, void *u);
# endif
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);
*/
typedef struct PKCS7_CTX_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
} PKCS7_CTX;
DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
DECLARE_ASN1_FUNCTIONS(PKCS7)
-PKCS7 *PKCS7_new_ex(OPENSSL_CTX *libctx, const char *propq);
+PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, int flags);
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
- BIO *data, int flags, OPENSSL_CTX *libctx,
+ BIO *data, int flags, OSSL_LIB_CTX *libctx,
const char *propq);
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
int flags);
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
const EVP_CIPHER *cipher, int flags,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
int flags);
# endif
/* Set the default provider search path */
-int OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *, const char *path);
+int OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *, const char *path);
/* Load and unload a provider */
-OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name);
-OSSL_PROVIDER *OSSL_PROVIDER_try_load(OPENSSL_CTX *, const char *name);
+OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *, const char *name);
+OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
-int OSSL_PROVIDER_available(OPENSSL_CTX *, const char *name);
-int OSSL_PROVIDER_do_all(OPENSSL_CTX *ctx,
+int OSSL_PROVIDER_available(OSSL_LIB_CTX *, const char *name);
+int OSSL_PROVIDER_do_all(OSSL_LIB_CTX *ctx,
int (*cb)(OSSL_PROVIDER *provider, void *cbdata),
void *cbdata);
void *OSSL_PROVIDER_get0_provider_ctx(const OSSL_PROVIDER *prov);
/* Add a built in providers */
-int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *, const char *name,
+int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *, const char *name,
OSSL_provider_init_fn *init_fn);
/* Information */
int RAND_bytes(unsigned char *buf, int num);
int RAND_priv_bytes(unsigned char *buf, int num);
-/* Equivalent of RAND_priv_bytes() but additionally taking an OPENSSL_CTX */
-int RAND_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
+/* Equivalent of RAND_priv_bytes() but additionally taking an OSSL_LIB_CTX */
+int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num);
-/* Equivalent of RAND_bytes() but additionally taking an OPENSSL_CTX */
-int RAND_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
+/* Equivalent of RAND_bytes() but additionally taking an OSSL_LIB_CTX */
+int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num);
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
-EVP_RAND_CTX *RAND_get0_primary(OPENSSL_CTX *ctx);
-EVP_RAND_CTX *RAND_get0_public(OPENSSL_CTX *ctx);
-EVP_RAND_CTX *RAND_get0_private(OPENSSL_CTX *ctx);
+EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx);
+EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx);
+EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx);
void RAND_seed(const void *buf, int num);
void RAND_keep_random_devices_open(int keep);
}
# endif
-void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK *cb,
+void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK *cb,
void *cbarg);
-void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK **cb,
+void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK **cb,
void **cbarg);
OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg);
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g);
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N,
- const BIGNUM *g, OPENSSL_CTX *libctx,
+ const BIGNUM *g, OSSL_LIB_CTX *libctx,
const char *propq);
int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N,
BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
const BIGNUM *b, const BIGNUM *N);
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
- const BIGNUM *v, OPENSSL_CTX *libctx, const char *propq);
+ const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
const BIGNUM *v);
int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N);
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
/* client side .... */
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N);
__owur int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str);
__owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
-__owur SSL_CTX *SSL_CTX_new_ex(OPENSSL_CTX *libctx, const char *propq,
+__owur SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
const SSL_METHOD *meth);
int SSL_CTX_up_ref(SSL_CTX *ctx);
void SSL_CTX_free(SSL_CTX *);
__owur int SSL_use_certificate_chain_file(SSL *ssl, const char *file);
__owur STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
__owur STACK_OF(X509_NAME)
-*SSL_load_client_CA_file_ex(const char *file, OPENSSL_CTX *libctx,
+*SSL_load_client_CA_file_ex(const char *file, OSSL_LIB_CTX *libctx,
const char *propq);
__owur int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
const char *file);
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
OSSL_STORE_CTX *
-OSSL_STORE_open_ex(const char *uri, OPENSSL_CTX *libctx, const char *propq,
+OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
* BIO actually reads.
*/
OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bio, const char *scheme,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(const char *scheme,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *properties);
int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader);
void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader,
const char *scheme);
-void OSSL_STORE_LOADER_do_all_provided(OPENSSL_CTX *libctx,
+void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(OSSL_STORE_LOADER *loader,
void *arg),
void *arg);
const UI_METHOD *ui_method, void *ui_data);
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_ex_fn)
(const OSSL_STORE_LOADER *loader,
- const char *uri, OPENSSL_CTX *libctx, const char *propq,
+ const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data);
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)
(const OSSL_STORE_LOADER *loader, BIO *bio,
- OPENSSL_CTX *libctx, const char *propq,
+ OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data);
typedef int (*OSSL_STORE_ctrl_fn)
(OSSL_STORE_LOADER_CTX *ctx, int cmd, va_list args);
typedef struct ossl_store_info_st OSSL_STORE_INFO;
typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
-typedef struct openssl_ctx_st OPENSSL_CTX;
+typedef struct ossl_lib_ctx_st OSSL_LIB_CTX;
typedef struct ossl_dispatch_st OSSL_DISPATCH;
typedef struct ossl_item_st OSSL_ITEM;
int X509_verify(X509 *a, EVP_PKEY *r);
int X509_self_signed(X509 *cert, int verify_signature);
-int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OPENSSL_CTX *libctx,
+int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx,
const char *propq);
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, const PKCS8_PRIV_KEY_INFO *p8inf);
int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key);
int i2d_PrivateKey_fp(FILE *fp, const EVP_PKEY *pkey);
-EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OPENSSL_CTX *libctx,
+EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey);
int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, const PKCS8_PRIV_KEY_INFO *p8inf);
int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key);
int i2d_PrivateKey_bio(BIO *bp, const EVP_PKEY *pkey);
-EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OPENSSL_CTX *libctx,
+EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
const char *propq);
EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey);
long X509_get_pathlen(X509 *x);
DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY)
EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
# ifndef OPENSSL_NO_RSA
DECLARE_ASN1_ENCODE_FUNCTIONS_only(RSA, RSA_PUBKEY)
# endif
DECLARE_ASN1_FUNCTIONS(X509_CINF)
DECLARE_ASN1_FUNCTIONS(X509)
-X509 *X509_new_ex(OPENSSL_CTX *libctx, const char *propq);
+X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
#define X509_get_ex_new_index(l, p, newf, dupf, freef) \
DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8);
-EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OPENSSL_CTX *libctx,
+EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
const char *propq);
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey);
int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data);
void *X509_STORE_get_ex_data(const X509_STORE *ctx, int idx);
-X509_STORE_CTX *X509_STORE_CTX_new_ex(OPENSSL_CTX *libctx, const char *propq);
+X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
X509_STORE_CTX *X509_STORE_CTX_new(void);
int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
long argl, char **ret);
typedef int (*X509_LOOKUP_ctrl_ex_fn)(
X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx,
X509_LOOKUP_TYPE type,
X509_LOOKUP_TYPE type,
const X509_NAME *name,
X509_OBJECT *ret,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq);
typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx,
X509_LOOKUP_TYPE type,
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
- char **ret, OPENSSL_CTX *libctx, const char *propq);
+ char **ret, OSSL_LIB_CTX *libctx, const char *propq);
int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
void X509_LOOKUP_free(X509_LOOKUP *ctx);
const X509_NAME *name, X509_OBJECT *ret);
int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name, X509_OBJECT *ret,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const X509_NAME *name,
const ASN1_INTEGER *serial,
int X509_STORE_set_default_paths(X509_STORE *ctx);
int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_STORE_load_store_ex(X509_STORE *ctx, const char *store,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
- const char *dir, OPENSSL_CTX *libctx,
+ const char *dir, OSSL_LIB_CTX *libctx,
const char *propq);
-int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OPENSSL_CTX *libctx,
+int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
const char *propq);
#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \
return 0;
}
ossl_prov_ctx_set0_library_context(*provctx,
- (OPENSSL_CTX *)c_get_libctx(handle));
+ (OSSL_LIB_CTX *)c_get_libctx(handle));
ossl_prov_ctx_set0_handle(*provctx, handle);
ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
typedef struct prov_ctx_st {
const OSSL_CORE_HANDLE *handle;
- OPENSSL_CTX *libctx; /* For all provider modules */
+ OSSL_LIB_CTX *libctx; /* For all provider modules */
BIO_METHOD *corebiometh;
} PROV_CTX;
PROV_CTX *ossl_prov_ctx_new(void);
void ossl_prov_ctx_free(PROV_CTX *ctx);
-void ossl_prov_ctx_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx);
+void ossl_prov_ctx_set0_library_context(PROV_CTX *ctx, OSSL_LIB_CTX *libctx);
void ossl_prov_ctx_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle);
void ossl_prov_ctx_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh);
-OPENSSL_CTX *ossl_prov_ctx_get0_library_context(PROV_CTX *ctx);
+OSSL_LIB_CTX *ossl_prov_ctx_get0_library_context(PROV_CTX *ctx);
const OSSL_CORE_HANDLE *ossl_prov_ctx_get0_handle(PROV_CTX *ctx);
BIO_METHOD *ossl_prov_ctx_get0_core_bio_method(PROV_CTX *ctx);
*/
int ossl_prov_cipher_load_from_params(PROV_CIPHER *pc,
const OSSL_PARAM params[],
- OPENSSL_CTX *ctx);
+ OSSL_LIB_CTX *ctx);
/* Reset the PROV_CIPHER fields and free any allocated cipher reference */
void ossl_prov_cipher_reset(PROV_CIPHER *pc);
* Fetch a digest from the specified libctx using the provided mdname and
* propquery. Store the result in the PROV_DIGEST and return the fetched md.
*/
-const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OPENSSL_CTX *libctx,
+const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OSSL_LIB_CTX *libctx,
const char *mdname, const char *propquery);
/*
*/
int ossl_prov_digest_load_from_params(PROV_DIGEST *pd,
const OSSL_PARAM params[],
- OPENSSL_CTX *ctx);
+ OSSL_LIB_CTX *ctx);
/* Reset the PROV_DIGEST fields and free any allocated digest reference */
void ossl_prov_digest_reset(PROV_DIGEST *pd);
const char *macname,
const char *ciphername,
const char *mdname,
- OPENSSL_CTX *ctx);
+ OSSL_LIB_CTX *ctx);
typedef struct ag_capable_st {
OSSL_ALGORITHM alg;
#include <openssl/provider.h>
#include <openssl/core_dispatch.h>
-const OSSL_CORE_HANDLE *FIPS_get_core_handle(OPENSSL_CTX *ctx);
+const OSSL_CORE_HANDLE *FIPS_get_core_handle(OSSL_LIB_CTX *ctx);
const char *ossl_prov_util_nid_to_name(int nid);
OPENSSL_free(ctx);
}
-void ossl_prov_ctx_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx)
+void ossl_prov_ctx_set0_library_context(PROV_CTX *ctx, OSSL_LIB_CTX *libctx)
{
if (ctx != NULL)
ctx->libctx = libctx;
ctx->corebiometh = corebiometh;
}
-OPENSSL_CTX *ossl_prov_ctx_get0_library_context(PROV_CTX *ctx)
+OSSL_LIB_CTX *ossl_prov_ctx_get0_library_context(PROV_CTX *ctx)
{
if (ctx == NULL)
return NULL;
int ossl_prov_cipher_load_from_params(PROV_CIPHER *pc,
const OSSL_PARAM params[],
- OPENSSL_CTX *ctx)
+ OSSL_LIB_CTX *ctx)
{
const OSSL_PARAM *p;
const char *propquery;
return 1;
}
-const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OPENSSL_CTX *libctx,
+const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OSSL_LIB_CTX *libctx,
const char *mdname, const char *propquery)
{
EVP_MD_free(pd->alloc_md);
int ossl_prov_digest_load_from_params(PROV_DIGEST *pd,
const OSSL_PARAM params[],
- OPENSSL_CTX *ctx)
+ OSSL_LIB_CTX *ctx)
{
const OSSL_PARAM *p;
const char *propquery;
const char *macname,
const char *ciphername,
const char *mdname,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
const OSSL_PARAM *p;
const char *properties = NULL;
return 0;
}
ossl_prov_ctx_set0_library_context(*provctx,
- (OPENSSL_CTX *)c_get_libctx(handle));
+ (OSSL_LIB_CTX *)c_get_libctx(handle));
ossl_prov_ctx_set0_handle(*provctx, handle);
ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
* TODO(3.0): Should these be stored in the provider side provctx? Could they
* ever be different from one init to the next? Unfortunately we can't do this
* at the moment because c_put_error/c_add_error_vdata do not provide
- * us with the OPENSSL_CTX as a parameter.
+ * us with the OSSL_LIB_CTX as a parameter.
*/
static SELF_TEST_POST_PARAMS selftest_params;
const OSSL_CORE_HANDLE *handle;
} FIPS_GLOBAL;
-static void *fips_prov_ossl_ctx_new(OPENSSL_CTX *libctx)
+static void *fips_prov_ossl_ctx_new(OSSL_LIB_CTX *libctx)
{
FIPS_GLOBAL *fgbl = OPENSSL_zalloc(sizeof(*fgbl));
OPENSSL_free(fgbl);
}
-static const OPENSSL_CTX_METHOD fips_prov_ossl_ctx_method = {
+static const OSSL_LIB_CTX_METHOD fips_prov_ossl_ctx_method = {
fips_prov_ossl_ctx_new,
fips_prov_ossl_ctx_free,
};
static void fips_teardown(void *provctx)
{
- OPENSSL_CTX_free(PROV_LIBRARY_CONTEXT_OF(provctx));
+ OSSL_LIB_CTX_free(PROV_LIBRARY_CONTEXT_OF(provctx));
ossl_prov_ctx_free(provctx);
}
void **provctx)
{
FIPS_GLOBAL *fgbl;
- OPENSSL_CTX *libctx = NULL;
+ OSSL_LIB_CTX *libctx = NULL;
for (; in->function_id != 0; in++) {
switch (in->function_id) {
/* Create a context. */
if ((*provctx = ossl_prov_ctx_new()) == NULL
- || (libctx = OPENSSL_CTX_new()) == NULL) {
+ || (libctx = OSSL_LIB_CTX_new()) == NULL) {
/*
* We free libctx separately here and only here because it hasn't
* been attached to *provctx. All other error paths below rely
* solely on fips_teardown.
*/
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
goto err;
}
ossl_prov_ctx_set0_library_context(*provctx, libctx);
ossl_prov_ctx_set0_handle(*provctx, handle);
- if ((fgbl = openssl_ctx_get_data(libctx, OPENSSL_CTX_FIPS_PROV_INDEX,
- &fips_prov_ossl_ctx_method)) == NULL)
+ if ((fgbl = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_FIPS_PROV_INDEX,
+ &fips_prov_ossl_ctx_method)) == NULL)
goto err;
fgbl->handle = handle;
* able to do.
*/
ossl_prov_ctx_set0_library_context(
- *provctx, (OPENSSL_CTX *)c_internal_get_libctx(handle)
+ *provctx, (OSSL_LIB_CTX *)c_internal_get_libctx(handle)
);
ossl_prov_ctx_set0_handle(*provctx, handle);
/*
* This must take a library context, since it's called from the depths
* of crypto/initthread.c code, where it's (correctly) assumed that the
- * passed caller argument is an OPENSSL_CTX pointer (since the same routine
+ * passed caller argument is an OSSL_LIB_CTX pointer (since the same routine
* is also called from other parts of libcrypto, which all pass around a
- * OPENSSL_CTX pointer)
+ * OSSL_LIB_CTX pointer)
*/
-const OSSL_CORE_HANDLE *FIPS_get_core_handle(OPENSSL_CTX *libctx)
+const OSSL_CORE_HANDLE *FIPS_get_core_handle(OSSL_LIB_CTX *libctx)
{
- FIPS_GLOBAL *fgbl = openssl_ctx_get_data(libctx,
- OPENSSL_CTX_FIPS_PROV_INDEX,
- &fips_prov_ossl_ctx_method);
+ FIPS_GLOBAL *fgbl = ossl_lib_ctx_get_data(libctx,
+ OSSL_LIB_CTX_FIPS_PROV_INDEX,
+ &fips_prov_ossl_ctx_method);
if (fgbl == NULL)
return NULL;
return fips_security_checks;
}
-void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK **cb,
+void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK **cb,
void **cbarg)
{
if (libctx == NULL)
/*
* We're cheating here. Normally we don't allow RUN_ONCE usage inside the FIPS
* module because all such initialisation should be associated with an
- * individual OPENSSL_CTX. That doesn't work with the self test though because
- * it should be run once regardless of the number of OPENSSL_CTXs we have.
+ * individual OSSL_LIB_CTX. That doesn't work with the self test though because
+ * it should be run once regardless of the number of OSSL_LIB_CTXs we have.
*/
#define ALLOW_RUN_ONCE_IN_FIPS
#include <internal/thread_once.h>
*/
static int verify_integrity(OSSL_CORE_BIO *bio, OSSL_FUNC_BIO_read_ex_fn read_ex_cb,
unsigned char *expected, size_t expected_len,
- OPENSSL_CTX *libctx, OSSL_SELF_TEST *ev,
+ OSSL_LIB_CTX *libctx, OSSL_SELF_TEST *ev,
const char *event_type)
{
int ret = 0, status;
OSSL_FUNC_BIO_free_fn *bio_free_cb;
OSSL_CALLBACK *cb;
void *cb_arg;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
} SELF_TEST_POST_PARAMS;
int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test);
-int SELF_TEST_kats(OSSL_SELF_TEST *event, OPENSSL_CTX *libctx);
+int SELF_TEST_kats(OSSL_SELF_TEST *event, OSSL_LIB_CTX *libctx);
void SELF_TEST_disable_conditional_error_state(void);
#include "self_test_data.inc"
static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_SELF_TEST *st,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
int ok = 0;
unsigned char out[EVP_MAX_MD_SIZE];
/* Test a single KAT for encrypt/decrypt */
static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_SELF_TEST *st,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
int ret = 0, encrypt = 1, len, ct_len = 0, pt_len = 0;
EVP_CIPHER_CTX *ctx = NULL;
}
static int self_test_kdf(const ST_KAT_KDF *t, OSSL_SELF_TEST *st,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
int ret = 0;
unsigned char out[64];
}
static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
int ret = 0;
unsigned char out[256];
}
static int self_test_ka(const ST_KAT_KAS *t,
- OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+ OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int ret = 0;
EVP_PKEY_CTX *kactx = NULL, *dctx = NULL;
}
static int self_test_sign(const ST_KAT_SIGN *t,
- OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+ OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int ret = 0;
OSSL_PARAM *params = NULL, *params_sig = NULL;
* and decrypt..
*/
static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER *t, OSSL_SELF_TEST *st,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
int ret = 0;
OSSL_PARAM *keyparams = NULL, *initparams = NULL;
* All tests are run regardless of if they fail or not.
* Return 0 if any test fails.
*/
-static int self_test_digests(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_digests(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
return ret;
}
-static int self_test_ciphers(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_ciphers(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
return ret;
}
-static int self_test_asym_ciphers(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_asym_ciphers(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
return ret;
}
-static int self_test_kdfs(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_kdfs(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
return ret;
}
-static int self_test_drbgs(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_drbgs(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
return ret;
}
-static int self_test_kas(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_kas(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
return ret;
}
-static int self_test_signatures(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+static int self_test_signatures(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int i, ret = 1;
* Return 1 is successful, otherwise return 0.
* This runs all the tests regardless of if any fail.
*/
-int SELF_TEST_kats(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx)
+int SELF_TEST_kats(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
{
int ret = 1;
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
RSA *rsa;
int pad_mode;
int operation;
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
EC_KEY *key;
PROV_DIGEST md;
} PROV_SM2_CTX;
EVP_CIPHER *ctr; /* These are fetched - so we need to free them */
EVP_CIPHER *cbc;
const PROV_CIPHER_HW_AES_SIV *hw;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
} PROV_AES_SIV_CTX;
const PROV_CIPHER_HW_AES_SIV *ossl_prov_cipher_hw_aes_siv(size_t keybits);
PROV_AES_SIV_CTX *ctx = (PROV_AES_SIV_CTX *)vctx;
SIV128_CONTEXT *sctx = &ctx->siv;
size_t klen = keylen / 2;
- OPENSSL_CTX *libctx = ctx->libctx;
+ OSSL_LIB_CTX *libctx = ctx->libctx;
const char *propq = NULL;
EVP_CIPHER_free(ctx->cbc);
unsigned char **mac,
int *alloced,
size_t block_size, size_t mac_size,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
int tls1_cbc_remove_padding_and_mac(size_t *reclen,
size_t origreclen,
int *alloced,
size_t block_size, size_t mac_size,
int aead,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
/*
* Fills a single block of buffered data from the input, and returns the amount
* 1: (in constant time) Record is publicly valid. If padding is invalid then
* the mac is random
*/
-int tlsunpadblock(OPENSSL_CTX *libctx, unsigned int tlsversion,
+int tlsunpadblock(OSSL_LIB_CTX *libctx, unsigned int tlsversion,
unsigned char *buf, size_t *buflen, size_t blocksize,
unsigned char **mac, int *alloced, size_t macsize, int aead)
{
void padblock(unsigned char *buf, size_t *buflen, size_t blocksize);
int unpadblock(unsigned char *buf, size_t *buflen, size_t blocksize);
-int tlsunpadblock(OPENSSL_CTX *libctx, unsigned int tlsversion,
+int tlsunpadblock(OSSL_LIB_CTX *libctx, unsigned int tlsversion,
unsigned char *buf, size_t *buflen, size_t blocksize,
unsigned char **mac, int *alloced, size_t macsize, int aead);
static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
struct key2any_ctx_st *ctx = vctx;
- OPENSSL_CTX *libctx = ossl_prov_ctx_get0_library_context(ctx->provctx);
+ OSSL_LIB_CTX *libctx = ossl_prov_ctx_get0_library_context(ctx->provctx);
const OSSL_PARAM *cipherp =
OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER);
const OSSL_PARAM *propsp =
/* Print explicit parameters */
static int ec_param_explicit_to_text(BIO *out, const EC_GROUP *group,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
int ret = 0, tmp_nid;
BN_CTX *ctx = NULL;
}
static int ec_param_to_text(BIO *out, const EC_GROUP *group,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
if (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE) {
const char *curve_name;
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
DH *dh;
DH *dhpeer;
unsigned int pad : 1;
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
EC_KEY *k;
EC_KEY *peerk;
unsigned char iv[GENERIC_BLOCK_SIZE];
const PROV_CIPHER_HW *hw; /* hardware specific functions */
const void *ks; /* Pointer to algorithm specific key data */
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
};
struct prov_cipher_hw_st {
unsigned char iv[GCM_IV_MAX_SIZE]; /* Buffer to use for IV's */
unsigned char buf[AES_BLOCK_SIZE]; /* Buffer of partial blocks processed via update calls */
- OPENSSL_CTX *libctx; /* needed for rand calls */
+ OSSL_LIB_CTX *libctx; /* needed for rand calls */
const PROV_GCM_HW *hw; /* hardware specific methods */
GCM128_CONTEXT gcm;
ctr128_f ctr;
#include "internal/refcount.h"
struct kdf_data_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
CRYPTO_REF_COUNT refcnt;
CRYPTO_RWLOCK *lock;
};
struct mac_key_st {
CRYPTO_RWLOCK *lock;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
CRYPTO_REF_COUNT refcnt;
unsigned char *priv_key;
size_t priv_key_len;
typedef struct mac_key_st MAC_KEY;
-MAC_KEY *mac_key_new(OPENSSL_CTX *libctx, int cmac);
+MAC_KEY *mac_key_new(OSSL_LIB_CTX *libctx, int cmac);
void mac_key_free(MAC_KEY *mackey);
int mac_key_up_ref(MAC_KEY *mackey);
{
const OSSL_PARAM *p;
KDF_HKDF *ctx = vctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
int n;
if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
static int kbkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
KBKDF *ctx = (KBKDF *)vctx;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
const OSSL_PARAM *p;
OSSL_PARAM mparams[2];
{
const OSSL_PARAM *p;
KRB5KDF_CTX *ctx = vctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
if (!ossl_prov_cipher_load_from_params(&ctx->cipher, params, provctx))
return 0;
static void kdf_pbkdf2_init(KDF_PBKDF2 *ctx)
{
OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
params[0] = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
SN_sha1, 0);
{
const OSSL_PARAM *p;
KDF_PBKDF2 *ctx = vctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
int pkcs5;
uint64_t iter, min_iter;
{
const OSSL_PARAM *p;
KDF_PKCS12 *ctx = vctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
return 0;
const unsigned char *salt, size_t saltlen,
uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem,
unsigned char *key, size_t keylen, EVP_MD *sha256,
- OPENSSL_CTX *libctx, const char *propq);
+ OSSL_LIB_CTX *libctx, const char *propq);
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
unsigned char *pass;
size_t pass_len;
const unsigned char *salt, size_t saltlen,
uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem,
unsigned char *key, size_t keylen, EVP_MD *sha256,
- OPENSSL_CTX *libctx, const char *propq)
+ OSSL_LIB_CTX *libctx, const char *propq)
{
int rv = 0;
unsigned char *B;
{
const OSSL_PARAM *p;
KDF_SSHKDF *ctx = vctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
int t;
if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
{
const OSSL_PARAM *p;
KDF_SSKDF *ctx = vctx;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
size_t sz;
if (!ossl_prov_digest_load_from_params(&ctx->digest, params, libctx))
{
const OSSL_PARAM *p;
TLS1_PRF *ctx = vctx;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_DIGEST)) != NULL) {
if (strcasecmp(p->data, SN_md5_sha1) == 0) {
#endif
};
-static int find_alg_id(OPENSSL_CTX *libctx, const char *algname,
+static int find_alg_id(OSSL_LIB_CTX *libctx, const char *algname,
const char *propq, size_t *id)
{
int ret = 1;
{
const OSSL_PARAM *p, *pq;
KDF_X942 *ctx = vctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
const char *propq = NULL;
size_t id;
* we use that here too.
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
RSA *rsa;
int op;
} PROV_RSA_CTX;
(OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
struct dh_gen_ctx {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
FFC_PARAMS *ffc_params;
int selection;
static void *dh_gen_init_base(void *provctx, int selection, int type)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
struct dh_gen_ctx *gctx = NULL;
if (!ossl_prov_is_running())
(OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
struct dsa_gen_ctx {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
FFC_PARAMS *ffc_params;
int selection;
static void *dsa_gen_init(void *provctx, int selection)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
struct dsa_gen_ctx *gctx = NULL;
if (!ossl_prov_is_running() || (selection & DSA_POSSIBLE_SELECTIONS) == 0)
const EC_GROUP *ecg = NULL;
OSSL_PARAM *p;
unsigned char *pub_key = NULL, *genbuf = NULL;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propq;
BN_CTX *bnctx = NULL;
}
struct ec_gen_ctx {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *group_name;
char *encoding;
char *field_type;
static void *ec_gen_init(void *provctx, int selection)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
struct ec_gen_ctx *gctx = NULL;
if (!ossl_prov_is_running() || (selection & (EC_POSSIBLE_SELECTIONS)) == 0)
#define ECX_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_KEYPAIR)
struct ecx_gen_ctx {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
ECX_KEY_TYPE type;
int selection;
static void *ecx_gen_init(void *provctx, int selection, ECX_KEY_TYPE type)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
struct ecx_gen_ctx *gctx = NULL;
if (!ossl_prov_is_running())
static OSSL_FUNC_keymgmt_gen_settable_params_fn cmac_gen_settable_params;
struct mac_gen_ctx {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
int selection;
unsigned char *priv_key;
size_t priv_key_len;
PROV_CIPHER cipher;
};
-MAC_KEY *mac_key_new(OPENSSL_CTX *libctx, int cmac)
+MAC_KEY *mac_key_new(OSSL_LIB_CTX *libctx, int cmac)
{
MAC_KEY *mackey;
static void *mac_gen_init(void *provctx, int selection)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
struct mac_gen_ctx *gctx = NULL;
if (!ossl_prov_is_running())
static int pss_params_fromdata(RSA_PSS_PARAMS_30 *pss_params,
const OSSL_PARAM params[], int rsa_type,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
if (!ossl_rsa_pss_params_30_fromdata(pss_params, params, libctx))
return 0;
static void *rsa_newdata(void *provctx)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
RSA *rsa;
if (!ossl_prov_is_running())
static void *rsapss_newdata(void *provctx)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
RSA *rsa;
if (!ossl_prov_is_running())
}
struct rsa_gen_ctx {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const char *propq;
int rsa_type;
static void *gen_init(void *provctx, int selection, int rsa_type)
{
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
struct rsa_gen_ctx *gctx = NULL;
if (!ossl_prov_is_running())
static int cmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
{
struct cmac_data_st *macctx = vmacctx;
- OPENSSL_CTX *ctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx);
+ OSSL_LIB_CTX *ctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx);
const OSSL_PARAM *p;
if (!ossl_prov_cipher_load_from_params(&macctx->cipher, params, ctx))
{
struct gmac_data_st *macctx = vmacctx;
EVP_CIPHER_CTX *ctx = macctx->ctx;
- OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx);
+ OSSL_LIB_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx);
const OSSL_PARAM *p;
if (ctx == NULL
static int hmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
{
struct hmac_data_st *macctx = vmacctx;
- OPENSSL_CTX *ctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx);
+ OSSL_LIB_CTX *ctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx);
const OSSL_PARAM *p;
if (!ossl_prov_digest_load_from_params(&macctx->digest, params, ctx))
RAND_POOL *crngt_pool;
} CRNG_TEST_GLOBAL;
-static int crngt_get_entropy(OPENSSL_CTX *ctx, RAND_POOL *pool,
+static int crngt_get_entropy(OSSL_LIB_CTX *ctx, RAND_POOL *pool,
unsigned char *buf, unsigned char *md,
unsigned int *md_size)
{
OPENSSL_free(crngt_glob);
}
-static void *rand_crng_ossl_ctx_new(OPENSSL_CTX *ctx)
+static void *rand_crng_ossl_ctx_new(OSSL_LIB_CTX *ctx)
{
unsigned char buf[CRNGT_BUFSIZ];
CRNG_TEST_GLOBAL *crngt_glob = OPENSSL_zalloc(sizeof(*crngt_glob));
return NULL;
}
-static const OPENSSL_CTX_METHOD rand_crng_ossl_ctx_method = {
+static const OSSL_LIB_CTX_METHOD rand_crng_ossl_ctx_method = {
rand_crng_ossl_ctx_new,
rand_crng_ossl_ctx_free,
};
RAND_POOL *pool;
size_t q, r = 0, s, t = 0;
int attempts = 3, crng_test_pass = 1;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(drbg->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(drbg->provctx);
CRNG_TEST_GLOBAL *crngt_glob
- = openssl_ctx_get_data(libctx, OPENSSL_CTX_RAND_CRNGT_INDEX,
- &rand_crng_ossl_ctx_method);
+ = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_RAND_CRNGT_INDEX,
+ &rand_crng_ossl_ctx_method);
OSSL_CALLBACK *stcb = NULL;
void *stcbarg = NULL;
OSSL_SELF_TEST *st = NULL;
/*
* drbg_ossl_ctx_new() calls drgb_setup() which calls rand_drbg_get_nonce()
- * which needs to get the rand_nonce_lock out of the OPENSSL_CTX...but since
+ * which needs to get the rand_nonce_lock out of the OSSL_LIB_CTX...but since
* drbg_ossl_ctx_new() hasn't finished running yet we need the rand_nonce_lock
* to be in a different global data object. Otherwise we will go into an
* infinite recursion loop.
*/
-static void *prov_drbg_nonce_ossl_ctx_new(OPENSSL_CTX *libctx)
+static void *prov_drbg_nonce_ossl_ctx_new(OSSL_LIB_CTX *libctx)
{
PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
OPENSSL_free(dngbl);
}
-static const OPENSSL_CTX_METHOD drbg_nonce_ossl_ctx_method = {
+static const OSSL_LIB_CTX_METHOD drbg_nonce_ossl_ctx_method = {
prov_drbg_nonce_ossl_ctx_new,
prov_drbg_nonce_ossl_ctx_free,
};
size_t ret = 0, n;
RAND_POOL *pool;
unsigned char *buf = NULL;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(drbg->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(drbg->provctx);
PROV_DRBG_NONCE_GLOBAL *dngbl
- = openssl_ctx_get_data(libctx, OPENSSL_CTX_DRBG_NONCE_INDEX,
- &drbg_nonce_ossl_ctx_method);
+ = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_NONCE_INDEX,
+ &drbg_nonce_ossl_ctx_method);
struct {
void *instance;
int count;
{
PROV_DRBG *ctx = (PROV_DRBG *)vctx;
PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
const OSSL_PARAM *p;
char *ecb;
const char *propquery = NULL;
{
PROV_DRBG *ctx = (PROV_DRBG *)vctx;
PROV_DRBG_HASH *hash = (PROV_DRBG_HASH *)ctx->data;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
const EVP_MD *md;
if (!ossl_prov_digest_load_from_params(&hash->digest, params, libctx))
{
PROV_DRBG *ctx = (PROV_DRBG *)vctx;
PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)ctx->data;
- OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
+ OSSL_LIB_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(ctx->provctx);
const EVP_MD *md;
if (!ossl_prov_digest_load_from_params(&hmac->digest, params, libctx))
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
DSA *dsa;
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
EC_KEY *ec;
char mdname[OSSL_MAX_NAME_SIZE];
static OSSL_FUNC_signature_gettable_ctx_params_fn eddsa_gettable_ctx_params;
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
ECX_KEY *key;
/* The Algorithm Identifier of the signature algorithm */
static OSSL_FUNC_signature_settable_ctx_params_fn mac_cmac_settable_ctx_params;
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
MAC_KEY *key;
EVP_MAC_CTX *macctx;
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
RSA *rsa;
int operation;
* we use that here too.
*/
typedef struct {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
char *propq;
EC_KEY *ec;
static int file_setup_decoders(struct file_ctx_st *ctx)
{
EVP_PKEY *dummy; /* for OSSL_DECODER_CTX_new_by_EVP_PKEY() */
- OPENSSL_CTX *libctx = ossl_prov_ctx_get0_library_context(ctx->provctx);
+ OSSL_LIB_CTX *libctx = ossl_prov_ctx_get0_library_context(ctx->provctx);
OSSL_DECODER *to_obj = NULL; /* Last resort decoder */
OSSL_DECODER_INSTANCE *to_obj_inst = NULL;
OSSL_DECODER_CLEANUP *old_cleanup = NULL;
static void legacy_teardown(void *provctx)
{
- OPENSSL_CTX_free(PROV_LIBRARY_CONTEXT_OF(provctx));
+ OSSL_LIB_CTX_free(PROV_LIBRARY_CONTEXT_OF(provctx));
ossl_prov_ctx_free(provctx);
}
void **provctx)
{
OSSL_FUNC_core_get_library_context_fn *c_get_libctx = NULL;
- OPENSSL_CTX *libctx = NULL;
+ OSSL_LIB_CTX *libctx = NULL;
for (; in->function_id != 0; in++) {
switch (in->function_id) {
return 0;
if ((*provctx = ossl_prov_ctx_new()) == NULL
- || (libctx = OPENSSL_CTX_new()) == NULL) {
- OPENSSL_CTX_free(libctx);
+ || (libctx = OSSL_LIB_CTX_new()) == NULL) {
+ OSSL_LIB_CTX_free(libctx);
legacy_teardown(*provctx);
*provctx = NULL;
return 0;
unsigned char **mac,
int *alloced,
size_t block_size, size_t mac_size,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
__owur int tls1_cbc_remove_padding_and_mac(size_t *reclen,
size_t origreclen,
unsigned char *recdata,
int *alloced,
size_t block_size, size_t mac_size,
int aead,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap);
__owur int dtls1_get_record(SSL *s);
int early_data_count_ok(SSL *s, size_t length, size_t overhead, int send);
size_t block_size,
size_t mac_size,
size_t good,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
int ssl3_cbc_remove_padding_and_mac(size_t *reclen,
size_t origreclen,
unsigned char **mac,
int *alloced,
size_t block_size, size_t mac_size,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
int tls1_cbc_remove_padding_and_mac(size_t *reclen,
size_t origreclen,
int *alloced,
size_t block_size, size_t mac_size,
int aead,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
/*-
* ssl3_cbc_remove_padding removes padding from the decrypted, SSLv3, CBC
unsigned char **mac,
int *alloced,
size_t block_size, size_t mac_size,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
size_t padding_length;
size_t good;
int *alloced,
size_t block_size, size_t mac_size,
int aead,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
size_t good = -1;
size_t padding_length, to_check, i;
size_t block_size,
size_t mac_size,
size_t good,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
#if defined(CBC_MAC_ROTATE_IN_PLACE)
unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE];
}
STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file,
- OPENSSL_CTX *libctx,
+ OSSL_LIB_CTX *libctx,
const char *propq)
{
BIO *in = BIO_new(BIO_s_file());
X509_NAME *xn = NULL;
STACK_OF(X509_NAME) *ret = NULL;
LHASH_OF(X509_NAME) *name_hash = lh_X509_NAME_new(xname_hash, xname_cmp);
- OPENSSL_CTX *prev_libctx = NULL;
+ OSSL_LIB_CTX *prev_libctx = NULL;
if ((name_hash == NULL) || (in == NULL)) {
SSLerr(0, ERR_R_MALLOC_FAILURE);
goto err;
/* Internally lh_X509_NAME_retrieve() needs the libctx to retrieve SHA1 */
- prev_libctx = OPENSSL_CTX_set0_default(libctx);
+ prev_libctx = OSSL_LIB_CTX_set0_default(libctx);
for (;;) {
if (PEM_read_bio_X509(in, &x, NULL, NULL) == NULL)
break;
ret = NULL;
done:
/* restore the old libctx */
- OPENSSL_CTX_set0_default(prev_libctx);
+ OSSL_LIB_CTX_set0_default(prev_libctx);
BIO_free(in);
X509_free(x);
lh_X509_NAME_free(name_hash);
CERT *cert;
X509_STORE **st;
SSL_CTX *ctx;
- OPENSSL_CTX *libctx = NULL;
+ OSSL_LIB_CTX *libctx = NULL;
const char *propq = NULL;
if (cctx->ctx != NULL) {
* via ssl.h.
*/
-SSL_CTX *SSL_CTX_new_ex(OPENSSL_CTX *libctx, const char *propq,
+SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
const SSL_METHOD *meth)
{
SSL_CTX *ret = NULL;
s->allow_early_data_cb_data = arg;
}
-const EVP_CIPHER *ssl_evp_cipher_fetch(OPENSSL_CTX *libctx,
+const EVP_CIPHER *ssl_evp_cipher_fetch(OSSL_LIB_CTX *libctx,
int nid,
const char *properties)
{
}
}
-const EVP_MD *ssl_evp_md_fetch(OPENSSL_CTX *libctx,
+const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
int nid,
const char *properties)
{
# define TLS_GROUP_FFDHE_FOR_TLS1_3 (TLS_GROUP_FFDHE|TLS_GROUP_ONLY_FOR_TLS1_3)
struct ssl_ctx_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
const SSL_METHOD *method;
STACK_OF(SSL_CIPHER) *cipher_list;
/* ssl_mcnf.c */
void ssl_ctx_system_config(SSL_CTX *ctx);
-const EVP_CIPHER *ssl_evp_cipher_fetch(OPENSSL_CTX *libctx,
+const EVP_CIPHER *ssl_evp_cipher_fetch(OSSL_LIB_CTX *libctx,
int nid,
const char *properties);
int ssl_evp_cipher_up_ref(const EVP_CIPHER *cipher);
void ssl_evp_cipher_free(const EVP_CIPHER *cipher);
-const EVP_MD *ssl_evp_md_fetch(OPENSSL_CTX *libctx,
+const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
int nid,
const char *properties);
int ssl_evp_md_up_ref(const EVP_MD *md);
unsigned int flags;
const SSL_METHOD *meth;
const SSL_CONF_CMD *cmds;
- OPENSSL_CTX *prev_libctx = NULL;
- OPENSSL_CTX *libctx = NULL;
+ OSSL_LIB_CTX *prev_libctx = NULL;
+ OSSL_LIB_CTX *libctx = NULL;
if (s == NULL && ctx == NULL) {
SSLerr(SSL_F_SSL_DO_CONFIG, ERR_R_PASSED_NULL_PARAMETER);
if (meth->ssl_connect != ssl_undefined_function)
flags |= SSL_CONF_FLAG_CLIENT;
SSL_CONF_CTX_set_flags(cctx, flags);
- prev_libctx = OPENSSL_CTX_set0_default(libctx);
+ prev_libctx = OSSL_LIB_CTX_set0_default(libctx);
for (i = 0; i < cmd_count; i++) {
char *cmdstr, *arg;
}
rv = SSL_CONF_CTX_finish(cctx);
err:
- OPENSSL_CTX_set0_default(prev_libctx);
+ OSSL_LIB_CTX_set0_default(prev_libctx);
SSL_CONF_CTX_free(cctx);
return rv <= 0 ? 0 : 1;
}
} SELF_TEST_ARGS;
static OSSL_PROVIDER *prov_null = NULL;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static SELF_TEST_ARGS self_test_args = { 0 };
static OSSL_CALLBACK self_test_events;
return 0;
}
- libctx = OPENSSL_CTX_new();
+ libctx = OSSL_LIB_CTX_new();
if (libctx == NULL
- || !OPENSSL_CTX_load_config(libctx, config_file)) {
+ || !OSSL_LIB_CTX_load_config(libctx, config_file)) {
opt_printf_stderr("Failed to load config\n");
return 0;
}
void cleanup_tests(void)
{
OSSL_PROVIDER_unload(prov_null);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
}
static int change_deflt_libctx(void *args)
{
- OPENSSL_CTX *libctx = OPENSSL_CTX_new();
- OPENSSL_CTX *oldctx, *tmpctx;
+ OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
+ OSSL_LIB_CTX *oldctx, *tmpctx;
int ret = 0;
if (libctx == NULL)
return 0;
- oldctx = OPENSSL_CTX_set0_default(libctx);
+ oldctx = OSSL_LIB_CTX_set0_default(libctx);
ASYNC_pause_job();
/* Check the libctx is set up as we expect */
- tmpctx = OPENSSL_CTX_set0_default(oldctx);
+ tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
if (tmpctx != libctx)
goto err;
/* Set it back again to continue to use our own libctx */
- oldctx = OPENSSL_CTX_set0_default(libctx);
+ oldctx = OSSL_LIB_CTX_set0_default(libctx);
ASYNC_pause_job();
/* Check the libctx is set up as we expect */
- tmpctx = OPENSSL_CTX_set0_default(oldctx);
+ tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
if (tmpctx != libctx)
goto err;
ret = 1;
err:
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
return ret;
}
ASYNC_JOB *job = NULL;
int funcret;
ASYNC_WAIT_CTX *waitctx = NULL;
- OPENSSL_CTX *libctx = OPENSSL_CTX_new();
- OPENSSL_CTX *oldctx, *tmpctx, *globalctx;
+ OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
+ OSSL_LIB_CTX *oldctx, *tmpctx, *globalctx;
int ret = 0;
if (libctx == NULL) {
goto err;
}
- globalctx = oldctx = OPENSSL_CTX_set0_default(libctx);
+ globalctx = oldctx = OSSL_LIB_CTX_set0_default(libctx);
if ((waitctx = ASYNC_WAIT_CTX_new()) == NULL
|| ASYNC_start_job(&job, waitctx, &funcret, change_deflt_libctx,
}
/* Reset the libctx temporarily to find out what it is*/
- tmpctx = OPENSSL_CTX_set0_default(oldctx);
- oldctx = OPENSSL_CTX_set0_default(tmpctx);
+ tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
+ oldctx = OSSL_LIB_CTX_set0_default(tmpctx);
if (tmpctx != libctx) {
fprintf(stderr,
"test_ASYNC_start_job_ex() failed - unexpected libctx\n");
}
/* Reset the libctx and continue with the global default libctx */
- tmpctx = OPENSSL_CTX_set0_default(oldctx);
+ tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
if (tmpctx != libctx) {
fprintf(stderr,
"test_ASYNC_start_job_ex() failed - unexpected libctx\n");
}
/* Reset the libctx temporarily to find out what it is*/
- tmpctx = OPENSSL_CTX_set0_default(libctx);
- OPENSSL_CTX_set0_default(tmpctx);
+ tmpctx = OSSL_LIB_CTX_set0_default(libctx);
+ OSSL_LIB_CTX_set0_default(tmpctx);
if (tmpctx != globalctx) {
fprintf(stderr,
"test_ASYNC_start_job_ex() failed - global libctx check failed\n");
ret = 1;
err:
ASYNC_WAIT_CTX_free(waitctx);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
return ret;
}
STACK_OF(X509) *caPubs;
} CMP_SES_TEST_FIXTURE;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL;
static EVP_PKEY *server_key = NULL;
EVP_PKEY_free(server_key);
X509_free(client_cert);
EVP_PKEY_free(client_key);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
return;
}
OSSL_CMP_PKISI *si;
} CMP_MSG_TEST_FIXTURE;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL;
/* TODO(3.0) Clean this up - See issue #12680 */
{
EVP_PKEY_free(newkey);
X509_free(cert);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
}
#define USAGE "new.key server.crt pkcs10.der module_name [module_conf_file]\n"
int expected;
} CMP_PROTECT_TEST_FIXTURE;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL;
static void tear_down(CMP_PROTECT_TEST_FIXTURE *fixture)
X509_free(intermediate);
OSSL_CMP_MSG_free(ir_protected);
OSSL_CMP_MSG_free(ir_unprotected);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
}
#define USAGE "server.pem IR_protected.der IR_unprotected.der IP_PBM.der " \
OSSL_CMP_MSG *req;
} CMP_SRV_TEST_FIXTURE;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL;
static OSSL_CMP_MSG *request = NULL;
OSSL_CMP_MSG_free(request);
OSSL_PROVIDER_unload(default_null_provider);
OSSL_PROVIDER_unload(provider);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
return;
}
#include "cmp_testlib.h"
#include <openssl/rsa.h> /* needed in case config no-deprecated */
-EVP_PKEY *load_pem_key(const char *file, OPENSSL_CTX *libctx)
+EVP_PKEY *load_pem_key(const char *file, OSSL_LIB_CTX *libctx)
{
EVP_PKEY *key = NULL;
BIO *bio = NULL;
return key;
}
-X509 *load_pem_cert(const char *file, OPENSSL_CTX *libctx)
+X509 *load_pem_cert(const char *file, OSSL_LIB_CTX *libctx)
{
X509 *cert = NULL;
BIO *bio = NULL;
# ifndef OPENSSL_NO_CMP
# define CMP_TEST_REFVALUE_LENGTH 15 /* arbitrary value */
-EVP_PKEY *load_pem_key(const char *file, OPENSSL_CTX *libctx);
-X509 *load_pem_cert(const char *file, OPENSSL_CTX *libctx);
+EVP_PKEY *load_pem_key(const char *file, OSSL_LIB_CTX *libctx);
+X509 *load_pem_cert(const char *file, OSSL_LIB_CTX *libctx);
X509_REQ *load_csr(const char *file);
OSSL_CMP_MSG *load_pkimsg(const char *file);
int valid_asn1_encoding(const OSSL_CMP_MSG *msg);
int additional_arg;
} CMP_VFY_TEST_FIXTURE;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL;
static void tear_down(CMP_VFY_TEST_FIXTURE *fixture)
X509_free(instaca_cert);
OSSL_CMP_MSG_free(ir_unprotected);
OSSL_CMP_MSG_free(ir_rmprotection);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
return;
}
/*
* Everything between BEGIN EXAMPLE and END EXAMPLE is copied from
- * doc/internal/man3/openssl_ctx_get_data.pod
+ * doc/internal/man3/ossl_lib_ctx_get_data.pod
*/
/*
void *data;
} FOO;
-static void *foo_new(OPENSSL_CTX *ctx)
+static void *foo_new(OSSL_LIB_CTX *ctx)
{
FOO *ptr = OPENSSL_zalloc(sizeof(*ptr));
if (ptr != NULL)
{
OPENSSL_free(ptr);
}
-static const OPENSSL_CTX_METHOD foo_method = {
+static const OSSL_LIB_CTX_METHOD foo_method = {
foo_new,
foo_free
};
* ======================================================================
*/
-static int test_context(OPENSSL_CTX *ctx)
+static int test_context(OSSL_LIB_CTX *ctx)
{
FOO *data = NULL;
- return TEST_ptr(data = openssl_ctx_get_data(ctx, 0, &foo_method))
+ return TEST_ptr(data = ossl_lib_ctx_get_data(ctx, 0, &foo_method))
/* OPENSSL_zalloc in foo_new() initialized it to zero */
&& TEST_int_eq(data->i, 42);
}
static int test_app_context(void)
{
- OPENSSL_CTX *ctx = NULL;
+ OSSL_LIB_CTX *ctx = NULL;
int result =
- TEST_ptr(ctx = OPENSSL_CTX_new())
+ TEST_ptr(ctx = OSSL_LIB_CTX_new())
&& test_context(ctx);
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
return result;
}
#include "crypto/evp.h"
#include "../e_os.h" /* strcasecmp */
-static OPENSSL_CTX *testctx = NULL;
+static OSSL_LIB_CTX *testctx = NULL;
/*
* kExampleRSAKeyDER is an RSA private key in ASN.1, DER format. Of course, you
static int test_EVP_set_default_properties(void)
{
- OPENSSL_CTX *ctx;
+ OSSL_LIB_CTX *ctx;
EVP_MD *md = NULL;
int res = 0;
- if (!TEST_ptr(ctx = OPENSSL_CTX_new())
+ if (!TEST_ptr(ctx = OSSL_LIB_CTX_new())
|| !TEST_ptr(md = EVP_MD_fetch(ctx, "sha256", NULL)))
goto err;
EVP_MD_free(md);
res = 1;
err:
EVP_MD_free(md);
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
return res;
}
*/
static int test_pkey_ctx_fail_without_provider(int tst)
{
- OPENSSL_CTX *tmpctx = OPENSSL_CTX_new();
+ OSSL_LIB_CTX *tmpctx = OSSL_LIB_CTX_new();
OSSL_PROVIDER *nullprov = NULL;
EVP_PKEY_CTX *pctx = NULL;
const char *keytype = NULL;
err:
EVP_PKEY_CTX_free(pctx);
OSSL_PROVIDER_unload(nullprov);
- OPENSSL_CTX_free(tmpctx);
+ OSSL_LIB_CTX_free(tmpctx);
return ret;
}
int setup_tests(void)
{
- testctx = OPENSSL_CTX_new();
+ testctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(testctx))
return 0;
void cleanup_tests(void)
{
- OPENSSL_CTX_free(testctx);
+ OSSL_LIB_CTX_free(testctx);
}
#include "testutil.h"
#include "internal/nelem.h"
-static OPENSSL_CTX *mainctx = NULL;
+static OSSL_LIB_CTX *mainctx = NULL;
static OSSL_PROVIDER *nullprov = NULL;
/*
static int test_alternative_default(void)
{
- OPENSSL_CTX *oldctx;
+ OSSL_LIB_CTX *oldctx;
EVP_MD *sha256;
int ok = 0;
* Now we switch to our main library context, and try again. Since no
* providers are loaded in this one, it should fall back to the default.
*/
- if (!TEST_ptr(oldctx = OPENSSL_CTX_set0_default(mainctx))
+ if (!TEST_ptr(oldctx = OSSL_LIB_CTX_set0_default(mainctx))
|| !TEST_ptr(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL)))
goto err;
EVP_MD_free(sha256);
* Switching back should give us our main library context back, and
* fetching SHA2-256 should fail again.
*/
- if (!TEST_ptr_eq(OPENSSL_CTX_set0_default(oldctx), mainctx)
+ if (!TEST_ptr_eq(OSSL_LIB_CTX_set0_default(oldctx), mainctx)
|| !TEST_ptr_null(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL)))
goto err;
int setup_tests(void)
{
- mainctx = OPENSSL_CTX_new();
+ mainctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(mainctx))
return 0;
nullprov = OSSL_PROVIDER_load(NULL, "null");
if (!TEST_ptr(nullprov)) {
- OPENSSL_CTX_free(mainctx);
+ OSSL_LIB_CTX_free(mainctx);
mainctx = NULL;
return 0;
}
void cleanup_tests(void)
{
- OPENSSL_CTX_free(mainctx);
+ OSSL_LIB_CTX_free(mainctx);
OSSL_PROVIDER_unload(nullprov);
}
return ret;
}
-static int load_providers(OPENSSL_CTX **libctx, OSSL_PROVIDER *prov[])
+static int load_providers(OSSL_LIB_CTX **libctx, OSSL_PROVIDER *prov[])
{
- OPENSSL_CTX *ctx = NULL;
+ OSSL_LIB_CTX *ctx = NULL;
int ret = 0;
size_t i;
- ctx = OPENSSL_CTX_new();
+ ctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(ctx))
goto err;
- if (!TEST_true(OPENSSL_CTX_load_config(ctx, config_file)))
+ if (!TEST_true(OSSL_LIB_CTX_load_config(ctx, config_file)))
goto err;
if (test_get_argument_count() > 2)
goto err;
*libctx = ctx;
err:
if (ret == 0)
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
return ret;
}
*/
static int test_EVP_MD_fetch(void)
{
- OPENSSL_CTX *ctx = NULL;
+ OSSL_LIB_CTX *ctx = NULL;
EVP_MD *md = NULL;
OSSL_PROVIDER *prov[2] = {NULL, NULL};
int ret = 0;
*/
if (ctx != NULL) {
OPENSSL_thread_stop_ex(ctx);
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
}
return ret;
}
*/
static int test_EVP_CIPHER_fetch(void)
{
- OPENSSL_CTX *ctx = NULL;
+ OSSL_LIB_CTX *ctx = NULL;
EVP_CIPHER *cipher = NULL;
OSSL_PROVIDER *prov[2] = {NULL, NULL};
int ret = 0;
EVP_CIPHER_free(cipher);
OSSL_PROVIDER_unload(prov[0]);
OSSL_PROVIDER_unload(prov[1]);
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
return ret;
}
#include "crypto/bn_dh.h" /* _bignum_ffdhe2048_p */
#include "../e_os.h" /* strcasecmp */
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *nullprov = NULL;
static OSSL_PROVIDER *libprov = NULL;
static STACK_OF(OPENSSL_CSTRING) *cipher_names = NULL;
if (!TEST_ptr(nullprov))
return 0;
- libctx = OPENSSL_CTX_new();
+ libctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(libctx))
return 0;
if (config_file != NULL
- && !TEST_true(OPENSSL_CTX_load_config(libctx, config_file)))
+ && !TEST_true(OSSL_LIB_CTX_load_config(libctx, config_file)))
return 0;
libprov = OSSL_PROVIDER_load(libctx, prov_name);
{
sk_OPENSSL_CSTRING_free(cipher_names);
OSSL_PROVIDER_unload(libprov);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
OSSL_PROVIDER_unload(nullprov);
}
} OPTION_CHOICE;
static OSSL_PROVIDER *prov_null = NULL;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
/* List of public and private keys */
static KEY_LIST *private_keys;
PBE_DATA *expected = t->data;
unsigned char *key;
EVP_MD *fetched_digest = NULL;
- OPENSSL_CTX *save_libctx;
+ OSSL_LIB_CTX *save_libctx;
- save_libctx = OPENSSL_CTX_set0_default(libctx);
+ save_libctx = OSSL_LIB_CTX_set0_default(libctx);
if (!TEST_ptr(key = OPENSSL_malloc(expected->key_len))) {
t->err = "INTERNAL_ERROR";
err:
EVP_MD_free(fetched_digest);
OPENSSL_free(key);
- OPENSSL_CTX_set0_default(save_libctx);
+ OSSL_LIB_CTX_set0_default(save_libctx);
return 1;
}
}
/* load the provider via configuration into the created library context */
- libctx = OPENSSL_CTX_new();
+ libctx = OSSL_LIB_CTX_new();
if (libctx == NULL
- || !OPENSSL_CTX_load_config(libctx, config_file)) {
+ || !OSSL_LIB_CTX_load_config(libctx, config_file)) {
TEST_error("Failed to load config %s\n", config_file);
return 0;
}
void cleanup_tests(void)
{
OSSL_PROVIDER_unload(prov_null);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
}
#define STR_STARTS_WITH(str, pre) strncasecmp(pre, str, strlen(pre)) == 0
#define MAX_ALG_FILTERS 5
struct filter_prov_globals_st {
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
OSSL_PROVIDER *deflt;
struct {
int operation;
static struct filter_prov_globals_st *get_globals(void)
{
/*
- * Ideally we'd like to store this in the OPENSSL_CTX so that we can have
+ * Ideally we'd like to store this in the OSSL_LIB_CTX so that we can have
* more than one instance of the filter provider at a time. But for now we
* just make it simple.
*/
struct filter_prov_globals_st *globs = get_globals();
OSSL_PROVIDER_unload(globs->deflt);
- OPENSSL_CTX_free(globs->libctx);
+ OSSL_LIB_CTX_free(globs->libctx);
}
/* Functions we provide to the core */
void **provctx)
{
memset(&ourglobals, 0, sizeof(ourglobals));
- ourglobals.libctx = OPENSSL_CTX_new();
+ ourglobals.libctx = OSSL_LIB_CTX_new();
if (ourglobals.libctx == NULL)
goto err;
err:
OSSL_PROVIDER_unload(ourglobals.deflt);
- OPENSSL_CTX_free(ourglobals.libctx);
+ OSSL_LIB_CTX_free(ourglobals.libctx);
return 0;
}
#include "testutil.h"
typedef struct {
- OPENSSL_CTX *ctx1;
+ OSSL_LIB_CTX *ctx1;
OSSL_PROVIDER *prov1;
- OPENSSL_CTX *ctx2;
+ OSSL_LIB_CTX *ctx2;
OSSL_PROVIDER *prov2;
} FIXTURE;
if (fixture != NULL) {
OSSL_PROVIDER_unload(fixture->prov1);
OSSL_PROVIDER_unload(fixture->prov2);
- OPENSSL_CTX_free(fixture->ctx1);
- OPENSSL_CTX_free(fixture->ctx2);
+ OSSL_LIB_CTX_free(fixture->ctx1);
+ OSSL_LIB_CTX_free(fixture->ctx2);
OPENSSL_free(fixture);
}
}
FIXTURE *fixture;
if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture)))
- || !TEST_ptr(fixture->ctx1 = OPENSSL_CTX_new())
+ || !TEST_ptr(fixture->ctx1 = OSSL_LIB_CTX_new())
|| !TEST_ptr(fixture->prov1 = OSSL_PROVIDER_load(fixture->ctx1,
"default"))
- || !TEST_ptr(fixture->ctx2 = OPENSSL_CTX_new())
+ || !TEST_ptr(fixture->ctx2 = OSSL_LIB_CTX_new())
|| !TEST_ptr(fixture->prov2 = OSSL_PROVIDER_load(fixture->ctx2,
"default"))) {
tear_down(fixture);
static int test_fips_mode(void)
{
int ret = 0;
- OPENSSL_CTX *ctx = NULL;
+ OSSL_LIB_CTX *ctx = NULL;
- if (!TEST_ptr(ctx = OPENSSL_CTX_new()))
+ if (!TEST_ptr(ctx = OSSL_LIB_CTX_new()))
goto err;
ret = TEST_true(EVP_set_default_properties(ctx, "default=yes,fips=yes"))
&& TEST_true(EVP_default_properties_enable_fips(ctx, 0))
&& TEST_false(EVP_default_properties_is_fips_enabled(ctx));
err:
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
return ret;
}
#include <openssl/evp.h>
#include "testutil.h"
-static int test_provider(OPENSSL_CTX *ctx)
+static int test_provider(OSSL_LIB_CTX *ctx)
{
EVP_KEYMGMT *rsameth = NULL;
const OSSL_PROVIDER *prov = NULL;
static int test_explicit_provider(void)
{
- OPENSSL_CTX *ctx = NULL;
+ OSSL_LIB_CTX *ctx = NULL;
OSSL_PROVIDER *prov = NULL;
int ok;
- ok = TEST_ptr(ctx = OPENSSL_CTX_new())
+ ok = TEST_ptr(ctx = OSSL_LIB_CTX_new())
&& TEST_ptr(prov = OSSL_PROVIDER_load(ctx, "default"))
&& test_provider(ctx)
&& TEST_true(OSSL_PROVIDER_unload(prov));
- OPENSSL_CTX_free(ctx);
+ OSSL_LIB_CTX_free(ctx);
return ok;
}
int count;
};
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static char *provider_name = NULL;
static struct self_test_arg self_test_args = { 0 };
}
}
- libctx = OPENSSL_CTX_new();
+ libctx = OSSL_LIB_CTX_new();
if (libctx == NULL)
return 0;
self_test_args.count = 0;
OSSL_SELF_TEST_set_callback(libctx, self_test_on_load, &self_test_args);
- if (!OPENSSL_CTX_load_config(libctx, config_file)) {
+ if (!OSSL_LIB_CTX_load_config(libctx, config_file)) {
opt_printf_stderr("Failed to load config\n");
return 0;
}
static CONF *conf = NULL;
static OSSL_PROVIDER *defctxnull = NULL, *thisprov = NULL;
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
/* Currently the section names are of the form test-<number>, e.g. test-15. */
#define MAX_TESTCASE_NAME_LENGTH 100
NCONF_free(conf);
OSSL_PROVIDER_unload(defctxnull);
OSSL_PROVIDER_unload(thisprov);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
}
}
__owur static int parse_expected_ca_names(STACK_OF(X509_NAME) **pnames,
- const char *value, OPENSSL_CTX *libctx)
+ const char *value,
+ OSSL_LIB_CTX *libctx)
{
if (value == NULL)
return 0;
{ "SessionTicketAppData", &parse_server_session_ticket_app_data },
};
-SSL_TEST_CTX *SSL_TEST_CTX_new(OPENSSL_CTX *libctx)
+SSL_TEST_CTX *SSL_TEST_CTX_new(OSSL_LIB_CTX *libctx)
{
SSL_TEST_CTX *ret;
}
SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section,
- OPENSSL_CTX *libctx)
+ OSSL_LIB_CTX *libctx)
{
STACK_OF(CONF_VALUE) *sk_conf = NULL;
SSL_TEST_CTX *ctx = NULL;
/* Expected Session Ticket Application Data */
char *expected_session_ticket_app_data;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
} SSL_TEST_CTX;
const char *ssl_test_result_name(ssl_test_result_t result);
* See test/README.ssltest.md for details on the conf file format.
*/
SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section,
- OPENSSL_CTX *libctx);
+ OSSL_LIB_CTX *libctx);
-SSL_TEST_CTX *SSL_TEST_CTX_new(OPENSSL_CTX *libctx);
+SSL_TEST_CTX *SSL_TEST_CTX_new(OSSL_LIB_CTX *libctx);
void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx);
const OSSL_DISPATCH **out,
void **provctx);
-static OPENSSL_CTX *libctx = NULL;
+static OSSL_LIB_CTX *libctx = NULL;
static OSSL_PROVIDER *defctxnull = NULL;
#ifndef OPENSSL_NO_TLS1_3
SSL *clientssl = NULL, *serverssl = NULL;
int testresult = 0;
char buf[1024];
- OPENSSL_CTX *tmplibctx = OPENSSL_CTX_new();
+ OSSL_LIB_CTX *tmplibctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(tmplibctx))
goto end;
SSL_free(clientssl);
SSL_CTX_free(sctx);
SSL_CTX_free(cctx);
- OPENSSL_CTX_free(tmplibctx);
+ OSSL_LIB_CTX_free(tmplibctx);
return testresult;
}
SSL_CTX *cctx = NULL, *sctx = NULL;
SSL *clientssl = NULL, *serverssl = NULL;
int testresult = 0;
- OPENSSL_CTX *tmpctx = OPENSSL_CTX_new();
- OPENSSL_CTX *clientctx = libctx, *serverctx = libctx;
+ OSSL_LIB_CTX *tmpctx = OSSL_LIB_CTX_new();
+ OSSL_LIB_CTX *clientctx = libctx, *serverctx = libctx;
OSSL_PROVIDER *filterprov = NULL;
int sig, hash;
SSL_CTX_free(sctx);
SSL_CTX_free(cctx);
OSSL_PROVIDER_unload(filterprov);
- OPENSSL_CTX_free(tmpctx);
+ OSSL_LIB_CTX_free(tmpctx);
return testresult;
}
char *modulename;
char *configfile;
- libctx = OPENSSL_CTX_new();
+ libctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(libctx))
return 0;
|| !TEST_ptr(configfile = test_get_argument(4)))
return 0;
- if (!TEST_true(OPENSSL_CTX_load_config(libctx, configfile)))
+ if (!TEST_true(OSSL_LIB_CTX_load_config(libctx, configfile)))
return 0;
/* Check we have the expected provider available */
bio_s_mempacket_test_free();
bio_s_always_retry_free();
OSSL_PROVIDER_unload(defctxnull);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
}
char *arg = NULL, *argn = NULL;
const char *provider = NULL, *config = NULL;
OSSL_PROVIDER *thisprov = NULL, *defctxnull = NULL;
- OPENSSL_CTX *libctx = NULL;
+ OSSL_LIB_CTX *libctx = NULL;
verbose = 0;
debug = 0;
defctxnull = OSSL_PROVIDER_load(NULL, "null");
if (defctxnull == NULL)
goto end;
- libctx = OPENSSL_CTX_new();
+ libctx = OSSL_LIB_CTX_new();
if (libctx == NULL)
goto end;
if (config != NULL
- && !OPENSSL_CTX_load_config(libctx, config))
+ && !OSSL_LIB_CTX_load_config(libctx, config))
goto end;
thisprov = OSSL_PROVIDER_load(libctx, provider);
OSSL_PROVIDER_unload(defctxnull);
OSSL_PROVIDER_unload(thisprov);
- OPENSSL_CTX_free(libctx);
+ OSSL_LIB_CTX_free(libctx);
BIO_free(bio_err);
EXIT(ret);
return -1;
}
-int create_ssl_ctx_pair(OPENSSL_CTX *libctx, const SSL_METHOD *sm,
+int create_ssl_ctx_pair(OSSL_LIB_CTX *libctx, const SSL_METHOD *sm,
const SSL_METHOD *cm,
int min_proto_version, int max_proto_version,
SSL_CTX **sctx, SSL_CTX **cctx, char *certfile,
# include <openssl/ssl.h>
-int create_ssl_ctx_pair(OPENSSL_CTX *libctx, const SSL_METHOD *sm,
+int create_ssl_ctx_pair(OSSL_LIB_CTX *libctx, const SSL_METHOD *sm,
const SSL_METHOD *cm, int min_proto_version,
int max_proto_version, SSL_CTX **sctx, SSL_CTX **cctx,
char *certfile, char *privkeyfile);
*/
int test_skip_common_options(void);
-int test_get_libctx(OPENSSL_CTX **libctx,
+int test_get_libctx(OSSL_LIB_CTX **libctx,
OSSL_PROVIDER **default_null_provider,
OSSL_PROVIDER **provider, int argn, const char *usage);
#include <openssl/provider.h>
#include <string.h>
-int test_get_libctx(OPENSSL_CTX **libctx,
+int test_get_libctx(OSSL_LIB_CTX **libctx,
OSSL_PROVIDER **default_null_provider,
OSSL_PROVIDER **provider, int argn, const char *usage)
{
const char *config_fname = test_get_argument(argn + 1);
*default_null_provider = OSSL_PROVIDER_load(NULL, "null");
- *libctx = OPENSSL_CTX_new();
+ *libctx = OSSL_LIB_CTX_new();
if (!TEST_ptr(*libctx)) {
TEST_error("Failed to create libctx\n");
goto err;
}
if (config_fname != NULL
- && !TEST_true(OPENSSL_CTX_load_config(*libctx, config_fname))) {
+ && !TEST_true(OSSL_LIB_CTX_load_config(*libctx, config_fname))) {
TEST_error("Error loading config file %s\n", config_fname);
goto err;
}
struct xor_gen_ctx {
int selection;
- OPENSSL_CTX *libctx;
+ OSSL_LIB_CTX *libctx;
};
static void *xor_gen_init(void *provctx, int selection)
if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL)
gctx->selection = selection;
- /* Our provctx is really just an OPENSSL_CTX */
- gctx->libctx = (OPENSSL_CTX *)provctx;
+ /* Our provctx is really just an OSSL_LIB_CTX */
+ gctx->libctx = (OSSL_LIB_CTX *)provctx;
return gctx;
}
/* Functions we provide to the core */
static const OSSL_DISPATCH tls_prov_dispatch_table[] = {
- { OSSL_FUNC_PROVIDER_TEARDOWN, (void (*)(void))OPENSSL_CTX_free },
+ { OSSL_FUNC_PROVIDER_TEARDOWN, (void (*)(void))OSSL_LIB_CTX_free },
{ OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))tls_prov_query },
{ OSSL_FUNC_PROVIDER_GET_CAPABILITIES, (void (*)(void))tls_prov_get_capabilities },
{ 0, NULL }
};
static
-unsigned int randomize_tls_group_id(OPENSSL_CTX *libctx)
+unsigned int randomize_tls_group_id(OSSL_LIB_CTX *libctx)
{
/*
* Randomise the group_id we're going to use to ensure we don't interoperate
const OSSL_DISPATCH **out,
void **provctx)
{
- OPENSSL_CTX *libctx = OPENSSL_CTX_new();
+ OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
*provctx = libctx;
EVP_KDF_name ? 3_0_0 EXIST::FUNCTION:
EC_GROUP_get0_field ? 3_0_0 EXIST::FUNCTION:EC
CRYPTO_alloc_ex_data ? 3_0_0 EXIST::FUNCTION:
-OPENSSL_CTX_new ? 3_0_0 EXIST::FUNCTION:
-OPENSSL_CTX_free ? 3_0_0 EXIST::FUNCTION:
+OSSL_LIB_CTX_new ? 3_0_0 EXIST::FUNCTION:
+OSSL_LIB_CTX_free ? 3_0_0 EXIST::FUNCTION:
OPENSSL_LH_flush ? 3_0_0 EXIST::FUNCTION:
BN_native2bn ? 3_0_0 EXIST::FUNCTION:
BN_bn2nativepad ? 3_0_0 EXIST::FUNCTION:
EVP_PKEY_CTX_set_rsa_keygen_primes ? 3_0_0 EXIST::FUNCTION:RSA
NCONF_new_ex ? 3_0_0 EXIST::FUNCTION:
CONF_modules_load_file_ex ? 3_0_0 EXIST::FUNCTION:
-OPENSSL_CTX_load_config ? 3_0_0 EXIST::FUNCTION:
+OSSL_LIB_CTX_load_config ? 3_0_0 EXIST::FUNCTION:
OSSL_PARAM_BLD_to_param ? 3_0_0 EXIST::FUNCTION:
OSSL_PARAM_BLD_free_params ? 3_0_0 EXIST::FUNCTION:
OSSL_PARAM_BLD_push_int ? 3_0_0 EXIST::FUNCTION:
EC_GROUP_new_by_curve_name_ex ? 3_0_0 EXIST::FUNCTION:EC
EC_KEY_new_ex ? 3_0_0 EXIST::FUNCTION:EC
EC_KEY_new_by_curve_name_ex ? 3_0_0 EXIST::FUNCTION:EC
-OPENSSL_CTX_set0_default ? 3_0_0 EXIST::FUNCTION:
+OSSL_LIB_CTX_set0_default ? 3_0_0 EXIST::FUNCTION:
PEM_X509_INFO_read_bio_ex ? 3_0_0 EXIST::FUNCTION:
PEM_X509_INFO_read_ex ? 3_0_0 EXIST::FUNCTION:STDIO
X509_REQ_verify_ex ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_CTX datatype
GEN_SESSION_CB datatype
OPENSSL_Applink external
-OPENSSL_CTX datatype
+OSSL_LIB_CTX datatype
NAMING_AUTHORITY datatype
OSSL_DECODER datatype
OSSL_DECODER_CTX datatype