diff options
author | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-10-15 12:55:50 +0300 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-10-15 11:59:53 +0100 |
commit | b425001010044adbdbcd98f8682694b30b73bbf4 (patch) | |
tree | e87a5b512d7869cb6a500ecc74b706281be762cf /providers/implementations | |
parent | 29000e43ea257bf54f6ccb2064b3744853b821b2 (diff) |
Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix,
e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER.
The OPENSSL_CTX type stands out a little by using a different prefix.
For consistency reasons, this type is renamed to OSSL_LIB_CTX.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12621)
Diffstat (limited to 'providers/implementations')
46 files changed, 75 insertions, 75 deletions
diff --git a/providers/implementations/asymciphers/rsa_enc.c b/providers/implementations/asymciphers/rsa_enc.c index 6241ce5fcf..296289d9b4 100644 --- a/providers/implementations/asymciphers/rsa_enc.c +++ b/providers/implementations/asymciphers/rsa_enc.c @@ -62,7 +62,7 @@ static OSSL_ITEM padding_item[] = { */ typedef struct { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; RSA *rsa; int pad_mode; int operation; diff --git a/providers/implementations/asymciphers/sm2_enc.c b/providers/implementations/asymciphers/sm2_enc.c index 4f2f64bb1a..ee63da7818 100644 --- a/providers/implementations/asymciphers/sm2_enc.c +++ b/providers/implementations/asymciphers/sm2_enc.c @@ -38,7 +38,7 @@ static OSSL_FUNC_asym_cipher_settable_ctx_params_fn sm2_settable_ctx_params; */ typedef struct { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; EC_KEY *key; PROV_DIGEST md; } PROV_SM2_CTX; diff --git a/providers/implementations/ciphers/cipher_aes_siv.h b/providers/implementations/ciphers/cipher_aes_siv.h index b407b407e6..6d2649f049 100644 --- a/providers/implementations/ciphers/cipher_aes_siv.h +++ b/providers/implementations/ciphers/cipher_aes_siv.h @@ -31,7 +31,7 @@ typedef struct prov_siv_ctx_st { 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); diff --git a/providers/implementations/ciphers/cipher_aes_siv_hw.c b/providers/implementations/ciphers/cipher_aes_siv_hw.c index ddd88e00c9..f4ad6639cf 100644 --- a/providers/implementations/ciphers/cipher_aes_siv_hw.c +++ b/providers/implementations/ciphers/cipher_aes_siv_hw.c @@ -22,7 +22,7 @@ static int aes_siv_initkey(void *vctx, const unsigned char *key, size_t keylen) 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); diff --git a/providers/implementations/ciphers/ciphercommon_block.c b/providers/implementations/ciphers/ciphercommon_block.c index ba6f68eeff..68d5495b77 100644 --- a/providers/implementations/ciphers/ciphercommon_block.c +++ b/providers/implementations/ciphers/ciphercommon_block.c @@ -22,7 +22,7 @@ int ssl3_cbc_remove_padding_and_mac(size_t *reclen, 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, @@ -31,7 +31,7 @@ int tls1_cbc_remove_padding_and_mac(size_t *reclen, 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 @@ -154,7 +154,7 @@ int unpadblock(unsigned char *buf, size_t *buflen, size_t blocksize) * 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) { diff --git a/providers/implementations/ciphers/ciphercommon_local.h b/providers/implementations/ciphers/ciphercommon_local.h index 9427c0c537..b84785b731 100644 --- a/providers/implementations/ciphers/ciphercommon_local.h +++ b/providers/implementations/ciphers/ciphercommon_local.h @@ -11,6 +11,6 @@ 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); diff --git a/providers/implementations/encode_decode/encode_key2any.c b/providers/implementations/encode_decode/encode_key2any.c index beb487e940..da57805386 100644 --- a/providers/implementations/encode_decode/encode_key2any.c +++ b/providers/implementations/encode_decode/encode_key2any.c @@ -789,7 +789,7 @@ static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx) 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 = diff --git a/providers/implementations/encode_decode/encode_key2text.c b/providers/implementations/encode_decode/encode_key2text.c index ac6d42970e..92efb0436e 100644 --- a/providers/implementations/encode_decode/encode_key2text.c +++ b/providers/implementations/encode_decode/encode_key2text.c @@ -408,7 +408,7 @@ static int ec_param_explicit_gen_to_text(BIO *out, const EC_GROUP *group, /* 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; @@ -449,7 +449,7 @@ err: } 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; diff --git a/providers/implementations/exchange/dh_exch.c b/providers/implementations/exchange/dh_exch.c index 9e65934bdc..47a468f678 100644 --- a/providers/implementations/exchange/dh_exch.c +++ b/providers/implementations/exchange/dh_exch.c @@ -59,7 +59,7 @@ enum kdf_type { */ typedef struct { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; DH *dh; DH *dhpeer; unsigned int pad : 1; diff --git a/providers/implementations/exchange/ecdh_exch.c b/providers/implementations/exchange/ecdh_exch.c index 84a9d2aa19..249839b74e 100644 --- a/providers/implementations/exchange/ecdh_exch.c +++ b/providers/implementations/exchange/ecdh_exch.c @@ -50,7 +50,7 @@ enum kdf_type { */ typedef struct { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; EC_KEY *k; EC_KEY *peerk; diff --git a/providers/implementations/include/prov/ciphercommon.h b/providers/implementations/include/prov/ciphercommon.h index 82dae0ba59..c034528448 100644 --- a/providers/implementations/include/prov/ciphercommon.h +++ b/providers/implementations/include/prov/ciphercommon.h @@ -81,7 +81,7 @@ struct prov_cipher_ctx_st { 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 { diff --git a/providers/implementations/include/prov/ciphercommon_gcm.h b/providers/implementations/include/prov/ciphercommon_gcm.h index b6d5c74949..dd914bdf25 100644 --- a/providers/implementations/include/prov/ciphercommon_gcm.h +++ b/providers/implementations/include/prov/ciphercommon_gcm.h @@ -72,7 +72,7 @@ typedef struct prov_gcm_ctx_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; diff --git a/providers/implementations/include/prov/kdfexchange.h b/providers/implementations/include/prov/kdfexchange.h index 5c817bb929..3770487bff 100644 --- a/providers/implementations/include/prov/kdfexchange.h +++ b/providers/implementations/include/prov/kdfexchange.h @@ -12,7 +12,7 @@ #include "internal/refcount.h" struct kdf_data_st { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *lock; }; diff --git a/providers/implementations/include/prov/macsignature.h b/providers/implementations/include/prov/macsignature.h index bec5c46fbe..1e59884cbc 100644 --- a/providers/implementations/include/prov/macsignature.h +++ b/providers/implementations/include/prov/macsignature.h @@ -14,7 +14,7 @@ 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; @@ -25,6 +25,6 @@ struct mac_key_st { 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); diff --git a/providers/implementations/kdfs/hkdf.c b/providers/implementations/kdfs/hkdf.c index 6998cceb57..9a6fa54918 100644 --- a/providers/implementations/kdfs/hkdf.c +++ b/providers/implementations/kdfs/hkdf.c @@ -168,7 +168,7 @@ static int kdf_hkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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)) diff --git a/providers/implementations/kdfs/kbkdf.c b/providers/implementations/kdfs/kbkdf.c index 9f12ce07ba..bfc063411c 100644 --- a/providers/implementations/kdfs/kbkdf.c +++ b/providers/implementations/kdfs/kbkdf.c @@ -254,7 +254,7 @@ static int kbkdf_set_buffer(unsigned char **out, size_t *out_len, 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]; diff --git a/providers/implementations/kdfs/krb5kdf.c b/providers/implementations/kdfs/krb5kdf.c index a7748085fb..e8077a1190 100644 --- a/providers/implementations/kdfs/krb5kdf.c +++ b/providers/implementations/kdfs/krb5kdf.c @@ -132,7 +132,7 @@ static int krb5kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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; diff --git a/providers/implementations/kdfs/pbkdf2.c b/providers/implementations/kdfs/pbkdf2.c index 7ba9c406c8..d29deae3cc 100644 --- a/providers/implementations/kdfs/pbkdf2.c +++ b/providers/implementations/kdfs/pbkdf2.c @@ -111,7 +111,7 @@ static void kdf_pbkdf2_reset(void *vctx) 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); @@ -168,7 +168,7 @@ static int kdf_pbkdf2_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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; diff --git a/providers/implementations/kdfs/pkcs12kdf.c b/providers/implementations/kdfs/pkcs12kdf.c index 7ed5945af9..50a32ffd56 100644 --- a/providers/implementations/kdfs/pkcs12kdf.c +++ b/providers/implementations/kdfs/pkcs12kdf.c @@ -223,7 +223,7 @@ static int kdf_pkcs12_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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; diff --git a/providers/implementations/kdfs/scrypt.c b/providers/implementations/kdfs/scrypt.c index 23d6f7b4ad..4fdc5b2d02 100644 --- a/providers/implementations/kdfs/scrypt.c +++ b/providers/implementations/kdfs/scrypt.c @@ -37,10 +37,10 @@ static int scrypt_alg(const char *pass, size_t passlen, 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; @@ -404,7 +404,7 @@ static int scrypt_alg(const char *pass, size_t passlen, 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; diff --git a/providers/implementations/kdfs/sshkdf.c b/providers/implementations/kdfs/sshkdf.c index 4478279854..f1b5033b20 100644 --- a/providers/implementations/kdfs/sshkdf.c +++ b/providers/implementations/kdfs/sshkdf.c @@ -134,7 +134,7 @@ static int kdf_sshkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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)) diff --git a/providers/implementations/kdfs/sskdf.c b/providers/implementations/kdfs/sskdf.c index 2984f69042..f20e038e00 100644 --- a/providers/implementations/kdfs/sskdf.c +++ b/providers/implementations/kdfs/sskdf.c @@ -452,7 +452,7 @@ static int sskdf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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)) diff --git a/providers/implementations/kdfs/tls1_prf.c b/providers/implementations/kdfs/tls1_prf.c index 3d4fbc5fc4..8bc5dd41cd 100644 --- a/providers/implementations/kdfs/tls1_prf.c +++ b/providers/implementations/kdfs/tls1_prf.c @@ -166,7 +166,7 @@ static int kdf_tls1_prf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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) { diff --git a/providers/implementations/kdfs/x942kdf.c b/providers/implementations/kdfs/x942kdf.c index 3377350bf3..5d85463dd9 100644 --- a/providers/implementations/kdfs/x942kdf.c +++ b/providers/implementations/kdfs/x942kdf.c @@ -70,7 +70,7 @@ static const struct { #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; @@ -387,7 +387,7 @@ static int x942kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { 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; diff --git a/providers/implementations/kem/rsa_kem.c b/providers/implementations/kem/rsa_kem.c index cb02854100..92dd312da7 100644 --- a/providers/implementations/kem/rsa_kem.c +++ b/providers/implementations/kem/rsa_kem.c @@ -52,7 +52,7 @@ static OSSL_FUNC_kem_settable_ctx_params_fn rsakem_settable_ctx_params; * we use that here too. */ typedef struct { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; RSA *rsa; int op; } PROV_RSA_CTX; diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c index b0d89f792a..fd85b6127a 100644 --- a/providers/implementations/keymgmt/dh_kmgmt.c +++ b/providers/implementations/keymgmt/dh_kmgmt.c @@ -52,7 +52,7 @@ static OSSL_FUNC_keymgmt_export_types_fn dh_export_types; (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; @@ -430,7 +430,7 @@ static int dh_validate(void *keydata, 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()) diff --git a/providers/implementations/keymgmt/dsa_kmgmt.c b/providers/implementations/keymgmt/dsa_kmgmt.c index 5cf5c78514..5168ea019b 100644 --- a/providers/implementations/keymgmt/dsa_kmgmt.c +++ b/providers/implementations/keymgmt/dsa_kmgmt.c @@ -50,7 +50,7 @@ static OSSL_FUNC_keymgmt_export_types_fn dsa_export_types; (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; @@ -363,7 +363,7 @@ static int dsa_validate(void *keydata, 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) diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 33d55288dd..c88e933da8 10064 |