From: Dr. Matthias St. Pierre Date: Sat, 20 Jun 2020 23:19:16 +0000 (+0200) Subject: Make the naming scheme for dispatched functions more consistent X-Git-Tag: openssl-3.0.0-alpha4~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=363b1e5daea4a01889e6ff27148018be63d33b9b;p=oweals%2Fopenssl.git Make the naming scheme for dispatched functions more consistent The new naming scheme consistently usese the `OSSL_FUNC_` prefix for all functions which are dispatched between the core and providers. This change includes in particular all up- and downcalls, i.e., the dispatched functions passed from core to provider and vice versa. - OSSL_core_ -> OSSL_FUNC_core_ - OSSL_provider_ -> OSSL_FUNC_core_ For operations and their function dispatch tables, the following convention is used: Type | Name (evp_generic_fetch(3)) | ---------------------|-----------------------------------| operation | OSSL_OP_FOO | function id | OSSL_FUNC_FOO_FUNCTION_NAME | function "name" | OSSL_FUNC_foo_function_name | function typedef | OSSL_FUNC_foo_function_name_fn | function ptr getter | OSSL_FUNC_foo_function_name | Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/12222) --- diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 91baa0d45c..92e9b7bfb0 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -781,68 +781,68 @@ static void *evp_md_from_dispatch(int name_id, switch (fns->function_id) { case OSSL_FUNC_DIGEST_NEWCTX: if (md->newctx == NULL) { - md->newctx = OSSL_get_OP_digest_newctx(fns); + md->newctx = OSSL_FUNC_digest_newctx(fns); fncnt++; } break; case OSSL_FUNC_DIGEST_INIT: if (md->dinit == NULL) { - md->dinit = OSSL_get_OP_digest_init(fns); + md->dinit = OSSL_FUNC_digest_init(fns); fncnt++; } break; case OSSL_FUNC_DIGEST_UPDATE: if (md->dupdate == NULL) { - md->dupdate = OSSL_get_OP_digest_update(fns); + md->dupdate = OSSL_FUNC_digest_update(fns); fncnt++; } break; case OSSL_FUNC_DIGEST_FINAL: if (md->dfinal == NULL) { - md->dfinal = OSSL_get_OP_digest_final(fns); + md->dfinal = OSSL_FUNC_digest_final(fns); fncnt++; } break; case OSSL_FUNC_DIGEST_DIGEST: if (md->digest == NULL) - md->digest = OSSL_get_OP_digest_digest(fns); + md->digest = OSSL_FUNC_digest_digest(fns); /* We don't increment fnct for this as it is stand alone */ break; case OSSL_FUNC_DIGEST_FREECTX: if (md->freectx == NULL) { - md->freectx = OSSL_get_OP_digest_freectx(fns); + md->freectx = OSSL_FUNC_digest_freectx(fns); fncnt++; } break; case OSSL_FUNC_DIGEST_DUPCTX: if (md->dupctx == NULL) - md->dupctx = OSSL_get_OP_digest_dupctx(fns); + md->dupctx = OSSL_FUNC_digest_dupctx(fns); break; case OSSL_FUNC_DIGEST_GET_PARAMS: if (md->get_params == NULL) - md->get_params = OSSL_get_OP_digest_get_params(fns); + md->get_params = OSSL_FUNC_digest_get_params(fns); break; case OSSL_FUNC_DIGEST_SET_CTX_PARAMS: if (md->set_ctx_params == NULL) - md->set_ctx_params = OSSL_get_OP_digest_set_ctx_params(fns); + md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns); break; case OSSL_FUNC_DIGEST_GET_CTX_PARAMS: if (md->get_ctx_params == NULL) - md->get_ctx_params = OSSL_get_OP_digest_get_ctx_params(fns); + md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns); break; case OSSL_FUNC_DIGEST_GETTABLE_PARAMS: if (md->gettable_params == NULL) - md->gettable_params = OSSL_get_OP_digest_gettable_params(fns); + md->gettable_params = OSSL_FUNC_digest_gettable_params(fns); break; case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS: if (md->settable_ctx_params == NULL) md->settable_ctx_params = - OSSL_get_OP_digest_settable_ctx_params(fns); + OSSL_FUNC_digest_settable_ctx_params(fns); break; case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS: if (md->gettable_ctx_params == NULL) md->gettable_ctx_params = - OSSL_get_OP_digest_gettable_ctx_params(fns); + OSSL_FUNC_digest_gettable_ctx_params(fns); break; } } diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 0f6fbb64ec..ec966a0ed5 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1336,80 +1336,80 @@ static void *evp_cipher_from_dispatch(const int name_id, case OSSL_FUNC_CIPHER_NEWCTX: if (cipher->newctx != NULL) break; - cipher->newctx = OSSL_get_OP_cipher_newctx(fns); + cipher->newctx = OSSL_FUNC_cipher_newctx(fns); fnctxcnt++; break; case OSSL_FUNC_CIPHER_ENCRYPT_INIT: if (cipher->einit != NULL) break; - cipher->einit = OSSL_get_OP_cipher_encrypt_init(fns); + cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns); fnciphcnt++; break; case OSSL_FUNC_CIPHER_DECRYPT_INIT: if (cipher->dinit != NULL) break; - cipher->dinit = OSSL_get_OP_cipher_decrypt_init(fns); + cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns); fnciphcnt++; break; case OSSL_FUNC_CIPHER_UPDATE: if (cipher->cupdate != NULL) break; - cipher->cupdate = OSSL_get_OP_cipher_update(fns); + cipher->cupdate = OSSL_FUNC_cipher_update(fns); fnciphcnt++; break; case OSSL_FUNC_CIPHER_FINAL: if (cipher->cfinal != NULL) break; - cipher->cfinal = OSSL_get_OP_cipher_final(fns); + cipher->cfinal = OSSL_FUNC_cipher_final(fns); fnciphcnt++; break; case OSSL_FUNC_CIPHER_CIPHER: if (cipher->ccipher != NULL) break; - cipher->ccipher = OSSL_get_OP_cipher_cipher(fns); + cipher->ccipher = OSSL_FUNC_cipher_cipher(fns); break; case OSSL_FUNC_CIPHER_FREECTX: if (cipher->freectx != NULL) break; - cipher->freectx = OSSL_get_OP_cipher_freectx(fns); + cipher->freectx = OSSL_FUNC_cipher_freectx(fns); fnctxcnt++; break; case OSSL_FUNC_CIPHER_DUPCTX: if (cipher->dupctx != NULL) break; - cipher->dupctx = OSSL_get_OP_cipher_dupctx(fns); + cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns); break; case OSSL_FUNC_CIPHER_GET_PARAMS: if (cipher->get_params != NULL) break; - cipher->get_params = OSSL_get_OP_cipher_get_params(fns); + cipher->get_params = OSSL_FUNC_cipher_get_params(fns); break; case OSSL_FUNC_CIPHER_GET_CTX_PARAMS: if (cipher->get_ctx_params != NULL) break; - cipher->get_ctx_params = OSSL_get_OP_cipher_get_ctx_params(fns); + cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns); break; case OSSL_FUNC_CIPHER_SET_CTX_PARAMS: if (cipher->set_ctx_params != NULL) break; - cipher->set_ctx_params = OSSL_get_OP_cipher_set_ctx_params(fns); + cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns); break; case OSSL_FUNC_CIPHER_GETTABLE_PARAMS: if (cipher->gettable_params != NULL) break; - cipher->gettable_params = OSSL_get_OP_cipher_gettable_params(fns); + cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns); break; case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS: if (cipher->gettable_ctx_params != NULL) break; cipher->gettable_ctx_params = - OSSL_get_OP_cipher_gettable_ctx_params(fns); + OSSL_FUNC_cipher_gettable_ctx_params(fns); break; case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS: if (cipher->settable_ctx_params != NULL) break; cipher->settable_ctx_params = - OSSL_get_OP_cipher_settable_ctx_params(fns); + OSSL_FUNC_cipher_settable_ctx_params(fns); break; } } diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index 4138ad8d95..aeb4cca266 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -83,24 +83,24 @@ struct evp_rand_st { CRYPTO_RWLOCK *refcnt_lock; const OSSL_DISPATCH *dispatch; - OSSL_OP_rand_newctx_fn *newctx; - OSSL_OP_rand_freectx_fn *freectx; - OSSL_OP_rand_instantiate_fn *instantiate; - OSSL_OP_rand_uninstantiate_fn *uninstantiate; - OSSL_OP_rand_generate_fn *generate; - OSSL_OP_rand_reseed_fn *reseed; - OSSL_OP_rand_nonce_fn *nonce; - OSSL_OP_rand_enable_locking_fn *enable_locking; - OSSL_OP_rand_lock_fn *lock; - OSSL_OP_rand_unlock_fn *unlock; - OSSL_OP_rand_gettable_params_fn *gettable_params; - OSSL_OP_rand_gettable_ctx_params_fn *gettable_ctx_params; - OSSL_OP_rand_settable_ctx_params_fn *settable_ctx_params; - OSSL_OP_rand_get_params_fn *get_params; - OSSL_OP_rand_get_ctx_params_fn *get_ctx_params; - OSSL_OP_rand_set_ctx_params_fn *set_ctx_params; - OSSL_OP_rand_set_callbacks_fn *set_callbacks; - OSSL_OP_rand_verify_zeroization_fn *verify_zeroization; + OSSL_FUNC_rand_newctx_fn *newctx; + OSSL_FUNC_rand_freectx_fn *freectx; + OSSL_FUNC_rand_instantiate_fn *instantiate; + OSSL_FUNC_rand_uninstantiate_fn *uninstantiate; + OSSL_FUNC_rand_generate_fn *generate; + OSSL_FUNC_rand_reseed_fn *reseed; + OSSL_FUNC_rand_nonce_fn *nonce; + OSSL_FUNC_rand_enable_locking_fn *enable_locking; + OSSL_FUNC_rand_lock_fn *lock; + OSSL_FUNC_rand_unlock_fn *unlock; + OSSL_FUNC_rand_gettable_params_fn *gettable_params; + OSSL_FUNC_rand_gettable_ctx_params_fn *gettable_ctx_params; + OSSL_FUNC_rand_settable_ctx_params_fn *settable_ctx_params; + OSSL_FUNC_rand_get_params_fn *get_params; + OSSL_FUNC_rand_get_ctx_params_fn *get_ctx_params; + OSSL_FUNC_rand_set_ctx_params_fn *set_ctx_params; + OSSL_FUNC_rand_set_callbacks_fn *set_callbacks; + OSSL_FUNC_rand_verify_zeroization_fn *verify_zeroization; } /* EVP_RAND */ ; struct evp_keymgmt_st { @@ -112,33 +112,33 @@ struct evp_keymgmt_st { CRYPTO_RWLOCK *lock; /* Constructor(s), destructor, information */ - OSSL_OP_keymgmt_new_fn *new; - OSSL_OP_keymgmt_free_fn *free; - OSSL_OP_keymgmt_get_params_fn *get_params; - OSSL_OP_keymgmt_gettable_params_fn *gettable_params; - OSSL_OP_keymgmt_set_params_fn *set_params; - OSSL_OP_keymgmt_settable_params_fn *settable_params; + OSSL_FUNC_keymgmt_new_fn *new; + OSSL_FUNC_keymgmt_free_fn *free; + OSSL_FUNC_keymgmt_get_params_fn *get_params; + OSSL_FUNC_keymgmt_gettable_params_fn *gettable_params; + OSSL_FUNC_keymgmt_set_params_fn *set_params; + OSSL_FUNC_keymgmt_settable_params_fn *settable_params; /* Generation, a complex constructor */ - OSSL_OP_keymgmt_gen_init_fn *gen_init; - OSSL_OP_keymgmt_gen_set_template_fn *gen_set_template; - OSSL_OP_keymgmt_gen_set_params_fn *gen_set_params; - OSSL_OP_keymgmt_gen_settable_params_fn *gen_settable_params; - OSSL_OP_keymgmt_gen_fn *gen; - OSSL_OP_keymgmt_gen_cleanup_fn *gen_cleanup; + OSSL_FUNC_keymgmt_gen_init_fn *gen_init; + OSSL_FUNC_keymgmt_gen_set_template_fn *gen_set_template; + OSSL_FUNC_keymgmt_gen_set_params_fn *gen_set_params; + OSSL_FUNC_keymgmt_gen_settable_params_fn *gen_settable_params; + OSSL_FUNC_keymgmt_gen_fn *gen; + OSSL_FUNC_keymgmt_gen_cleanup_fn *gen_cleanup; /* Key object checking */ - OSSL_OP_keymgmt_query_operation_name_fn *query_operation_name; - OSSL_OP_keymgmt_has_fn *has; - OSSL_OP_keymgmt_validate_fn *validate; - OSSL_OP_keymgmt_match_fn *match; + OSSL_FUNC_keymgmt_query_operation_name_fn *query_operation_name; + OSSL_FUNC_keymgmt_has_fn *has; + OSSL_FUNC_keymgmt_validate_fn *validate; + OSSL_FUNC_keymgmt_match_fn *match; /* Import and export routines */ - OSSL_OP_keymgmt_import_fn *import; - OSSL_OP_keymgmt_import_types_fn *import_types; - OSSL_OP_keymgmt_export_fn *export; - OSSL_OP_keymgmt_export_types_fn *export_types; - OSSL_OP_keymgmt_copy_fn *copy; + OSSL_FUNC_keymgmt_import_fn *import; + OSSL_FUNC_keymgmt_import_types_fn *import_types; + OSSL_FUNC_keymgmt_export_fn *export; + OSSL_FUNC_keymgmt_export_types_fn *export_types; + OSSL_FUNC_keymgmt_copy_fn *copy; } /* EVP_KEYMGMT */ ; struct evp_keyexch_st { @@ -147,16 +147,16 @@ struct evp_keyexch_st { CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *lock; - OSSL_OP_keyexch_newctx_fn *newctx; - OSSL_OP_keyexch_init_fn *init; - OSSL_OP_keyexch_set_peer_fn *set_peer; - OSSL_OP_keyexch_derive_fn *derive; - OSSL_OP_keyexch_freectx_fn *freectx; - OSSL_OP_keyexch_dupctx_fn *dupctx; - OSSL_OP_keyexch_set_ctx_params_fn *set_ctx_params; - OSSL_OP_keyexch_settable_ctx_params_fn *settable_ctx_params; - OSSL_OP_keyexch_get_ctx_params_fn *get_ctx_params; - OSSL_OP_keyexch_gettable_ctx_params_fn *gettable_ctx_params; + OSSL_FUNC_keyexch_newctx_fn *newctx; + OSSL_FUNC_keyexch_init_fn *init; + OSSL_FUNC_keyexch_set_peer_fn *set_peer; + OSSL_FUNC_keyexch_derive_fn *derive; + OSSL_FUNC_keyexch_freectx_fn *freectx; + OSSL_FUNC_keyexch_dupctx_fn *dupctx; + OSSL_FUNC_keyexch_set_ctx_params_fn *set_ctx_params; + OSSL_FUNC_keyexch_settable_ctx_params_fn *settable_ctx_params; + OSSL_FUNC_keyexch_get_ctx_params_fn *get_ctx_params; + OSSL_FUNC_keyexch_gettable_ctx_params_fn *gettable_ctx_params; } /* EVP_KEYEXCH */; struct evp_signature_st { @@ -165,31 +165,31 @@ struct evp_signature_st { CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *lock; - OSSL_OP_signature_newctx_fn *newctx; - OSSL_OP_signature_sign_init_fn *sign_init; - OSSL_OP_signature_sign_fn *sign; - OSSL_OP_signature_verify_init_fn *verify_init; - OSSL_OP_signature_verify_fn *verify; - OSSL_OP_signature_verify_recover_init_fn *verify_recover_init; - OSSL_OP_signature_verify_recover_fn *verify_recover; - OSSL_OP_signature_digest_sign_init_fn *digest_sign_init; - OSSL_OP_signature_digest_sign_update_fn *digest_sign_update; - OSSL_OP_signature_digest_sign_final_fn *digest_sign_final; - OSSL_OP_signature_digest_sign_fn *digest_sign; - OSSL_OP_signature_digest_verify_init_fn *digest_verify_init; - OSSL_OP_signature_digest_verify_update_fn *digest_verify_update; - OSSL_OP_signature_digest_verify_final_fn *digest_verify_final; - OSSL_OP_signature_digest_verify_fn *digest_verify; - OSSL_OP_signature_freectx_fn *freectx; - OSSL_OP_signature_dupctx_fn *dupctx; - OSSL_OP_signature_get_ctx_params_fn *get_ctx_params; - OSSL_OP_signature_gettable_ctx_params_fn *gettable_ctx_params; - OSSL_OP_signature_set_ctx_params_fn *set_ctx_params; - OSSL_OP_signature_settable_ctx_params_fn *settable_ctx_params; - OSSL_OP_signature_get_ctx_md_params_fn *get_ctx_md_params; - OSSL_OP_signature_gettable_ctx_md_params_fn *gettable_ctx_md_params; - OSSL_OP_signature_set_ctx_md_params_fn *set_ctx_md_params; - OSSL_OP_signature_settable_ctx_md_params_fn *settable_ctx_md_params; + OSSL_FUNC_signature_newctx_fn *newctx; + OSSL_FUNC_signature_sign_init_fn *sign_init; + OSSL_FUNC_signature_sign_fn *sign; + OSSL_FUNC_signature_verify_init_fn *verify_init; + OSSL_FUNC_signature_verify_fn *verify; + OSSL_FUNC_signature_verify_recover_init_fn *verify_recover_init; + OSSL_FUNC_signature_verify_recover_fn *verify_recover; + OSSL_FUNC_signature_digest_sign_init_fn *digest_sign_init; + OSSL_FUNC_signature_digest_sign_update_fn *digest_sign_update; + OSSL_FUNC_signature_digest_sign_final_fn *digest_sign_final; + OSSL_FUNC_signature_digest_sign_fn *digest_sign; + OSSL_FUNC_signature_digest_verify_init_fn *digest_verify_init; + OSSL_FUNC_signature_digest_verify_update_fn *digest_verify_update; + OSSL_FUNC_signature_digest_verify_final_fn *digest_verify_final; + OSSL_FUNC_signature_digest_verify_fn *digest_verify; + OSSL_FUNC_signature_freectx_fn *freectx; + OSSL_FUNC_signature_dupctx_fn *dupctx; + OSSL_FUNC_signature_get_ctx_params_fn *get_ctx_params; + OSSL_FUNC_signature_gettable_ctx_params_fn *gettable_ctx_params; + OSSL_FUNC_signature_set_ctx_params_fn *set_ctx_params; + OSSL_FUNC_signature_settable_ctx_params_fn *settable_ctx_params; + OSSL_FUNC_signature_get_ctx_md_params_fn *get_ctx_md_params; + OSSL_FUNC_signature_gettable_ctx_md_params_fn *gettable_ctx_md_params; + OSSL_FUNC_signature_set_ctx_md_params_fn *set_ctx_md_params; + OSSL_FUNC_signature_settable_ctx_md_params_fn *settable_ctx_md_params; } /* EVP_SIGNATURE */; struct evp_asym_cipher_st { @@ -198,17 +198,17 @@ struct evp_asym_cipher_st { CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *lock; - OSSL_OP_asym_cipher_newctx_fn *newctx; - OSSL_OP_asym_cipher_encrypt_init_fn *encrypt_init; - OSSL_OP_asym_cipher_encrypt_fn *encrypt; - OSSL_OP_asym_cipher_decrypt_init_fn *decrypt_init; - OSSL_OP_asym_cipher_decrypt_fn *decrypt; - OSSL_OP_asym_cipher_freectx_fn *freectx; - OSSL_OP_asym_cipher_dupctx_fn *dupctx; - OSSL_OP_asym_cipher_get_ctx_params_fn *get_ctx_params; - OSSL_OP_asym_cipher_gettable_ctx_params_fn *gettable_ctx_params; - OSSL_OP_asym_cipher_set_ctx_params_fn *set_ctx_params; - OSSL_OP_asym_cipher_settable_ctx_params_fn *settable_ctx_params; + OSSL_FUNC_asym_cipher_newctx_fn *newctx; + OSSL_FUNC_asym_cipher_encrypt_init_fn *encrypt_init; + OSSL_FUNC_asym_cipher_encrypt_fn *encrypt; + OSSL_FUNC_asym_cipher_decrypt_init_fn *decrypt_init; + OSSL_FUNC_asym_cipher_decrypt_fn *decrypt; + OSSL_FUNC_asym_cipher_freectx_fn *freectx; + OSSL_FUNC_asym_cipher_dupctx_fn *dupctx; + OSSL_FUNC_asym_cipher_get_ctx_params_fn *get_ctx_params; + OSSL_FUNC_asym_cipher_gettable_ctx_params_fn *gettable_ctx_params; + OSSL_FUNC_asym_cipher_set_ctx_params_fn *set_ctx_params; + OSSL_FUNC_asym_cipher_settable_ctx_params_fn *settable_ctx_params; } /* EVP_ASYM_CIPHER */; int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c index f7bc321f29..6e3541481a 100644 --- a/crypto/evp/evp_rand.c +++ b/crypto/evp/evp_rand.c @@ -107,103 +107,103 @@ static void *evp_rand_from_dispatch(int name_id, case OSSL_FUNC_RAND_NEWCTX: if (rand->newctx != NULL) break; - rand->newctx = OSSL_get_OP_rand_newctx(fns); + rand->newctx = OSSL_FUNC_rand_newctx(fns); fnctxcnt++; break; case OSSL_FUNC_RAND_FREECTX: if (rand->freectx != NULL) break; - rand->freectx = OSSL_get_OP_rand_freectx(fns); + rand->freectx = OSSL_FUNC_rand_freectx(fns); fnctxcnt++; break; case OSSL_FUNC_RAND_INSTANTIATE: if (rand->instantiate != NULL) break; - rand->instantiate = OSSL_get_OP_rand_instantiate(fns); + rand->instantiate = OSSL_FUNC_rand_instantiate(fns); fnrandcnt++; break; case OSSL_FUNC_RAND_UNINSTANTIATE: if (rand->uninstantiate != NULL) break; - rand->uninstantiate = OSSL_get_OP_rand_uninstantiate(fns); + rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns); fnrandcnt++; break; case OSSL_FUNC_RAND_GENERATE: if (rand->generate != NULL) break; - rand->generate = OSSL_get_OP_rand_generate(fns); + rand->generate = OSSL_FUNC_rand_generate(fns); fnrandcnt++; break; case OSSL_FUNC_RAND_RESEED: if (rand->reseed != NULL) break; - rand->reseed = OSSL_get_OP_rand_reseed(fns); + rand->reseed = OSSL_FUNC_rand_reseed(fns); break; case OSSL_FUNC_RAND_NONCE: if (rand->nonce != NULL) break; - rand->nonce = OSSL_get_OP_rand_nonce(fns); + rand->nonce = OSSL_FUNC_rand_nonce(fns); break; case OSSL_FUNC_RAND_SET_CALLBACKS: if (rand->set_callbacks != NULL) break; - rand->set_callbacks = OSSL_get_OP_rand_set_callbacks(fns); + rand->set_callbacks = OSSL_FUNC_rand_set_callbacks(fns); break; case OSSL_FUNC_RAND_ENABLE_LOCKING: if (rand->enable_locking != NULL) break; - rand->enable_locking = OSSL_get_OP_rand_enable_locking(fns); + rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns); fnlockcnt++; break; case OSSL_FUNC_RAND_LOCK: if (rand->lock != NULL) break; - rand->lock = OSSL_get_OP_rand_lock(fns); + rand->lock = OSSL_FUNC_rand_lock(fns); fnlockcnt++; break; case OSSL_FUNC_RAND_UNLOCK: if (rand->unlock != NULL) break; - rand->unlock = OSSL_get_OP_rand_unlock(fns); + rand->unlock = OSSL_FUNC_rand_unlock(fns); fnlockcnt++; break; case OSSL_FUNC_RAND_GETTABLE_PARAMS: if (rand->gettable_params != NULL) break; rand->gettable_params = - OSSL_get_OP_rand_gettable_params(fns); + OSSL_FUNC_rand_gettable_params(fns); break; case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS: if (rand->gettable_ctx_params != NULL) break; rand->gettable_ctx_params = - OSSL_get_OP_rand_gettable_ctx_params(fns); + OSSL_FUNC_rand_gettable_ctx_params(fns); break; case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS: if (rand->settable_ctx_params != NULL) break; rand->settable_ctx_params = - OSSL_get_OP_rand_settable_ctx_params(fns); + OSSL_FUNC_rand_settable_ctx_params(fns); break; case OSSL_FUNC_RAND_GET_PARAMS: if (rand->get_params != NULL) break; - rand->get_params = OSSL_get_OP_rand_get_params(fns); + rand->get_params = OSSL_FUNC_rand_get_params(fns); break; case OSSL_FUNC_RAND_GET_CTX_PARAMS: if (rand->get_ctx_params != NULL) break; - rand->get_ctx_params = OSSL_get_OP_rand_get_ctx_params(fns); + rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns); break; case OSSL_FUNC_RAND_SET_CTX_PARAMS: if (rand->set_ctx_params != NULL) break; - rand->set_ctx_params = OSSL_get_OP_rand_set_ctx_params(fns); + rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns); break; case OSSL_FUNC_RAND_VERIFY_ZEROIZATION: if (rand->verify_zeroization != NULL) break; - rand->verify_zeroization = OSSL_get_OP_rand_verify_zeroization(fns); + rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns); #ifdef FIPS_MODULE fnzeroizecnt++; #endif diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c index 514ecd4039..28e1f88db9 100644 --- a/crypto/evp/exchange.c +++ b/crypto/evp/exchange.c @@ -57,61 +57,61 @@ static void *evp_keyexch_from_dispatch(int name_id, case OSSL_FUNC_KEYEXCH_NEWCTX: if (exchange->newctx != NULL) break; - exchange->newctx = OSSL_get_OP_keyexch_newctx(fns); + exchange->newctx = OSSL_FUNC_keyexch_newctx(fns); fncnt++; break; case OSSL_FUNC_KEYEXCH_INIT: if (exchange->init != NULL) break; - exchange->init = OSSL_get_OP_keyexch_init(fns); + exchange->init = OSSL_FUNC_keyexch_init(fns); fncnt++; break; case OSSL_FUNC_KEYEXCH_SET_PEER: if (exchange->set_peer != NULL) break; - exchange->set_peer = OSSL_get_OP_keyexch_set_peer(fns); + exchange->set_peer = OSSL_FUNC_keyexch_set_peer(fns); break; case OSSL_FUNC_KEYEXCH_DERIVE: if (exchange->derive != NULL) break; - exchange->derive = OSSL_get_OP_keyexch_derive(fns); + exchange->derive = OSSL_FUNC_keyexch_derive(fns); fncnt++; break; case OSSL_FUNC_KEYEXCH_FREECTX: if (exchange->freectx != NULL) break; - exchange->freectx = OSSL_get_OP_keyexch_freectx(fns); + exchange->freectx = OSSL_FUNC_keyexch_freectx(fns); fncnt++; break; case OSSL_FUNC_KEYEXCH_DUPCTX: if (exchange->dupctx != NULL) break; - exchange->dupctx = OSSL_get_OP_keyexch_dupctx(fns); + exchange->dupctx = OSSL_FUNC_keyexch_dupctx(fns); break; case OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS: if (exchange->get_ctx_params != NULL) break; - exchange->get_ctx_params = OSSL_get_OP_keyexch_get_ctx_params(fns); + exchange->get_ctx_params = OSSL_FUNC_keyexch_get_ctx_params(fns); gparamfncnt++; break; case OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS: if (exchange->gettable_ctx_params != NULL) break; exchange->gettable_ctx_params - = OSSL_get_OP_keyexch_gettable_ctx_params(fns); + = OSSL_FUNC_keyexch_gettable_ctx_params(fns); gparamfncnt++; break; case OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS: if (exchange->set_ctx_params != NULL) break; - exchange->set_ctx_params = OSSL_get_OP_keyexch_set_ctx_params(fns); + exchange->set_ctx_params = OSSL_FUNC_keyexch_set_ctx_params(fns); sparamfncnt++; break; case OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS: if (exchange->settable_ctx_params != NULL) break; exchange->settable_ctx_params - = OSSL_get_OP_keyexch_settable_ctx_params(fns); + = OSSL_FUNC_keyexch_settable_ctx_params(fns); sparamfncnt++; break; } diff --git a/crypto/evp/kdf_meth.c b/crypto/evp/kdf_meth.c index a328c97c08..304718f80e 100644 --- a/crypto/evp/kdf_meth.c +++ b/crypto/evp/kdf_meth.c @@ -70,63 +70,63 @@ static void *evp_kdf_from_dispatch(int name_id, case OSSL_FUNC_KDF_NEWCTX: if (kdf->newctx != NULL) break; - kdf->newctx = OSSL_get_OP_kdf_newctx(fns); + kdf->newctx = OSSL_FUNC_kdf_newctx(fns); fnctxcnt++; break; case OSSL_FUNC_KDF_DUPCTX: if (kdf->dupctx != NULL) break; - kdf->dupctx = OSSL_get_OP_kdf_dupctx(fns); + kdf->dupctx = OSSL_FUNC_kdf_dupctx(fns); break; case OSSL_FUNC_KDF_FREECTX: if (kdf->freectx != NULL) break; - kdf->freectx = OSSL_get_OP_kdf_freectx(fns); + kdf->freectx = OSSL_FUNC_kdf_freectx(fns); fnctxcnt++; break; case OSSL_FUNC_KDF_RESET: if (kdf->reset != NULL) break; - kdf->reset = OSSL_get_OP_kdf_reset(fns); + kdf->reset = OSSL_FUNC_kdf_reset(fns); break; case OSSL_FUNC_KDF_DERIVE: if (kdf->derive != NULL) break; - kdf->derive = OSSL_get_OP_kdf_derive(fns); + kdf->derive = OSSL_FUNC_kdf_derive(fns); fnkdfcnt++; break; case OSSL_FUNC_KDF_GETTABLE_PARAMS: if (kdf->gettable_params != NULL) break; kdf->gettable_params = - OSSL_get_OP_kdf_gettable_params(fns); + OSSL_FUNC_kdf_gettable_params(fns); break; case OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS: if (kdf->gettable_ctx_params != NULL) break; kdf->gettable_ctx_params = - OSSL_get_OP_kdf_gettable_ctx_params(fns); + OSSL_FUNC_kdf_gettable_ctx_params(fns); break; case OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS: if (kdf->settable_ctx_params != NULL) break; kdf->settable_ctx_params = - OSSL_get_OP_kdf_settable_ctx_params(fns); + OSSL_FUNC_kdf_settable_ctx_params(fns); break; case OSSL_FUNC_KDF_GET_PARAMS: if (kdf->get_params != NULL) break; - kdf->get_params = OSSL_get_OP_kdf_get_params(fns); + kdf->get_params = OSSL_FUNC_kdf_get_params(fns); break; case OSSL_FUNC_KDF_GET_CTX_PARAMS: if (kdf->get_ctx_params != NULL) break; - kdf->get_ctx_params = OSSL_get_OP_kdf_get_ctx_params(fns); + kdf->get_ctx_params = OSSL_FUNC_kdf_get_ctx_params(fns); break; case OSSL_FUNC_KDF_SET_CTX_PARAMS: if (kdf->set_ctx_params != NULL) break; - kdf->set_ctx_params = OSSL_get_OP_kdf_set_ctx_params(fns); + kdf->set_ctx_params = OSSL_FUNC_kdf_set_ctx_params(fns); break; } } diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c index 55dcae73e3..7847b98380 100644 --- a/crypto/evp/keymgmt_meth.c +++ b/crypto/evp/keymgmt_meth.c @@ -52,112 +52,112 @@ static void *keymgmt_from_dispatch(int name_id, switch (fns->function_id) { case OSSL_FUNC_KEYMGMT_NEW: if (keymgmt->new == NULL) - keymgmt->new = OSSL_get_OP_keymgmt_new(fns); + keymgmt->new = OSSL_FUNC_keymgmt_new(fns); break; case OSSL_FUNC_KEYMGMT_GEN_INIT: if (keymgmt->gen_init == NULL) - keymgmt->gen_init = OSSL_get_OP_keymgmt_gen_init(fns); + keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns); break; case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE: if (keymgmt->gen_set_template == NULL) keymgmt->gen_set_template = - OSSL_get_OP_keymgmt_gen_set_template(fns); + OSSL_FUNC_keymgmt_gen_set_template(fns); break; case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS: if (keymgmt->gen_set_params == NULL) { setgenparamfncnt++; keymgmt->gen_set_params = - OSSL_get_OP_keymgmt_gen_set_params(fns); + OSSL_FUNC_keymgmt_gen_set_params(fns); } break; case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS: if (keymgmt->gen_settable_params == NULL) { setgenparamfncnt++; keymgmt->gen_settable_params = - OSSL_get_OP_keymgmt_gen_settable_params(fns); + OSSL_FUNC_keymgmt_gen_settable_params(fns); } break; case OSSL_FUNC_KEYMGMT_GEN: if (keymgmt->gen == NULL) - keymgmt->gen = OSSL_get_OP_keymgmt_gen(fns); + keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns); break; case OSSL_FUNC_KEYMGMT_GEN_CLEANUP: if (keymgmt->gen_cleanup == NULL) - keymgmt->gen_cleanup = OSSL_get_OP_keymgmt_gen_cleanup(fns); + keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns); break; case OSSL_FUNC_KEYMGMT_FREE: if (keymgmt->free == NULL) - keymgmt->free = OSSL_get_OP_keymgmt_free(fns); + keymgmt->free = OSSL_FUNC_keymgmt_free(fns); break; case OSSL_FUNC_KEYMGMT_GET_PARAMS: if (keymgmt->get_params == NULL) { getparamfncnt++; - keymgmt->get_params = OSSL_get_OP_keymgmt_get_params(fns); + keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns); } break; case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS: if (keymgmt->gettable_params == NULL) { getparamfncnt++; keymgmt->gettable_params = - OSSL_get_OP_keymgmt_gettable_params(fns); + OSSL_FUNC_keymgmt_gettable_params(fns); } break; case OSSL_FUNC_KEYMGMT_SET_PARAMS: if (keymgmt->set_params == NULL) { setparamfncnt++; - keymgmt->set_params = OSSL_get_OP_keymgmt_set_params(fns); + keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns); } break; case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS: if (keymgmt->settable_params == NULL) { setparamfncnt++; keymgmt->settable_params = - OSSL_get_OP_keymgmt_settable_params(fns); + OSSL_FUNC_keymgmt_settable_params(fns); } break; case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME: if (keymgmt->query_operation_name == NULL) keymgmt->query_operation_name = - OSSL_get_OP_keymgmt_query_operation_name(fns); + OSSL_FUNC_keymgmt_query_operation_name(fns); break; case OSSL_FUNC_KEYMGMT_HAS: if (keymgmt->has == NULL) - keymgmt->has = OSSL_get_OP_keymgmt_has(fns); + keymgmt->has = OSSL_FUNC_keymgmt_has(fns); break; case OSSL_FUNC_KEYMGMT_COPY: if (keymgmt->copy == NULL) - keymgmt->copy = OSSL_get_OP_keymgmt_copy(fns); + keymgmt->copy = OSSL_FUNC_keymgmt_copy(fns); break; case OSSL_FUNC_KEYMGMT_VALIDATE: if (keymgmt->validate == NULL) - keymgmt->validate = OSSL_get_OP_keymgmt_validate(fns); + keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns); break; case OSSL_FUNC_KEYMGMT_MATCH: if (keymgmt->match == NULL) - keymgmt->match = OSSL_get_OP_keymgmt_match(fns); + keymgmt->match = OSSL_FUNC_keymgmt_match(fns); break; case OSSL_FUNC_KEYMGMT_IMPORT: if (keymgmt->import == NULL) { importfncnt++; - keymgmt->import = OSSL_get_OP_keymgmt_import(fns); + keymgmt->import = OSSL_FUNC_keymgmt_import(fns); } break; case OSSL_FUNC_KEYMGMT_IMPORT_TYPES: if (keymgmt->import_types == NULL) { importfncnt++; - keymgmt->import_types = OSSL_get_OP_keymgmt_import_types(fns); + keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns); } break; case OSSL_FUNC_KEYMGMT_EXPORT: if (keymgmt->export == NULL) { exportfncnt++; - keymgmt->export = OSSL_get_OP_keymgmt_export(fns); + keymgmt->export = OSSL_FUNC_keymgmt_export(fns); } break; case OSSL_FUNC_KEYMGMT_EXPORT_TYPES: if (keymgmt->export_types == NULL) { exportfncnt++; - keymgmt->export_types = OSSL_get_OP_keymgmt_export_types(fns); + keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns); } break; } diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c index c22ebd335f..d96383a961 100644 --- a/crypto/evp/mac_meth.c +++ b/crypto/evp/mac_meth.c @@ -64,70 +64,70 @@ static void *evp_mac_from_dispatch(int name_id, case OSSL_FUNC_MAC_NEWCTX: if (mac->newctx != NULL) break; - mac->newctx = OSSL_get_OP_mac_newctx(fns); + mac->newctx = OSSL_FUNC_mac_newctx(fns); fnctxcnt++; break; case OSSL_FUNC_MAC_DUPCTX: if (mac->dupctx != NULL) break; - mac->dupctx = OSSL_get_OP_mac_dupctx(fns); + mac->dupctx = OSSL_FUNC_mac_dupctx(fns); break; case OSSL_FUNC_MAC_FREECTX: if (mac->freectx != NULL) break; - mac->freectx = OSSL_get_OP_mac_freectx(fns); + mac->freectx = OSSL_FUNC_mac_freectx(fns); fnctxcnt++; break; case OSSL_FUNC_MAC_INIT: if (mac->init != NULL) break; - mac->init = OSSL_get_OP_mac_init(fns); + mac->init = OSSL_FUNC_mac_init(fns); fnmaccnt++; break; case OSSL_FUNC_MAC_UPDATE: if (mac->update != NULL) break; - mac->update = OSSL_get_OP_mac_update(fns); + mac->update = OSSL_FUNC_mac_update(fns); fnmaccnt++; break; case OSSL_FUNC_MAC_FINAL: if (mac->final != NULL) break; - mac->final = OSSL_get_OP_mac_final(fns); + mac->final = OSSL_FUNC_mac_final(fns); fnmaccnt++; break; case OSSL_FUNC_MAC_GETTABLE_PARAMS: if (mac->gettable_params != NULL) break; mac->gettable_params = - OSSL_get_OP_mac_gettable_params(fns); + OSSL_FUNC_mac_gettable_params(fns); break; case OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS: if (mac->gettable_ctx_params != NULL) break; mac->gettable_ctx_params = - OSSL_get_OP_mac_gettable_ctx_params(fns); + OSSL_FUNC_mac_gettable_ctx_params(fns); break; case OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS: if (mac->settable_ctx_params != NULL) break; mac->settable_ctx_params = - OSSL_get_OP_mac_settable_ctx_params(fns); + OSSL_FUNC_mac_settable_ctx_params(fns); break; case OSSL_FUNC_MAC_GET_PARAMS: if (mac->get_params != NULL) break; - mac->get_params = OSSL_get_OP_mac_get_params(fns); + mac->get_params = OSSL_FUNC_mac_get_params(fns); break; case OSSL_FUNC_MAC_GET_CTX_PARAMS: if (mac->get_ctx_params != NULL) break; - mac->get_ctx_params = OSSL_get_OP_mac_get_ctx_params(fns); + mac->get_ctx_params = OSSL_FUNC_mac_get_ctx_params(fns); break; case OSSL_FUNC_MAC_SET_CTX_PARAMS: if (mac->set_ctx_params != NULL) break; - mac->set_ctx_params = OSSL_get_OP_mac_set_ctx_params(fns); + mac->set_ctx_params = OSSL_FUNC_mac_set_ctx_params(fns); break; } } diff --git a/crypto/evp/pmeth_fn.c b/crypto/evp/pmeth_fn.c index 8bc59c40b9..2ecad8b77c 100644 --- a/crypto/evp/pmeth_fn.c +++ b/crypto/evp/pmeth_fn.c @@ -285,70 +285,70 @@ static void *evp_asym_cipher_from_dispatch(int name_id, case OSSL_FUNC_ASYM_CIPHER_NEWCTX: if (cipher->newctx != NULL) break; - cipher->newctx = OSSL_get_OP_asym_cipher_newctx(fns); + cipher->newctx = OSSL_FUNC_asym_cipher_newctx(fns); ctxfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT: if (cipher->encrypt_init != NULL) break; - cipher->encrypt_init = OSSL_get_OP_asym_cipher_encrypt_init(fns); + cipher->encrypt_init = OSSL_FUNC_asym_cipher_encrypt_init(fns); encfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_ENCRYPT: if (cipher->encrypt != NULL) break; - cipher->encrypt = OSSL_get_OP_asym_cipher_encrypt(fns); + cipher->encrypt = OSSL_FUNC_asym_cipher_encrypt(fns); encfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT: if (cipher->decrypt_init != NULL) break; - cipher->decrypt_init = OSSL_get_OP_asym_cipher_decrypt_init(fns); + cipher->decrypt_init = OSSL_FUNC_asym_cipher_decrypt_init(fns); decfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_DECRYPT: if (cipher->decrypt != NULL) break; - cipher->decrypt = OSSL_get_OP_asym_cipher_decrypt(fns); + cipher->decrypt = OSSL_FUNC_asym_cipher_decrypt(fns); decfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_FREECTX: if (cipher->freectx != NULL) break; - cipher->freectx = OSSL_get_OP_asym_cipher_freectx(fns); + cipher->freectx = OSSL_FUNC_asym_cipher_freectx(fns); ctxfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_DUPCTX: if (cipher->dupctx != NULL) break; - cipher->dupctx = OSSL_get_OP_asym_cipher_dupctx(fns); + cipher->dupctx = OSSL_FUNC_asym_cipher_dupctx(fns); break; case OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS: if (cipher->get_ctx_params != NULL) break; cipher->get_ctx_params - = OSSL_get_OP_asym_cipher_get_ctx_params(fns); + = OSSL_FUNC_asym_cipher_get_ctx_params(fns); gparamfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS: if (cipher->gettable_ctx_params != NULL) break; cipher->gettable_ctx_params - = OSSL_get_OP_asym_cipher_gettable_ctx_params(fns); + = OSSL_FUNC_asym_cipher_gettable_ctx_params(fns); gparamfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS: if (cipher->set_ctx_params != NULL) break; cipher->set_ctx_params - = OSSL_get_OP_asym_cipher_set_ctx_params(fns); + = OSSL_FUNC_asym_cipher_set_ctx_params(fns); sparamfncnt++; break; case OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS: if (cipher->settable_ctx_params != NULL) break; cipher->settable_ctx_params - = OSSL_get_OP_asym_cipher_settable_ctx_params(fns); + = OSSL_FUNC_asym_cipher_settable_ctx_params(fns); sparamfncnt++; break; } diff --git a/crypto/evp/signature.c b/crypto/evp/signature.c index 595a93e66e..03fd8582f8 100644 --- a/crypto/evp/signature.c +++ b/crypto/evp/signature.c @@ -59,164 +59,164 @@ static void *evp_signature_from_dispatch(int name_id, case OSSL_FUNC_SIGNATURE_NEWCTX: if (signature->newctx != NULL) break; - signature->newctx = OSSL_get_OP_signature_newctx(fns); + signature->newctx = OSSL_FUNC_signature_newctx(fns); ctxfncnt++; break; case OSSL_FUNC_SIGNATURE_SIGN_INIT: if (signature->sign_init != NULL) break; - signature->sign_init = OSSL_get_OP_signature_sign_init(fns); + signature->sign_init = OSSL_FUNC_signature_sign_init(fns); signfncnt++; break; case OSSL_FUNC_SIGNATURE_SIGN: if (signature->sign != NULL) break; - signature->sign = OSSL_get_OP_signature_sign(fns); + signature->sign = OSSL_FUNC_signature_sign(fns); signfncnt++; break; case OSSL_FUNC_SIGNATURE_VERIFY_INIT: if (signature->verify_init != NULL) break; - signature->verify_init = OSSL_get_OP_signature_verify_init(fns); + signature->verify_init = OSSL_FUNC_signature_verify_init(fns); verifyfncnt++; break; case OSSL_FUNC_SIGNATURE_VERIFY: if (signature->verify != NULL) break; - signature->verify = OSSL_get_OP_signature_verify(fns); + signature->verify = OSSL_FUNC_signature_verify(fns); verifyfncnt++; break; case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT: if (signature->verify_recover_init != NULL) break; signature->verify_recover_init - = OSSL_get_OP_signature_verify_recover_init(fns); + = OSSL_FUNC_signature_verify_recover_init(fns); verifyrecfncnt++; break; case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER: if (signature->verify_recover != NULL) break; signature->verify_recover - = OSSL_get_OP_signature_verify_recover(fns); + = OSSL_FUNC_signature_verify_recover(fns); verifyrecfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT: if (signature->digest_sign_init != NULL) break; signature->digest_sign_init - = OSSL_get_OP_signature_digest_sign_init(fns); + = OSSL_FUNC_signature_digest_sign_init(fns); break; case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE: if (signature->digest_sign_update != NULL) break; signature->digest_sign_update - = OSSL_get_OP_signature_digest_sign_update(fns); + = OSSL_FUNC_signature_digest_sign_update(fns); digsignfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL: if (signature->digest_sign_final != NULL) break; signature->digest_sign_final - = OSSL_get_OP_signature_digest_sign_final(fns); + = OSSL_FUNC_signature_digest_sign_final(fns); digsignfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_SIGN: if (signature->digest_sign != NULL) break; signature->digest_sign - = OSSL_get_OP_signature_digest_sign(fns); + = OSSL_FUNC_signature_digest_sign(fns); break; case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT: if (signature->digest_verify_init != NULL) break; signature->digest_verify_init - = OSSL_get_OP_signature_digest_verify_init(fns); + = OSSL_FUNC_signature_digest_verify_init(fns); break; case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE: if (signature->digest_verify_update != NULL) break; signature->digest_verify_update - = OSSL_get_OP_signature_digest_verify_update(fns); + = OSSL_FUNC_signature_digest_verify_update(fns); digverifyfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL: if (signature->digest_verify_final != NULL) break; signature->digest_verify_final - = OSSL_get_OP_signature_digest_verify_final(fns); + = OSSL_FUNC_signature_digest_verify_final(fns); digverifyfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY: if (signature->digest_verify != NULL) break; signature->digest_verify - = OSSL_get_OP_signature_digest_verify(fns); + = OSSL_FUNC_signature_digest_verify(fns); break; case OSSL_FUNC_SIGNATURE_FREECTX: if (signature->freectx != NULL) break; - signature->freectx = OSSL_get_OP_signature_freectx(fns); + signature->freectx = OSSL_FUNC_signature_freectx(fns); ctxfncnt++; break; case OSSL_FUNC_SIGNATURE_DUPCTX: if (signature->dupctx != NULL) break; - signature->dupctx = OSSL_get_OP_signature_dupctx(fns); + signature->dupctx = OSSL_FUNC_signature_dupctx(fns); break; case OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS: if (signature->get_ctx_params != NULL) break; signature->get_ctx_params - = OSSL_get_OP_signature_get_ctx_params(fns); + = OSSL_FUNC_signature_get_ctx_params(fns); gparamfncnt++; break; case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS: if (signature->gettable_ctx_params != NULL) break; signature->gettable_ctx_params - = OSSL_get_OP_signature_gettable_ctx_params(fns); + = OSSL_FUNC_signature_gettable_ctx_params(fns); gparamfncnt++; break; case OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS: if (signature->set_ctx_params != NULL) break; signature->set_ctx_params - = OSSL_get_OP_signature_set_ctx_params(fns); + = OSSL_FUNC_signature_set_ctx_params(fns); sparamfncnt++; break; case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS: if (signature->settable_ctx_params != NULL) break; signature->settable_ctx_params - = OSSL_get_OP_signature_settable_ctx_params(fns); + = OSSL_FUNC_signature_settable_ctx_params(fns); sparamfncnt++; break; case OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS: if (signature->get_ctx_md_params != NULL) break; signature->get_ctx_md_params - = OSSL_get_OP_signature_get_ctx_md_params(fns); + = OSSL_FUNC_signature_get_ctx_md_params(fns); gmdparamfncnt++; break; case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS: if (signature->gettable_ctx_md_params != NULL) break; signature->gettable_ctx_md_params - = OSSL_get_OP_signature_gettable_ctx_md_params(fns); + = OSSL_FUNC_signature_gettable_ctx_md_params(fns); gmdparamfncnt++; break; case OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS: if (signature->set_ctx_md_params != NULL) break; signature->set_ctx_md_params - = OSSL_get_OP_signature_set_ctx_md_params(fns); + = OSSL_FUNC_signature_set_ctx_md_params(fns); smdparamfncnt++; break; case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS: if (signature->settable_ctx_md_params != NULL) break; signature->settable_ctx_md_params - = OSSL_get_OP_signature_settable_ctx_md_params(fns); + = OSSL_FUNC_signature_settable_ctx_md_params(fns); smdparamfncnt++; break; } diff --git a/crypto/initthread.c b/crypto/initthread.c index 23b34966a5..c9a34a77db 100644 --- a/crypto/initthread.c +++ b/crypto/initthread.c @@ -26,7 +26,7 @@ * by calling "c_thread_start" which is a function pointer created during * provider initialisation (i.e. OSSL_init_provider). */ -extern OSSL_core_thread_start_fn *c_thread_start; +extern OSSL_FUNC_core_thread_start_fn *c_thread_start; #endif typedef struct thread_event_handler_st THREAD_EVENT_HANDLER; diff --git a/crypto/provider_core.c b/crypto/provider_core.c index 20319b7417..a2350bb88e 100644 --- a/crypto/provider_core.c +++ b/crypto/provider_core.c @@ -67,11 +67,11 @@ struct ossl_provider_st { #endif /* Provider side functions */ - OSSL_provider_teardown_fn *teardown; - OSSL_provider_gettable_params_fn *gettable_params; - OSSL_provider_get_params_fn *get_params; - OSSL_provider_get_capabilities_fn *get_capabilities; - OSSL_provider_query_operation_fn *query_operation; + OSSL_FUNC_provider_teardown_fn *teardown; + OSSL_FUNC_provider_gettable_params_fn *gettable_params; + OSSL_FUNC_provider_get_params_fn *get_params; + OSSL_FUNC_provider_get_capabilities_fn *get_capabilities; + OSSL_FUNC_provider_query_operation_fn *query_operation; /* * Cache of bit to indicate of query_operation() has been called on @@ -451,7 +451,7 @@ static int provider_activate(OSSL_PROVIDER *prov) void *tmp_provctx = NULL; /* safety measure */ #ifndef OPENSSL_NO_ERR # ifndef FIPS_MODULE - OSSL_provider_get_reason_strings_fn *p_get_reason_strings = NULL; + OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL; # endif #endif @@ -534,29 +534,29 @@ static int provider_activate(OSSL_PROVIDER *prov) switch (provider_dispatch->function_id) { case OSSL_FUNC_PROVIDER_TEARDOWN: prov->teardown = - OSSL_get_provider_teardown(provider_dispatch); + OSSL_FUNC_provider_teardown(provider_dispatch); break; case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS: prov->gettable_params = - OSSL_get_provider_gettable_params(provider_dispatch); + OSSL_FUNC_provider_gettable_params(provider_dispatch); break; case OSSL_FUNC_PROVIDER_GET_PARAMS: prov->get_params = - OSSL_get_provider_get_params(provider_dispatch); + OSSL_FUNC_provider_get_params(provider_dispatch); break; case OSSL_FUNC_PROVIDER_GET_CAPABILITIES: prov->get_capabilities = - OSSL_get_provider_get_capabilities(provider_dispatch); + OSSL_FUNC_provider_get_capabilities(provider_dispatch); break; case OSSL_FUNC_PROVIDER_QUERY_OPERATION: prov->query_operation = - OSSL_get_provider_query_operation(provider_dispatch); + OSSL_FUNC_provider_query_operation(provider_dispatch); break; #ifndef OPENSSL_NO_ERR # ifndef FIPS_MODULE case OSSL_FUNC_PROVIDER_GET_REASON_STRINGS: p_get_reason_strings = - OSSL_get_provider_get_reason_strings(provider_dispatch); + OSSL_FUNC_provider_get_reason_strings(provider_dispatch); break; # endif #endif @@ -906,17 +906,17 @@ static const OSSL_PARAM param_types[] = { * This ensures that the compiler will complain if they aren't defined * with the correct signature. */ -static OSSL_core_gettable_params_fn core_gettable_params; -static OSSL_core_get_params_fn core_get_params; -static OSSL_core_thread_start_fn core_thread_start; -static OSSL_core_get_library_context_fn core_get_libctx; +static OSSL_FUNC_core_gettable_params_fn core_gettable_params; +static OSSL_FUNC_core_get_params_fn core_get_params; +static OSSL_FUNC_core_thread_start_fn core_thread_start; +static OSSL_FUNC_core_get_library_context_fn core_get_libctx; #ifndef FIPS_MODULE -static OSSL_core_new_error_fn core_new_error; -static OSSL_core_set_error_debug_fn core_set_error_debug; -static OSSL_core_vset_error_fn core_vset_error; -static OSSL_core_set_error_mark_fn core_set_error_mark; -static OSSL_core_clear_last_error_mark_fn core_clear_last_error_mark; -static OSSL_core_pop_error_to_mark_fn core_pop_error_to_mark; +static OSSL_FUNC_core_new_error_fn core_new_error; +static OSSL_FUNC_core_set_error_debug_fn core_set_error_debug; +static OSSL_FUNC_core_vset_error_fn core_vset_error; +static OSSL_FUNC_core_set_error_mark_fn core_set_error_mark; +static OSSL_FUNC_core_clear_last_error_mark_fn core_clear_last_error_mark; +static OSSL_FUNC_core_pop_error_to_mark_fn core_pop_error_to_mark; #endif static const OSSL_PARAM *core_gettable_params(const OSSL_CORE_HANDLE *handle) diff --git a/crypto/serializer/serializer_local.h b/crypto/serializer/serializer_local.h index 121616d24a..970c7c5585 100644 --- a/crypto/serializer/serializer_local.h +++ b/crypto/serializer/serializer_local.h @@ -20,12 +20,12 @@ struct ossl_serializer_st { CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *lock; - OSSL_OP_serializer_newctx_fn *newctx; - OSSL_OP_serializer_freectx_fn *freectx; - OSSL_OP_serializer_set_ctx_params_fn *set_ctx_params; - OSSL_OP_serializer_settable_ctx_params_fn *settable_ctx_params; - OSSL_OP_serializer_serialize_data_fn *serialize_data; - OSSL_OP_serializer_serialize_object_fn *serialize_object; + OSSL_FUNC_serializer_newctx_fn *newctx; + OSSL_FUNC_serializer_freectx_fn *freectx; + OSSL_FUNC_serializer_set_ctx_params_fn *set_ctx_params; + OSSL_FUNC_serializer_settable_ctx_params_fn *settable_ctx_params; + OSSL_FUNC_serializer_serialize_data_fn *serialize_data; + OSSL_FUNC_serializer_serialize_object_fn *serialize_object; }; struct ossl_serializer_ctx_st { diff --git a/crypto/serializer/serializer_meth.c b/crypto/serializer/serializer_meth.c index b95bd14a51..d7c98891e4 100644 --- a/crypto/serializer/serializer_meth.c +++ b/crypto/serializer/serializer_meth.c @@ -173,32 +173,32 @@ static void *serializer_from_dispatch(int id, const OSSL_ALGORITHM *algodef, case OSSL_FUNC_SERIALIZER_NEWCTX: if (ser->newctx == NULL) ser->newctx = - OSSL_get_OP_serializer_newctx(fns); + OSSL_FUNC_serializer_newctx(fns); break; case OSSL_FUNC_SERIALIZER_FREECTX: if (ser->freectx == NULL) ser->freectx = - OSSL_get_OP_serializer_freectx(fns); + OSSL_FUNC_serializer_freectx(fns); break; case OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS: if (ser->set_ctx_params == NULL) ser->set_ctx_params = - OSSL_get_OP_serializer_set_ctx_params(fns); + OSSL_FUNC_serializer_set_ctx_params(fns); break; case OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS: if (ser->settable_ctx_params == NULL) ser->settable_ctx_params = - OSSL_get_OP_serializer_settable_ctx_params(fns); + OSSL_FUNC_serializer_settable_ctx_params(fns); break; case OSSL_FUNC_SERIALIZER_SERIALIZE_DATA: if (ser->serialize_data == NULL) ser->serialize_data = - OSSL_get_OP_serializer_serialize_data(fns); + OSSL_FUNC_serializer_serialize_data(fns); break; case OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT: if (ser->serialize_object == NULL) ser->serialize_object = - OSSL_get_OP_serializer_serialize_object(fns); + OSSL_FUNC_serializer_serialize_object(fns); break; } } diff --git a/doc/internal/man3/evp_generic_fetch.pod b/doc/internal/man3/evp_generic_fetch.pod index 4d2f6bdd69..34f157e353 100644 --- a/doc/internal/man3/evp_generic_fetch.pod +++ b/doc/internal/man3/evp_generic_fetch.pod @@ -80,20 +80,21 @@ B. To begin with, let's assume something like this in F: - #define OSSL_OP_FOO 100 - - #define OSSL_OP_FOO_NEWCTX_FUNC 2001 - #define OSSL_OP_FOO_INIT 2002 - #define OSSL_OP_FOO_OPERATE 2003 - #define OSSL_OP_FOO_CLEANCTX_FUNC 2004 - #define OSSL_OP_FOO_FREECTX_FUNC 2005 - OSSL_CORE_MAKE_FUNC(void *,OP_foo_newctx,(void)) - OSSL_CORE_MAKE_FUNC(int,OP_foo_init,(void *vctx)) - OSSL_CORE_MAKE_FUNC(int,OP_foo_operate,(void *vctx, - unsigned char *out, size_t *out_l, - unsigned char *in, size_t in_l)) - OSSL_CORE_MAKE_FUNC(void,OP_foo_cleanctx,(void *vctx)) - OSSL_CORE_MAKE_FUNC(void,OP_foo_freectx,(void *vctx)) + #define OSSL_OP_FOO 100 + + #define OSSL_FUNC_FOO_NEWCTX_FUNC 2001 + #define OSSL_FUNC_FOO_INIT 2002 + #define OSSL_FUNC_FOO_OPERATE 2003 + #define OSSL_FUNC_FOO_CLEANCTX_FUNC 2004 + #define OSSL_FUNC_FOO_FREECTX_FUNC 2005 + + OSSL_CORE_MAKE_FUNC(void *, foo_newctx, (void)) + OSSL_CORE_MAKE_FUNC(int, foo_init, (void *vctx)) + OSSL_CORE_MAKE_FUNC(int, foo_operate, (void *vctx, + unsigned char *out, size_t *out_l, + unsigned char *in, size_t in_l)) + OSSL_CORE_MAKE_FUNC(void, foo_cleanctx, (void *vctx)) + OSSL_CORE_MAKE_FUNC(void, foo_freectx, (void *vctx)) And here's the implementation of the FOO method fetcher: @@ -102,11 +103,11 @@ And here's the implementation of the FOO method fetcher: OSSL_PROVIDER *prov; int name_id; CRYPTO_REF_COUNT refcnt; - OSSL_OP_foo_newctx_fn *newctx; - OSSL_OP_foo_init_fn *init; - OSSL_OP_foo_operate_fn *operate; - OSSL_OP_foo_cleanctx_fn *cleanctx; - OSSL_OP_foo_freectx_fn *freectx; + OSSL_FUNC_foo_newctx_fn *newctx; + OSSL_FUNC_foo_init_fn *init; + OSSL_FUNC_foo_operate_fn *operate; + OSSL_FUNC_foo_cleanctx_fn *cleanctx; + OSSL_FUNC_foo_freectx_fn *freectx; }; /* @@ -127,20 +128,20 @@ And here's the implementation of the FOO method fetcher: for (; fns->function_id != 0; fns++) { switch (fns->function_id) { - case OSSL_OP_FOO_NEWCTX_FUNC: - foo->newctx = OSSL_get_OP_foo_newctx(fns); + case OSSL_FUNC_FOO_NEWCTX: + foo->newctx = OSSL_FUNC_foo_newctx(fns); break; - case OSSL_OP_FOO_INIT: - foo->init = OSSL_get_OP_foo_init(fns); + case OSSL_FUNC_FOO_INIT: + foo->init = OSSL_FUNC_foo_init(fns); break; - case OSSL_OP_FOO_OPERATE: - foo->operate = OSSL_get_OP_foo_operate(fns); + case OSSL_FUNC_FOO_OPERATE: + foo->operate = OSSL_FUNC_foo_operate(fns); break; - case OSSL_OP_FOO_CLEANCTX_FUNC: - foo->cleanctx = OSSL_get_OP_foo_cleanctx(fns); + case OSSL_FUNC_FOO_CLEANCTX: + foo->cleanctx = OSSL_FUNC_foo_cleanctx(fns); break; - case OSSL_OP_FOO_FREECTX_FUNC: - foo->freectx = OSSL_get_OP_foo_freectx(fns); + case OSSL_FUNC_FOO_FREECTX: + foo->freectx = OSSL_FUNC_foo_freectx(fns); break; } } diff --git a/doc/man3/EVP_RAND.pod b/doc/man3/EVP_RAND.pod index c32217543e..c79f5e6548 100644 --- a/doc/man3/EVP_RAND.pod +++ b/doc/man3/EVP_RAND.pod @@ -275,7 +275,7 @@ associated RAND ctx. =item "max_request" (B) Specifies the maximum number of bytes that can be generated in a single -call to OP_rand_generate. +call to OSSL_FUNC_rand_generate. =item "min_entropylen" (B) diff --git a/doc/man7/provider-asym_cipher.pod b/doc/man7/provider-asym_cipher.pod index 5a911f9a0e..fa56391a04 100644 --- a/doc/man7/provider-asym_cipher.pod +++ b/doc/man7/provider-asym_cipher.pod @@ -18,27 +18,27 @@ provider-asym_cipher - The asym_cipher library E-E provider functions */ /* Context management */ - void *OP_asym_cipher_newctx(void *provctx); - void OP_asym_cipher_freectx(void *ctx); - void *OP_asym_cipher_dupctx(void *ctx); + void *OSSL_FUNC_asym_cipher_newctx(void *provctx); + void OSSL_FUNC_asym_cipher_freectx(void *ctx); + void *OSSL_FUNC_asym_cipher_dupctx(void *ctx); /* Encryption */ - int OP_asym_cipher_encrypt_init(void *ctx, void *provkey); - int OP_asym_cipher_encrypt(void *ctx, unsigned char *out, size_t *outlen, - size_t outsize, const unsigned char *in, - size_t inlen); + int OSSL_FUNC_asym_cipher_encrypt_init(void *ctx, void *provkey); + int OSSL_FUNC_asym_cipher_encrypt(void *ctx, unsigned char *out, size_t *outlen, + size_t outsize, const unsigned char *in, + size_t inlen); /* Decryption */ - int OP_asym_cipher_decrypt_init(void *ctx, void *provkey); - int OP_asym_cipher_decrypt(void *ctx, unsigned char *out, size_t *outlen, - size_t outsize, const unsigned char *in, - size_t inlen); + int OSSL_FUNC_asym_cipher_decrypt_init(void *ctx, void *provkey); + int OSSL_FUNC_asym_cipher_decrypt(void *ctx, unsigned char *out, size_t *outlen, + size_t outsize, const unsigned char *in, + size_t inlen); /* Asymmetric Cipher parameters */ - int OP_asym_cipher_get_ctx_params(void *ctx, OSSL_PARAM params[]); - const OSSL_PARAM *OP_asym_cipher_gettable_ctx_params(void); - int OP_asym_cipher_set_ctx_params(void *ctx, const OSSL_PARAM params[]); - const OSSL_PARAM *OP_asym_cipher_settable_ctx_params(void); + int OSSL_FUNC_asym_cipher_get_ctx_params(void *ctx, OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_asym_cipher_gettable_ctx_params(void); + int OSSL_FUNC_asym_cipher_set_ctx_params(void *ctx, const OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_asym_cipher_settable_ctx_params(void); =head1 DESCRIPTION @@ -60,42 +60,42 @@ provider_query_operation() function All these "functions" have a corresponding function type definition named B, and a helper function to retrieve the function pointer from an B element named -B. -For example, the "function" OP_asym_cipher_newctx() has these: +B. +For example, the "function" OSSL_FUNC_asym_cipher_newctx() has these: - typedef void *(OSSL_OP_asym_cipher_newctx_fn)(void *provctx); - static ossl_inline OSSL_OP_asym_cipher_newctx_fn - OSSL_get_OP_asym_cipher_newctx(const OSSL_DISPATCH *opf); + typedef void *(OSSL_FUNC_asym_cipher_newctx_fn)(void *provctx); + static ossl_inline OSSL_FUNC_asym_cipher_newctx_fn + OSSL_FUNC_asym_cipher_newctx(const OSSL_DISPATCH *opf); B arrays are indexed by numbers that are provided as macros in L, as follows: - OP_asym_cipher_newctx OSSL_FUNC_ASYM_CIPHER_NEWCTX - OP_asym_cipher_freectx OSSL_FUNC_ASYM_CIPHER_FREECTX - OP_asym_cipher_dupctx OSSL_FUNC_ASYM_CIPHER_DUPCTX + OSSL_FUNC_asym_cipher_newctx OSSL_FUNC_ASYM_CIPHER_NEWCTX + OSSL_FUNC_asym_cipher_freectx OSSL_FUNC_ASYM_CIPHER_FREECTX + OSSL_FUNC_asym_cipher_dupctx OSSL_FUNC_ASYM_CIPHER_DUPCTX - OP_asym_cipher_encrypt_init OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT - OP_asym_cipher_encrypt OSSL_FUNC_ASYM_CIPHER_ENCRYPT + OSSL_FUNC_asym_cipher_encrypt_init OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT + OSSL_FUNC_asym_cipher_encrypt OSSL_FUNC_ASYM_CIPHER_ENCRYPT - OP_asym_cipher_decrypt_init OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT - OP_asym_cipher_decrypt OSSL_FUNC_ASYM_CIPHER_DECRYPT + OSSL_FUNC_asym_cipher_decrypt_init OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT + OSSL_FUNC_asym_cipher_decrypt OSSL_FUNC_ASYM_CIPHER_DECRYPT - OP_asym_cipher_get_ctx_params OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS - OP_asym_cipher_gettable_ctx_params OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS - OP_asym_cipher_set_ctx_params OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS - OP_asym_cipher_settable_ctx_params OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS + OSSL_FUNC_asym_cipher_get_ctx_params OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS + OSSL_FUNC_asym_cipher_gettable_ctx_params OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS + OSSL_FUNC_asym_cipher_set_ctx_params OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS + OSSL_FUNC_asym_cipher_settable_ctx_params OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS An asymmetric cipher algorithm implementation may not implement all of these functions. In order to be a consistent set of functions a provider must implement -OP_asym_cipher_newctx and OP_asym_cipher_freectx. -It must also implement both of OP_asym_cipher_encrypt_init and -OP_asym_cipher_encrypt, or both of OP_asym_cipher_decrypt_init and -OP_asym_cipher_decrypt. -OP_asym_cipher_get_ctx_params is optional but if it is present then so must -OP_asym_cipher_gettable_ctx_params. -Similarly, OP_asym_cipher_set_ctx_params is optional but if it is present then -so must OP_asym_cipher_settable_ctx_params. +OSSL_FUNC_asym_cipher_newctx and OSSL_FUNC_asym_cipher_freectx. +It must also implement both of OSSL_FUNC_asym_cipher_encrypt_init and +OSSL_FUNC_asym_cipher_encrypt, or both of OSSL_FUNC_asym_cipher_decrypt_init and +OSSL_FUNC_asym_cipher_decrypt. +OSSL_FUNC_asym_cipher_get_ctx_params is optional but if it is present then so must +OSSL_FUNC_asym_cipher_gettable_ctx_params. +Similarly, OSSL_FUNC_asym_cipher_set_ctx_params is optional but if it is present then +so must OSSL_FUNC_asym_cipher_settable_ctx_params. An asymmetric cipher algorithm must also implement some mechanism for generating, loading or importing keys via the key management (OSSL_OP_KEYMGMT) operation. @@ -103,30 +103,30 @@ See L for further details. =head2 Context Management Functions -OP_asym_cipher_newctx() should create and return a pointer to a provider side +OSSL_FUNC_asym_cipher_newctx() should create and return a pointer to a provider side structure for holding context information during an asymmetric cipher operation. A pointer to this context will be passed back in a number of the other asymmetric cipher operation function calls. The parameter I is the provider context generated during provider initialisation (see L). -OP_asym_cipher_freectx() is passed a pointer to the provider side asymmetric +OSSL_FUNC_asym_cipher_freectx() is passed a pointer to the provider side asymmetric cipher context in the I parameter. This function should free any resources associated with that context. -OP_asym_cipher_dupctx() should duplicate the provider side asymmetric cipher +OSSL_FUNC_asym_cipher_dupctx() should duplicate the provider side asymmetric cipher context in the I parameter and return the duplicate copy. =head2 Encryption Functions -OP_asym_cipher_encrypt_init() initialises a context for an asymmetric encryption +OSSL_FUNC_asym_cipher_encrypt_init() initialises a context for an asymmetric encryption given a provider side asymmetric cipher context in the I parameter, and a pointer to a provider key object in the I parameter. The key object should have been previously generated, loaded or imported into the provider using the key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>. -OP_asym_cipher_encrypt() performs the actual encryption itself. +OSSL_FUNC_asym_cipher_encrypt() performs the actual encryption itself. A previously initialised asymmetric cipher context is passed in the I parameter. The data to be encrypted is pointed to by the I parameter which is I @@ -140,14 +140,14 @@ written to I<*outlen>. =head2 Decryption Functions -OP_asym_cipher_decrypt_init() initialises a context for an asymmetric decryption +OSSL_FUNC_asym_cipher_decrypt_init() initialises a context for an asymmetric decryption given a provider side asymmetric cipher context in the I parameter, and a pointer to a provider key object in the I parameter. The key object should have been previously generated, loaded or imported into the provider using the key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>. -OP_asym_cipher_decrypt() performs the actual decryption itself. +OSSL_FUNC_asym_cipher_decrypt() performs the actual decryption itself. A previously initialised asymmetric cipher context is passed in the I parameter. The data to be decrypted is pointed to by the I parameter which is I @@ -162,13 +162,13 @@ written to I<*outlen>. =head2 Asymmetric Cipher Parameters See L for further details on the parameters structure used by -the OP_asym_cipher_get_ctx_params() and OP_asym_cipher_set_ctx_params() +the OSSL_FUNC_asym_cipher_get_ctx_params() and OSSL_FUNC_asym_cipher_set_ctx_params() functions. -OP_asym_cipher_get_ctx_params() gets asymmetric cipher parameters associated +OSSL_FUNC_asym_cipher_get_ctx_params() gets asymmetric cipher parameters associated with the given provider side asymmetric cipher context I and stores them in I. -OP_asym_cipher_set_ctx_params() sets the asymmetric cipher parameters associated +OSSL_FUNC_asym_cipher_set_ctx_params() sets the asymmetric cipher parameters associated with the given provider side asymmetric cipher context I to I. Any parameter settings are additional to any that were previously set. @@ -226,15 +226,15 @@ B on the page L. =back -OP_asym_cipher_gettable_ctx_params() and OP_asym_cipher_settable_ctx_params() +OSSL_FUNC_asym_cipher_gettable_ctx_params() and OSSL_FUNC_asym_cipher_settable_ctx_params() get a constant B array that describes the gettable and settable -parameters, i.e. parameters that can be used with OP_asym_cipherget_ctx_params() -and OP_asym_cipher_set_ctx_params() respectively. +parameters, i.e. parameters that can be used with OSSL_FUNC_asym_cipherget_ctx_params() +and OSSL_FUNC_asym_cipher_set_ctx_params() respectively. See L for the use of B as parameter descriptor. =head1 RETURN VALUES -OP_asym_cipher_newctx() and OP_asym_cipher_dupctx() should return the newly +OSSL_FUNC_asym_cipher_newctx() and OSSL_FUNC_asym_cipher_dupctx() should return the newly created provider side asymmetric cipher context, or NULL on failure. All other functions should return 1 for success or 0 on error. diff --git a/doc/man7/provider-base.pod b/doc/man7/provider-base.pod index d6a510c2dc..35e9f6f614 100644 --- a/doc/man7/provider-base.pod +++ b/doc/man7/provider-base.pod @@ -87,13 +87,13 @@ for a description of the initialization function. All these "functions" have a corresponding function type definition named B, and a helper function to retrieve the function pointer from a B element named -B. +B. For example, the "function" core_gettable_params() has these: typedef OSSL_PARAM * - (OSSL_core_gettable_params_fn)(const OSSL_CORE_HANDLE *handle); + (OSSL_FUNC_core_gettable_params_fn)(const OSSL_CORE_HANDLE *handle); static ossl_inline OSSL_NAME_core_gettable_params_fn - OSSL_get_core_gettable_params(const OSSL_DISPATCH *opf); + OSSL_FUNC_core_gettable_params(const OSSL_DISPATCH *opf); B arrays are indexed by numbers that are provided as macros in L, as follows: @@ -433,19 +433,19 @@ operation C. * To ensure we get the function signature right, forward declare * them using function types provided by openssl/core_dispatch.h */ - OSSL_OP_bar_newctx_fn foo_newctx; - OSSL_OP_bar_freectx_fn foo_freectx; - OSSL_OP_bar_init_fn foo_init; - OSSL_OP_bar_update_fn foo_update; - OSSL_OP_bar_final_fn foo_final; + OSSL_FUNC_bar_newctx_fn foo_newctx; + OSSL_FUNC_bar_freectx_fn foo_freectx; + OSSL_FUNC_bar_init_fn foo_init; + OSSL_FUNC_bar_update_fn foo_update; + OSSL_FUNC_bar_final_fn foo_final; - OSSL_provider_query_operation_fn p_query; - OSSL_provider_get_reason_strings_fn p_reasons; - OSSL_provider_teardown_fn p_teardown; + OSSL_FUNC_provider_query_operation_fn p_query; + OSSL_FUNC_provider_get_reason_strings_fn p_reasons; + OSSL_FUNC_provider_teardown_fn p_teardown; OSSL_provider_init_fn OSSL_provider_init; - OSSL_core_put_error *c_put_error = NULL; + OSSL_FUNC_core_put_error *c_put_error = NULL; /* Provider context */ struct prov_ctx_st { @@ -551,7 +551,7 @@ operation C. for (; in->function_id != 0; in++) switch (in->function_id) { case OSSL_FUNC_CORE_PUT_ERROR: - c_put_error = OSSL_get_core_put_error(in); + c_put_error = OSSL_FUNC_core_put_error(in); break; } @@ -574,30 +574,30 @@ This relies on a few things existing in F: #define OSSL_OP_BAR 4711 #define OSSL_FUNC_BAR_NEWCTX 1 - typedef void *(OSSL_OP_bar_newctx_fn)(void *provctx); - static ossl_inline OSSL_get_bar_newctx(const OSSL_DISPATCH *opf) - { return (OSSL_OP_bar_newctx_fn *)opf->function; } + typedef void *(OSSL_FUNC_bar_newctx_fn)(void *provctx); + static ossl_inline OSSL_FUNC_bar_newctx(const OSSL_DISPATCH *opf) + { return (OSSL_FUNC_bar_newctx_fn *)opf->function; } #define OSSL_FUNC_BAR_FREECTX 2 - typedef void (OSSL_OP_bar_freectx_fn)(void *ctx); - static ossl_inline OSSL_get_bar_newctx(const OSSL_DISPATCH *opf) - { return (OSSL_OP_bar_freectx_fn *)opf->function; } + typedef void (OSSL_FUNC_bar_freectx_fn)(void *ctx); + static ossl_inline OSSL_FUNC_bar_newctx(const OSSL_DISPATCH *opf) + { return (OSSL_FUNC_bar_freectx_fn *)opf->function; } #define OSSL_FUNC_BAR_INIT 3 - typedef void *(OSSL_OP_bar_init_fn)(void *ctx); - static ossl_inline OSSL_get_bar_init(const OSSL_DISPATCH *opf) - { return (OSSL_OP_bar_init_fn *)opf->function; } + typedef void *(OSSL_FUNC_bar_init_fn)(void *ctx); + static ossl_inline OSSL_FUNC_bar_init(const OSSL_DISPATCH *opf) + { return (OSSL_FUNC_bar_init_fn *)opf->function; } #define OSSL_FUNC_BAR_UPDATE 4 - typedef void *(OSSL_OP_bar_update_fn)(void *ctx, + typedef void *(OSSL_FUNC_bar_update_fn)(void *ctx, unsigned char *in, size_t inl); - static ossl_inline OSSL_get_bar_update(const OSSL_DISPATCH *opf) - { return (OSSL_OP_bar_update_fn *)opf->function; } + static ossl_inline OSSL_FUNC_bar_update(const OSSL_DISPATCH *opf) + { return (OSSL_FUNC_bar_update_fn *)opf->function; } #define OSSL_FUNC_BAR_FINAL 5 - typedef void *(OSSL_OP_bar_final_fn)(void *ctx); - static ossl_inline OSSL_get_bar_final(const OSSL_DISPATCH *opf) - { return (OSSL_OP_bar_final_fn *)opf->function; } + typedef void *(OSSL_FUNC_bar_final_fn)(void *ctx); + static ossl_inline OSSL_FUNC_bar_final(const OSSL_DISPATCH *opf) + { return (OSSL_FUNC_bar_final_fn *)opf->function; } =head1 SEE ALSO diff --git a/doc/man7/provider-cipher.pod b/doc/man7/provider-cipher.pod index c3b1b77fe4..bb8df17514 100644 --- a/doc/man7/provider-cipher.pod +++ b/doc/man7/provider-cipher.pod @@ -18,37 +18,37 @@ provider-cipher - The cipher library E-E provider functions */ /* Context management */ - void *OP_cipher_newctx(void *provctx); - void OP_cipher_freectx(void *cctx); - void *OP_cipher_dupctx(void *cctx); + void *OSSL_FUNC_cipher_newctx(void *provctx); + void OSSL_FUNC_cipher_freectx(void *cctx); + void *OSSL_FUNC_cipher_dupctx(void *cctx); /* Encryption/decryption */ - int OP_cipher_encrypt_init(void *cctx, const unsigned char *key, - size_t keylen, const unsigned char *iv, - size_t ivlen); - int OP_cipher_decrypt_init(void *cctx, const unsigned char *key, - size_t keylen, const unsigned char *iv, - size_t ivlen); - int OP_cipher_update(void *cctx, unsigned char *out, size_t *outl, - size_t outsize, const unsigned char *in, size_t inl); - int OP_cipher_final(void *cctx, unsigned char *out, size_t *outl, - size_t outsize); - int OP_cipher_cipher(void *cctx, unsigned char *out, size_t *outl, - size_t outsize, const unsigned char *in, size_t inl); + int OSSL_FUNC_cipher_encrypt_init(void *cctx, const unsigned char *key, + size_t keylen, const unsigned char *iv, + size_t ivlen); + int OSSL_FUNC_cipher_decrypt_init(void *cctx, const unsigned char *key, + size_t keylen, const unsigned char *iv, + size_t ivlen); + int OSSL_FUNC_cipher_update(void *cctx, unsigned char *out, size_t *outl, + size_t outsize, const unsigned char *in, size_t inl); + int OSSL_FUNC_cipher_final(void *cctx, unsigned char *out, size_t *outl, + size_t outsize); + int OSSL_FUNC_cipher_cipher(void *cctx, unsigned char *out, size_t *outl, + size_t outsize, const unsigned char *in, size_t inl); /* Cipher parameter descriptors */ - const OSSL_PARAM *OP_cipher_gettable_params(void); + const OSSL_PARAM *OSSL_FUNC_cipher_gettable_params(void); /* Cipher operation parameter descriptors */ - const OSSL_PARAM *OP_cipher_gettable_ctx_params(void); - const OSSL_PARAM *OP_cipher_settable_ctx_params(void); + const OSSL_PARAM *OSSL_FUNC_cipher_gettable_ctx_params(void); + const OSSL_PARAM *OSSL_FUNC_cipher_settable_ctx_params(void); /* Cipher parameters */ - int OP_cipher_get_params(OSSL_PARAM params[]); + int OSSL_FUNC_cipher_get_params(OSSL_PARAM params[]); /* Cipher operation parameters */ - int OP_cipher_get_ctx_params(void *cctx, OSSL_PARAM params[]); - int OP_cipher_set_ctx_params(void *cctx, const OSSL_PARAM params[]); + int OSSL_FUNC_cipher_get_ctx_params(void *cctx, OSSL_PARAM params[]); + int OSSL_FUNC_cipher_set_ctx_params(void *cctx, const OSSL_PARAM params[]); =head1 DESCRIPTION @@ -69,77 +69,77 @@ provider_query_operation() function All these "functions" have a corresponding function type definition named B, and a helper function to retrieve the function pointer from an B element named -B. -For example, the "function" OP_cipher_newctx() has these: +B. +For example, the "function" OSSL_FUNC_cipher_newctx() has these: - typedef void *(OSSL_OP_cipher_newctx_fn)(void *provctx); - static ossl_inline OSSL_OP_cipher_newctx_fn - OSSL_get_OP_cipher_newctx(const OSSL_DISPATCH *opf); + typedef void *(OSSL_OSSL_FUNC_cipher_newctx_fn)(void *provctx); + static ossl_inline OSSL_OSSL_FUNC_cipher_newctx_fn + OSSL_FUNC_cipher_newctx(const OSSL_DISPATCH *opf); B arrays are indexed by numbers that are provided as macros in L, as follows: - OP_cipher_newctx OSSL_FUNC_CIPHER_NEWCTX - OP_cipher_freectx OSSL_FUNC_CIPHER_FREECTX - OP_cipher_dupctx OSSL_FUNC_CIPHER_DUPCTX + OSSL_FUNC_cipher_newctx OSSL_FUNC_CIPHER_NEWCTX + OSSL_FUNC_cipher_freectx OSSL_FUNC_CIPHER_FREECTX + OSSL_FUNC_cipher_dupctx OSSL_FUNC_CIPHER_DUPCTX - OP_cipher_encrypt_init OSSL_FUNC_CIPHER_ENCRYPT_INIT - OP_cipher_decrypt_init OSSL_FUNC_CIPHER_DECRYPT_INIT - OP_cipher_update OSSL_FUNC_CIPHER_UPDATE - OP_cipher_final OSSL_FUNC_CIPHER_FINAL - OP_cipher_cipher OSSL_FUNC_CIPHER_CIPHER + OSSL_FUNC_cipher_encrypt_init OSSL_FUNC_CIPHER_ENCRYPT_INIT + OSSL_FUNC_cipher_decrypt_init OSSL_FUNC_CIPHER_DECRYPT_INIT + OSSL_FUNC_cipher_update OSSL_FUNC_CIPHER_UPDATE + OSSL_FUNC_cipher_final OSSL_FUNC_CIPHER_FINAL + OSSL_FUNC_cipher_cipher OSSL_FUNC_CIPHER_CIPHER - OP_cipher_get_params OSSL_FUNC_CIPHER_GET_PARAMS - OP_cipher_get_ctx_params OSSL_FUNC_CIPHER_GET_CTX_PARAMS - OP_cipher_set_ctx_params OSSL_FUNC_CIPHER_SET_CTX_PARAMS + OSSL_FUNC_cipher_get_params OSSL_FUNC_CIPHER_GET_PARAMS + OSSL_FUNC_cipher_get_ctx_params OSSL_FUNC_CIPHER_GET_CTX_PARAMS + OSSL_FUNC_cipher_set_ctx_params OSSL_FUNC_CIPHER_SET_CTX_PARAMS - OP_cipher_gettable_params OSSL_FUNC_CIPHER_GETTABLE_PARAMS - OP_cipher_gettable_ctx_params OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS - OP_cipher_settable_ctx_params OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS + OSSL_FUNC_cipher_gettable_params OSSL_FUNC_CIPHER_GETTABLE_PARAMS + OSSL_FUNC_cipher_gettable_ctx_params OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS + OSSL_FUNC_cipher_settable_ctx_params OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS A cipher algorithm implementation may not implement all of these functions. In order to be a consistent set of functions there must at least be a complete set of "encrypt" functions, or a complete set of "decrypt" functions, or a single "cipher" function. -In all cases both the OP_cipher_newctx and OP_cipher_freectx functions must be +In all cases both the OSSL_FUNC_cipher_newctx and OSSL_FUNC_cipher_freectx functions must be present. All other functions are optional. =head2 Context Management Functions -OP_cipher_newctx() should create and return a pointer to a provider side +OSSL_FUNC_cipher_newctx() should create and return a pointer to a provider side structure for holding context information during a cipher operation. A pointer to this context will be passed back in a number of the other cipher operation function calls. The parameter I is the provider context generated during provider initialisation (see L). -OP_cipher_freectx() is passed a pointer to the provider side cipher context in +OSSL_FUNC_cipher_freectx() is passed a pointer to the provider side cipher context in the I parameter. This function should free any resources associated with that context. -OP_cipher_dupctx() should duplicate the provider side cipher context in the +OSSL_FUNC_cipher_dupctx() should duplicate the provider side cipher context in the I parameter and return the duplicate copy. =head2 Encryption/Decryption Functions -OP_cipher_encrypt_init() initialises a cipher operation for encryption given a +OSSL_FUNC_cipher_encrypt_init() initialises a cipher operation for encryption given a newly created provider side cipher context in the I parameter. The key to be used is given in I which is I bytes long. The IV to be used is given in I which is I bytes long. -OP_cipher_decrypt_init() is the same as OP_cipher_encrypt_init() except that it +OSSL_FUNC_cipher_decrypt_init() is the same as OSSL_FUNC_cipher_encrypt_init() except that it initialises the context for a decryption operation. -OP_cipher_update() is called to supply data to be encrypted/decrypted as part of +OSSL_FUNC_cipher_update() is called to supply data to be encrypted/decrypted as part of a previously initialised cipher operation. The I parameter contains a pointer to a previously initialised provider side context. -OP_cipher_update() should encrypt/decrypt I bytes of data at the location +OSSL_FUNC_cipher_update() should encrypt/decrypt I bytes of data at the location pointed to by I. The encrypted data should be stored in I and the amount of data written to I<*outl> which should not exceed I bytes. -OP_cipher_update() may be called multiple times for a single cipher operation. +OSSL_FUNC_cipher_update() may be called multiple times for a single cipher operation. It is the responsibility of the cipher implementation to handle input lengths that are not multiples of the block length. In such cases a cipher implementation will typically cache partial blocks of @@ -148,8 +148,8 @@ I may be the same location as I but it should not partially overlap. The same expectations apply to I as documented for L and L. -OP_cipher_final() completes an encryption or decryption started through previous -OP_cipher_encrypt_init() or OP_cipher_decrypt_init(), and OP_cipher_update() +OSSL_FUNC_cipher_final() completes an encryption or decryption started through previous +OSSL_FUNC_cipher_encrypt_init() or OSSL_FUNC_cipher_decrypt_init(), and OSSL_FUNC_cipher_update() calls. The I parameter contains a pointer to the provider side context. Any final encryption/decryption output should be written to I and the @@ -157,9 +157,9 @@ amount of data written to I<*outl> which should not exceed I bytes. The same expectations apply to I as documented for L and L. -OP_cipher_cipher() performs encryption/decryption using the provider side cipher +OSSL_FUNC_cipher_cipher() performs encryption/decryption using the provider side cipher context in the I parameter that should have been previously initialised via -a call to OP_cipher_encrypt_init() or OP_cipher_decrypt_init(). +a call to OSSL_FUNC_cipher_encrypt_init() or OSSL_FUNC_cipher_decrypt_init(). This should call the raw underlying cipher function without any padding. This will be invoked in the provider as a result of the application calling L. @@ -176,20 +176,20 @@ I bytes. See L for further details on the parameters structure used by these functions. -OP_cipher_get_params() gets details of the algorithm implementation +OSSL_FUNC_cipher_get_params() gets details of the algorithm implementation and stores them in I. -OP_cipher_set_ctx_params() sets cipher operation parameters for the +OSSL_FUNC_cipher_set_ctx_params() sets cipher operation parameters for the provider side cipher context I to I. Any parameter settings are additional to any that were previously set. -OP_cipher_get_ctx_params() gets cipher operation details details from +OSSL_FUNC_cipher_get_ctx_params() gets cipher operation details details from the given provider side cipher context I and stores them in I. -OP_cipher_gettable_params(), OP_cipher_gettable_ctx_params(), and -OP_cipher_settable_ctx_params() all return constant B arrays -as descriptors of the parameters that OP_cipher_get_params(), -OP_cipher_get_ctx_params(), and OP_cipher_set_ctx_params() can handle, +OSSL_FUNC_cipher_gettable_params(), OSSL_FUNC_cipher_gettable_ctx_params(), and +OSSL_FUNC_cipher_settable_ctx_params() all return constant B arrays +as descriptors of the parameters that OSSL_FUNC_cipher_get_params(), +OSSL_FUNC_cipher_get_ctx_params(), and OSSL_FUNC_cipher_set_ctx_params() can handle, respectively. Parameters currently recognised by built-in ciphers are as follows. Not all @@ -286,7 +286,7 @@ output buffers are always the same memory location. AEAD IVs in TLSv1.2 consist of an implicit "fixed" part and an explicit part that varies with every record. Setting a TLS fixed IV changes a cipher to encrypt/decrypt TLS records. -TLS records are encrypted/decrypted using a single OP_cipher_cipher call per +TLS records are encrypted/decrypted using a single OSSL_FUNC_cipher_cipher call per record. For a record decryption the first bytes of the input buffer will be the explicit part of the IV and the final bytes of the input buffer will be the AEAD tag. @@ -307,7 +307,7 @@ write that to the output buffer, and finally add the tag onto the end of the output buffer. Whether encrypting or decrypting the value written to I<*outl> in the -OP_cipher_cipher call should be the length of the payload excluding the explicit +OSSL_FUNC_cipher_cipher call should be the length of the payload excluding the explicit IV length and the tag length. =item "ivlen" (B) @@ -414,16 +414,16 @@ Gets the result of running the "tls1multi_aad" operation. =head1 RETURN VALUES -OP_cipher_newctx() and OP_cipher_dupctx() should return the newly created +OSSL_FUNC_cipher_newctx() and OSSL_FUNC_cipher_dupctx() should return the newly created provider side cipher context, or NULL on failure. -OP_cipher_encrypt_init(), OP_cipher_decrypt_init(), OP_cipher_update(), -OP_cipher_final(), OP_cipher_cipher(), OP_cipher_get_params(), -OP_cipher_get_ctx_params() and OP_cipher_set_ctx_params() should return 1 for +OSSL_FUNC_cipher_encrypt_init(), OSSL_FUNC_cipher_decrypt_init(), OSSL_FUNC_cipher_update(), +OSSL_FUNC_cipher_final(), OSSL_FUNC_cipher_cipher(), OSSL_FUNC_cipher_get_params(), +OSSL_FUNC_cipher_get_ctx_params() and OSSL_FUNC_cipher_set_ctx_params() should return 1 for success or 0 on error. -OP_cipher_gettable_params(), OP_cipher_gettable_ctx_params() and -OP_cipher_settable_ctx_params() should return a constant B +OSSL_FUNC_cipher_gettable_params(), OSSL_FUNC_cipher_gettable_ctx_params() and +OSSL_FUNC_cipher_settable_ctx_params() should return a constant B array, or NULL if none is offered. =head1 SEE ALSO diff --git a/doc/man7/provider-digest.pod b/doc/man7/provider-digest.pod index 4164e34bbe..c350148471 100644 --- a/doc/man7/provider-digest.pod +++ b/doc/man7/provider-digest.pod @@ -17,31 +17,31 @@ provider-digest - The digest library E-E provider functions */ /* Context management */ - void *OP_digest_newctx(void *provctx); - void OP_digest_freectx(void *dctx); - void *OP_digest_dupctx(void *dctx); + void *OSSL_FUNC_digest_newctx(void *provctx); + void OSSL_FUNC_digest_freectx(void *dctx); + void *OSSL_FUNC_digest_dupctx(void *dctx); /* Digest generation */ - int OP_digest_init(void *dctx); - int OP_digest_update(void *dctx, const unsigned char *in, size_t inl); - int OP_digest_final(void *dctx, unsigned char *out, size_t *outl, - size_t outsz); - int OP_digest_digest(void *provctx, const unsigned char *in, size_t inl, - unsigned char *out, size_t *outl, size_t outsz); + int OSSL_FUNC_digest_init(void *dctx); + int OSSL_FUNC_digest_update(void *dctx, const unsigned char *in, size_t inl); + int OSSL_FUNC_digest_final(void *dctx, unsigned char *out, size_t *outl, + size_t outsz); + int OSSL_FUNC_digest_digest(void *provctx, const unsigned char *in, size_t inl, + unsigned char *out, size_t *outl, size_t outsz); /* Digest parameter descriptors */ - const OSSL_PARAM *OP_digest_gettable_params(void); + const OSSL_PARAM *OSSL_FUNC_digest_gettable_params(void); /* Digest operation parameter descriptors */ - const OSSL_PARAM *OP_digest_gettable_ctx_params(void); - const OSSL_PARAM *OP_digest_settable_ctx_params(void); + const OSSL_PARAM *OSSL_FUNC_digest_gettable_ctx_params(void); + const OSSL_PARAM *OSSL_FUNC_digest_settable_ctx_params(void); /* Digest parameters */ - int OP_digest_get_params(OSSL_PARAM params[]); + int OSSL_FUNC_digest_get_params(OSSL_PARAM params[]); /* Digest operation parameters */ - int OP_digest_set_ctx_params(void *dctx, const OSSL_PARAM params[]); - int OP_digest_get_ctx_params(void *dctx, OSSL_PARAM params[]); + int OSSL_FUNC_digest_set_ctx_params(void *dctx, const OSSL_PARAM params[]); + int OSSL_FUNC_digest_get_ctx_params(void *dctx, OSSL_PARAM params[]); =head1 DESCRIPTION @@ -61,75 +61,75 @@ provider_query_operation() function All these "functions" have a corresponding function type definition named B, and a helper function to retrieve the function pointer from an B element named -B. -For example, the "function" OP_digest_newctx() has these: +B. +For example, the "function" OSSL_FUNC_digest_newctx() has these: - typedef void *(OSSL_OP_digest_newctx_fn)(void *provctx); - static ossl_inline OSSL_OP_digest_newctx_fn - OSSL_get_OP_digest_newctx(const OSSL_DISPATCH *opf); + typedef void *(OSSL_OSSL_FUNC_digest_newctx_fn)(void *provctx); + static ossl_inline OSSL_OSSL_FUNC_digest_newctx_fn + OSSL_FUNC_digest_newctx(const OSSL_DISPATCH *opf); B arrays are indexed by numbers that are provided as macros in L, as follows: - OP_digest_newctx OSSL_FUNC_DIGEST_NEWCTX - OP_digest_freectx OSSL_FUNC_DIGEST_FREECTX - OP_digest_dupctx OSSL_FUNC_DIGEST_DUPCTX + OSSL_FUNC_digest_newctx OSSL_FUNC_DIGEST_NEWCTX + OSSL_FUNC_digest_freectx OSSL_FUNC_DIGEST_FREECTX + OSSL_FUNC_digest_dupctx OSSL_FUNC_DIGEST_DUPCTX - OP_digest_init OSSL_FUNC_DIGEST_INIT - OP_digest_update OSSL_FUNC_DIGEST_UPDATE - OP_digest_final OSSL_FUNC_DIGEST_FINAL - OP_digest_digest OSSL_FUNC_DIGEST_DIGEST + OSSL_FUNC_digest_init OSSL_FUNC_DIGEST_INIT + OSSL_FUNC_digest_update OSSL_FUNC_DIGEST_UPDATE + OSSL_FUNC_digest_final OSSL_FUNC_DIGEST_FINAL + OSSL_FUNC_digest_digest OSSL_FUNC_DIGEST_DIGEST - OP_digest_get_params OSSL_FUNC_DIGEST_GET_PARAMS - OP_digest_get_ctx_params OSSL_FUNC_DIGEST_GET_CTX_PARAMS - OP_digest_set_ctx_params OSSL_FUNC_DIGEST_SET_CTX_PARAMS + OSSL_FUNC_digest_get_params OSSL_FUNC_DIGEST_GET_PARAMS + OSSL_FUNC_digest_get_ctx_params OSSL_FUNC_DIGEST_GET_CTX_PARAMS + OSSL_FUNC_digest_set_ctx_params OSSL_FUNC_DIGEST_SET_CTX_PARAMS - OP_digest_gettable_params OSSL_FUNC_DIGEST_GETTABLE_PARAMS - OP_digest_gettable_ctx_params OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS - OP_digest_settable_ctx_params OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS + OSSL_FUNC_digest_gettable_params OSSL_FUNC_DIGEST_GETTABLE_PARAMS + OSSL_FUNC_digest_gettable_ctx_params OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS + OSSL_FUNC_digest_settable_ctx_params OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS A digest algorithm implementation may not implement all of these functions. -In order to be usable all or none of OP_digest_newctx, OP_digest_freectx, -OP_digest_init, OP_digest_update and OP_digest_final should be implemented. +In order to be usable all or none of OSSL_FUNC_digest_newctx, OSSL_FUNC_digest_freectx, +OSSL_FUNC_digest_init, OSSL_FUNC_digest_update and OSSL_FUNC_digest_final should be implemented. All other functions are optional. =head2 Context Management Functions -OP_digest_newctx() should create and return a pointer to a provider side +OSSL_FUNC_digest_newctx() should create and return a pointer to a provider side structure for holding context information during a digest operation. A pointer to this context will be passed back in a number of the other digest operation function calls. The parameter I is the provider context generated during provider initialisation (see L). -OP_digest_freectx() is passed a pointer to the provider side digest context in +OSSL_FUNC_digest_freectx() is passed a pointer to the provider side digest context in the I parameter. This function should free any resources associated with that context. -OP_digest_dupctx() should duplicate the provider side digest context in the +OSSL_FUNC_digest_dupctx() should duplicate the provider side digest context in the I parameter and return the duplicate copy. =head2 Digest Generation Functions -OP_digest_init() initialises a digest operation given a newly created +OSSL_FUNC_digest_init() initialises a digest operation given a newly created provider side digest context in the I parameter. -OP_digest_update() is called to supply data to be digested as part of a +OSSL_FUNC_digest_update() is called to supply data to be digested as part of a previously initialised digest operation. The I parameter contains a pointer to a previously initialised provider side context. -OP_digest_update() should digest I bytes of data at the location pointed to +OSSL_FUNC_digest_update() should digest I bytes of data at the location pointed to by I. -OP_digest_update() may be called multiple times for a single digest operation. +OSSL_FUNC_digest_update() may be called multiple times for a single digest operation. -OP_digest_final() generates a digest started through previous OP_digest_init() -and OP_digest_update() calls. +OSSL_FUNC_digest_final() generates a digest started through previous OSSL_FUNC_digest_init() +and OSSL_FUNC_digest_update() calls. The I parameter contains a pointer to the provider side context. The digest should be written to I<*out> and the length of the digest to I<*outl>. The digest should not exceed I bytes. -OP_digest_digest() is a "oneshot" digest function. +OSSL_FUNC_digest_digest() is a "oneshot" digest function. No provider side digest context is used. Instead the provider context that was created during provider initialisation is passed in the I parameter (see L). @@ -142,20 +142,20 @@ exceed I bytes. See L for further details on the parameters structure used by these functions. -OP_digest_get_params() gets details of the algorithm implementation +OSSL_FUNC_digest_get_params() gets details of the algorithm implementation and stores them in I. -OP_digest_set_ctx_params() sets digest operation parameters for the +OSSL_FUNC_digest_set_ctx_params() sets digest operation parameters for the provider side digest context I to I. Any parameter settings are additional to any that were previously set. -OP_digest_get_ctx_params() gets digest operation details details from +OSSL_FUNC_digest_get_ctx_params() gets digest operation details details from the given provider side digest context I and stores them in I. -OP_digest_gettable_params(), OP_digest_gettable_ctx_params(), and -OP_digest_settable_ctx_params() all return constant B arrays -as descriptors of the parameters that OP_digest_get_params(), -OP_digest_get_ctx_params(), and OP_digest_set_ctx_params() can handle, +OSSL_FUNC_digest_gettable_params(), OSSL_FUNC_digest_gettable_ctx_params(), and +OSSL_FUNC_digest_settable_ctx_params() all return constant B arrays +as descriptors of the parameters that OSSL_FUNC_digest_get_params(), +OSSL_FUNC_digest_get_ctx_params(), and OSSL_FUNC_digest_set_ctx_params() can handle, respectively. Parameters currently recognised by built-in digests with this function @@ -217,28 +217,28 @@ B. =head2 Digest Context Parameters -OP_digest_set_ctx_params() sets digest parameters associated with the +OSSL_FUNC_digest_set_ctx_params() sets digest parameters associated with the given provider side digest context I to I. Any parameter settings are additional to any that were previously set. See L for further details on the parameters structure. -OP_digest_get_ctx_params() gets details of currently set parameters +OSSL_FUNC_digest_get_ctx_params() gets details of currently set parameters values associated with the give provider side digest context I and stores them in I. See L for further details on the parameters structure. =head1 RETURN VALUES -OP_digest_newctx() and OP_digest_dupctx() should return the newly created +OSSL_FUNC_digest_newctx() and OSSL_FUNC_digest_dupctx() should return the newly created provider side digest context, or NULL on failure. -OP_digest_init(), OP_digest_update(), OP_digest_final(), OP_digest_digest(), -OP_digest_set_params() and OP_digest_get_params() should return 1 for success or +OSSL_FUNC_digest_init(), OSSL_FUNC_digest_update(), OSSL_FUNC_digest_final(), OSSL_FUNC_digest_digest(), +OSSL_FUNC_digest_set_params() and OSSL_FUNC_digest_get_params() should return 1 for success or 0 on error. -OP_digest_size() should return the digest size. +OSSL_FUNC_digest_size() should return the digest size. -OP_digest_block_size() should return the block size of the underlying digest +OSSL_FUNC_digest_block_size() should return the block size of the underlying digest algorithm. =head1 SEE ALSO diff --git a/doc/man7/provider-keyexch.pod b/doc/man7/provider-keyexch.pod index 2dcde351e6..f69979aa13 100644 --- a/doc/man7/provider-keyexch.pod +++ b/doc/man7/provider-keyexch.pod @@ -18,21 +18,21 @@ provider-keyexch - The keyexch library E-E provider functions */ /* Context management */ - void *OP_keyexch_newctx(void *provctx); - void OP_keyexch_freectx(void *ctx); - void *OP_keyexch_dupctx(void *ctx); + void *OSSL_FUNC_keyexch_newctx(void *provctx); + void OSSL_FUNC_keyexch_freectx(void *ctx); + void *OSSL_FUNC_keyexch_dupctx(void *ctx); /* Shared secret derivation */ - int OP_keyexch_init(void *ctx, void *provkey); - int OP_keyexch_set_peer(void *ctx, void *provkey); - int OP_keyexch_derive(void *ctx, unsigned char *secret, size_t *secretlen, - size_t outlen); + int OSSL_FUNC_keyexch_init(void *ctx, void *provkey); + int OSSL_FUNC_keyexch_set_peer(void *ctx, void *provkey); + int OSSL_FUNC_keyexch_derive(void *ctx, unsigned char *secret, size_t *secretlen, + size_t outlen); /* Key Exchange parameters */ - int OP_keyexch_set_ctx_params(void *ctx, const OSSL_PARAM params[]); - const OSSL_PARAM *OP_keyexch_settable_ctx_params(void); - int OP_keyexch_get_ctx_params(void *ctx, OSSL_PARAM params[]); - const OSSL_PARAM *OP_keyexch_gettable_ctx_params(void); + int OSSL_FUNC_keyexch_set_ctx_params(void *ctx, const OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_keyexch_settable_ctx_params(void); + int OSSL_FUNC_keyexch_get_ctx_params(void *ctx, OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_keyexch_gettable_ctx_params(void); =head1 DESCRIPTION @@ -53,32 +53,32 @@ provider_query_operation() function All these "functions" have a corresponding function type definition named B, and a helper function to retrieve the function pointer from an B element named -B. -For example, the "function" OP_keyexch_newctx() has these: +B. +For example, the "function" OSSL_FUNC_keyexch_newctx() has these: - typedef void *(OSSL_OP_keyexch_newctx_fn)(void *provctx); - static ossl_inline OSSL_OP_keyexch_newctx_fn - OSSL_get_OP_keyexch_newctx(const OSSL_DISPATCH *opf); + typedef void *(OSSL_FUNC_keyexch_newctx_fn)(void *provctx); + static ossl_inline OSSL_FUNC_keyexch_newctx_fn + OSSL_FUNC_keyexch_newctx(const OSSL_DISPATCH *opf); B arrays are indexed by numbers that are provided as macros in L, as follows: - OP_keyexch_newctx OSSL_FUNC_KEYEXCH_NEWCTX - OP_keyexch_freectx OSSL_FUNC_KEYEXCH_FREECTX - OP_keyexch_dupctx OSSL_FUNC_KEYEXCH_DUPCTX + OSSL_FUNC_keyexch_newctx OSSL_FUNC_KEYEXCH_NEWCTX + OSSL_FUNC_keyexch_freectx OSSL_FUNC_KEYEXCH_FREECTX + OSSL_FUNC_keyexch_dupctx OSSL_FUNC_KEYEXCH_DUPCTX - OP_keyexch_init OSSL_FUNC_KEYEXCH_INIT - OP_keyexch_set_peer OSSL_FUNC_KEYEXCH_SET_PEER - OP_keyexch_derive OSSL_FUNC_KEYEXCH_DERIVE + OSSL_FUNC_keyexch_init OSSL_FUNC_KEYEXCH_INIT + OSSL_FUNC_keyexch_set_peer OSSL_FUNC_KEYEXCH_SET_PEER + OSSL_FUNC_keyexch_derive OSSL_FUNC_KEYEXCH_DERIVE - OP_keyexch_set_ctx_params OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS - OP_keyexch_settable_ctx_params OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS - OP_keyexch_get_ctx_params OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS - OP_keyexch_gettable_ctx_params OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS + OSSL_FUNC_keyexch_set_ctx_params OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS + OSSL_FUNC_keyexch_settable_ctx_params OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS + OSSL_FUNC_keyexch_get_ctx_params OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS + OSSL_FUNC_keyexch_gettable_ctx_params OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS A key exchange algorithm implementation may not implement all of these functions. In order to be a consistent set of functions a provider must implement -OP_keyexch_newctx, OP_keyexch_freectx, OP_keyexch_init and OP_keyexch_derive. +OSSL_FUNC_keyexch_newctx, OSSL_FUNC_keyexch_freectx, OSSL_FUNC_keyexch_init and OSSL_FUNC_keyexch_derive. All other functions are optional. A key exchange algorithm must also implement some mechanism for generating, @@ -87,29 +87,29 @@ See L for further details. =head2 Context Management Functions -OP_keyexch_newctx() should create and return a pointer to a provider side +OSSL_FUNC_keyexch_newctx() should create and return a pointer to a provider side structure for holding context information during a key exchange operation. A pointer to this context will be passed back in a number of the other key exchange operation function calls. The parameter I is the provider context generated during provider initialisation (see L). -OP_keyexch_freectx() is passed a pointer to the provider side key exchange +OSSL_FUNC_keyexch_freectx() is passed a pointer to the provider side key exchange context in the I parameter. This function should free any resources associated with that context. -OP_keyexch_dupctx() should duplicate the provider side key exchange context in +OSSL_FUNC_keyexch_dupctx() should duplicate the provider side key exchange context in the I parameter and return the duplicate copy. =head2 Shared Secret Derivation Functions -OP_keyexch_init() initialises a key exchange operation given a provider side key +OSSL_FUNC_keyexch_init() initialises a key exchange operation given a provider side key exchange context in the I parameter, and a pointer to a provider key object in the I parameter. The key object should have been previously generated, loaded or imported into the provider using the key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>. -OP_keyexch_set_peer() is called to supply the peer's public key (in the +OSSL_FUNC_keyexch_set_peer() is called to supply the peer's public key (in the I parameter) to be used when deriving the shared secret. It is also passed a previously initialised key exchange context in the I parameter. @@ -117,7 +117,7 @@ The key object should have been previously generated, loaded or imported into the provider using the key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>. -OP_keyexch_derive() performs the actual key exchange itself by deriving a shared +OSSL_FUNC_keyexch_derive() performs the actual key exchange itself by deriving a shared secret. A previously initialised key exchange context is passed in the I parameter. @@ -129,24 +129,24 @@ written to I<*secretlen>. =head2 Key Exchange Parameters Functions -OP_keyexch_set_ctx_params() sets key exchange parameters associated with the +OSSL_FUNC_keyexch_set_ctx_params() sets key exchange parameters associated with the given provider side key exchange context I to I, see L. Any parameter settings are additional to any that were previously set. -OP_keyexch_get_ctx_params() gets key exchange parameters associated with the +OSSL_FUNC_keyexch_get_ctx_params() gets key exchange parameters associated with the given provider side key exchange context I into I, see L. -OP_keyexch_settable_ctx_params() yields a constant B array that +OSSL_FUNC_keyexch_settable_ctx_params() yields a constant B array that describes the settable parameters, i.e. parameters that can be used with OP_signature_set_ctx_params(). -If OP_keyexch_settable_ctx_params() is present, OP_keyexch_set_ctx_params() must +If OSSL_FUNC_keyexch_settable_ctx_params() is present, OSSL_FUNC_keyexch_set_ctx_params() must also be present, and vice versa. -Similarly, OP_keyexch_gettable_ctx_params() yields a constant B +Similarly, OSSL_FUNC_keyexch_gettable_ctx_params() yields a constant B array that describes the gettable parameters, i.e. parameters that can be handled by OP_signature_get_ctx_params(). -If OP_keyexch_gettable_ctx_params() is present, OP_keyexch_get_ctx_params() must +If OSSL_FUNC_keyexch_gettable_ctx_params() is present, OSSL_FUNC_keyexch_get_ctx_params() must also be present, and vice versa. See L for the use of B as parameter descriptor. @@ -155,7 +155,7 @@ Notice that not all settable parameters are also gettable, and vice versa. =head2 Common Key Exchange parameters See L for further details on the parameters structure used by -the OP_keyexch_set_ctx_params() and OP_keyexch_get_ctx_params() functions. +the OSSL_FUNC_keyexch_set_ctx_params() and OSSL_FUNC_keyexch_get_ctx_params() functions. Common parameters currently recognised by built-in key exchange algorithms are as follows. @@ -177,14 +177,14 @@ possible secret size. =head1 RETURN VALUES -OP_keyexch_newctx() and OP_keyexch_dupctx() should return the newly created +OSSL_FUNC_keyexch_newctx() and OSSL_FUNC_keyexch_dupctx() should return the newly created provider side key exchange context, or NULL on failure. -OP_keyexch_init(), OP_keyexch_set_peer(), OP_keyexch_derive(), -OP_keyexch_set_params(), and OP_keyexch_get_params() should return 1 for success +OSSL_FUNC_keyexch_init(), OSSL_FUNC_keyexch_set_peer(), OSSL_FUNC_keyexch_derive(), +OSSL_FUNC_keyexch_set_params(), and OSSL_FUNC_keyexch_get_params() should return 1 for success or 0 on error. -OP_keyexch_settable_ctx_params() and OP_keyexch_gettable_ctx_params() should +OSSL_FUNC_keyexch_settable_ctx_params() and OSSL_FUNC_keyexch_gettable_ctx_params() should always return a constant B array. =head1 SEE ALSO diff --git a/doc/man7/provider-keymgmt.pod b/doc/man7/provider-keymgmt.pod index 21dd51ac9a..aa2be41acc 100644 --- a/doc/man7/provider-keymgmt.pod +++ b/doc/man7/provider-keymgmt.pod @@ -15,42 +15,42 @@ provider-keymgmt - The KEYMGMT library E-E provider functions */ /* Key object (keydata) creation and destruction */ - void *OP_keymgmt_new(void *provctx); - void OP_keymgmt_free(void *keydata); + void *OSSL_FUNC_keymgmt_new(void *provctx); + void OSSL_FUNC_keymgmt_free(void *keydata); - void *OP_keymgmt_gen_init(void *provctx, int selection); - int OP_keymgmt_gen_set_template(void *genctx, void *template); - int OP_keymgmt_gen_set_params(void *genctx, const OSSL_PARAM params[]); - const OSSL_PARAM *OP_keymgmt_gen_settable_params(void *provctx); - void *OP_keymgmt_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg); - void OP_keymgmt_gen_cleanup(void *genctx); + void *OSSL_FUNC_keymgmt_gen_init(void *provctx, int selection); + int OSSL_FUNC_keymgmt_gen_set_template(void *genctx, void *template); + int OSSL_FUNC_keymgmt_gen_set_params(void *genctx, const OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_keymgmt_gen_settable_params(void *provctx); + void *OSSL_FUNC_keymgmt_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg); + void OSSL_FUNC_keymgmt_gen_cleanup(void *genctx); /* Key object information */ - int OP_keymgmt_get_params(void *keydata, OSSL_PARAM params[]); - const OSSL_PARAM *OP_keymgmt_gettable_params(void); - int OP_keymgmt_set_params(void *keydata, const OSSL_PARAM params[]); - const OSSL_PARAM *OP_keymgmt_settable_params(void); + int OSSL_FUNC_keymgmt_get_params(void *keydata, OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_keymgmt_gettable_params(void); + int OSSL_FUNC_keymgmt_set_params(void *keydata, const OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_keymgmt_settable_params(void); /* Key object content checks */ - int OP_keymgmt_has(void *keydata, int selection); - int OP_keymgmt_match(const void *keydata1, const void *keydata2, - int selection); + int OSSL_FUNC_keymgmt_has(void *keydata, int selection); + int OSSL_FUNC_keymgmt_match(const void *keydata1, const void *keydata2, + int selection); /* Discovery of supported operations */ - const char *OP_keymgmt_query_operation_name(int operation_id); + const char *OSSL_FUNC_keymgmt_query_operation_name(int operation_id); /* Key object import and export functions */ - int OP_keymgmt_import(int selection, void *keydata, const OSSL_PARAM params[]); - const OSSL_PARAM *OP_keymgmt_import_types(int selection); - int OP_keymgmt_export(int selection, void *keydata, - OSSL_CALLBACK *param_cb, void *cbarg); - const OSSL_PARAM *OP_keymgmt_export_types(int selection); + int OSSL_FUNC_keymgmt_import(int selection, void *keydata, const OSSL_PARAM params[]); + const OSSL_PARAM *OSSL_FUNC_keymgmt_import_types(int selection); + int OSSL_FUNC_keymgmt_export(int selection, void *keydata, + OSSL_CALLBACK *param_cb, void *cbarg); + const OSSL_PARAM *OSSL_FUNC_keymgmt_export_types(int selection); /* Key object copy */ - int OP_keymgmt_copy(void *keydata_to, const void *keydata_from, int selection); + int OSSL_FUNC_keymgmt_copy(void *keydata_to, const void *keydata_from, int selection); /* Key object validation */ - int OP_keymgmt_validate(void *keydata, int selection); + int OSSL_FUNC_keymgmt_validate(void *keydata, int selection); =head1 DESCRIPTION @@ -74,43 +74,43 @@ provider_query_operation() function All these "functions" have a corresponding function type definition named B, and a helper function to retrieve the function pointer from a B element named -B. -For example, the "function" OP_keymgmt_new() has these: +B. +For example, the "function" OSSL_FUNC_keymgmt_new() has these: - typedef void *(OSSL_OP_keymgmt_new_fn)(void *provctx); - static ossl_inline OSSL_OP_keymgmt_new_fn - OSSL_get_OP_keymgmt_new(const OSSL_DISPATCH *opf); + typedef void *(OSSL_FUNC_keymgmt_new_fn)(void *provctx); + static ossl_inline OSSL_FUNC_keymgmt_new_fn + OSSL_FUNC_keymgmt_new(const OSSL_DISPATCH *opf); B arrays are indexed by numbers that are provided as macros in L, as follows: - OP_keymgmt_new OSSL_FUNC_KEYMGMT_NEW - OP_keymgmt_free OSSL_FUNC_KEYMGMT_FREE + OSSL_FUNC_keymgmt_new OSSL_FUNC_KEYMGMT_NEW + OSSL_FUNC_keymgmt_free OSSL_FUNC_KEYMGMT_FREE - OP_keymgmt_gen_init OSSL_FUNC_KEYMGMT_GEN_INIT - OP_keymgmt_gen_set_template OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE - OP_keymgmt_gen_set_params OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS - OP_keymgmt_gen_settable_params OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS - OP_keymgmt_gen OSSL_FUNC_KEYMGMT_GEN - OP_keymgmt_gen_cleanup OSSL_FUNC_KEYMGMT_GEN_CLEANUP + OSSL_FUNC_keymgmt_gen_init OSSL_FUNC_KEYMGMT_GEN_INIT + OSSL_FUNC_keymgmt_gen_set_template OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE + OSSL_FUNC_keymgmt_gen_set_params OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS + OSSL_FUNC_keymgmt_gen_settable_params OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS + OSSL_FUNC_keymgmt_gen OSSL_FUNC_KEYMGMT_GEN + OSSL_FUNC_keymgmt_gen_cleanup OSSL_FUNC_KEYMGMT_GEN_CLEANUP - OP_keymgmt_get_params OSSL_FUNC_KEYMGMT_GET_PARAMS - OP_keymgmt_gettable_params OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS - OP_keymgmt_set_params OSSL_FUNC_KEYMGMT_SET_PARAMS - OP_keymgmt_settable_params OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS + OSSL_FUNC_keymgmt_get_params OSSL_FUNC_KEYMGMT_GET_PARAMS + OSSL_FUNC_keymgmt_gettable_params OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS + OSSL_FUNC_keymgmt_set_params OSSL_FUNC_KEYMGMT_SET_PARAMS + OSSL_FUNC_keymgmt_settable_params OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS - OP_keymgmt_query_operation_name OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME + OSSL_FUNC_keymgmt_query_operation_name OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME - OP_keymgmt_has OSSL_FUNC_KEYMGMT_HAS - OP_keymgmt_validate OSSL_FUNC_KEYMGMT_VALIDATE - OP_keymgmt_match OSSL_FUNC_KEYMGMT_MATCH + OSSL_FUNC_keymgmt_has OSSL_FUNC_KEYMGMT_HAS + OSSL_FUNC_keymgmt_validate OSSL_FUNC_KEYMGMT_VALIDATE + OSSL_FUNC_keymgmt_match OSSL_FUNC_KEYMGMT_MATCH - OP_keymgmt_import OSSL_FUNC_KEYMGMT_IMPORT - OP_keymgmt_import_types OSSL_FUNC_KEYMGMT_IMPORT_TYPES - OP_keymgmt_export OSSL_FUNC_KEYMGMT_EXPORT - OP_keymgmt_export_types OSSL_FUNC_KEYMGMT_EXPORT_TYPES + OSSL_FUNC_keymgmt_import OSSL_FUNC_KEYMGMT_IMPORT + OSSL_FUNC_keymgmt_import_types OSSL_FUNC_KEYMGMT_IMPORT_TYPES + OSSL_FUNC_keymgmt_export OSSL_FUNC_KEYMGMT_EXPORT + OSSL_FUNC_keymgmt_export_types OSSL_FUNC_KEYMGMT_EXPORT_TYPES - OP_keymgmt_copy OSSL_FUNC_KEYMGMT_COPY + OSSL_FUNC_keymgmt_copy OSSL_FUNC_KEYMGMT_COPY =head2 Key Objects @@ -201,73 +201,73 @@ the other half. =head2 Constructing and Destructing Functions -OP_keymgmt_new() should create a provider side key object. The +OSSL_FUNC_keymgmt_new() should create a provider side key object. The provider context I is passed and may be incorporated in the key object, but that is not mandatory. -OP_keymgmt_free() should free the passed I. +OSSL_FUNC_keymgmt_free() should free the passed I. -OP_keymgmt_gen_init(), OP_keymgmt_gen_set_template(), -OP_keymgmt_gen_set_params(), OP_keymgmt_gen_settable_params(), -OP_keymgmt_gen() and OP_keymgmt_gen_cleanup() work together as a more +OSSL_FUNC_keymgmt_gen_init(), OSSL_FUNC_keymgmt_gen_set_template(), +OSSL_FUNC_keymgmt_gen_set_params(), OSSL_FUNC_keymgmt_gen_settable_params(), +OSSL_FUNC_keymgmt_gen() and OSSL_FUNC_keymgmt_gen_cleanup() work together as a more elaborate context based key object constructor. -OP_keymgmt_gen_init() should create the key object generation context +OSSL_FUNC_keymgmt_gen_init() should create the key object generation context and initialize it with I, which will determine what kind of contents the key object to be generated should get. -OP_keymgmt_gen_set_template() should add I