X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fevp_local.h;h=132534464fdf9508942170b8c6c71bb1e255ed42;hp=71e12583268ec4e379854e4735edd37ec806f3d3;hb=f000e82898af251442ca52e81fc1ee45996090dc;hpb=3c957bcd54d097167e53660fa100aa1ba85d63b5 diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index 71e1258326..132534464f 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,6 +10,7 @@ /* EVP_MD_CTX related stuff */ #include +#include "internal/refcount.h" #define EVP_CTRL_RET_UNSUPPORTED -1 @@ -65,6 +66,43 @@ struct evp_kdf_ctx_st { void *data; /* Algorithm-specific data */ } /* EVP_KDF_CTX */ ; +struct evp_rand_ctx_st { + EVP_RAND *meth; /* Method structure */ + void *data; /* Algorithm-specific data */ + size_t max_request; /* + * Cached: maximum number of bytes generated + * in a single call to the generate function + */ + unsigned int strength; /* Cached: bit strength of generator */ +} /* EVP_RAND_CTX */ ; + +struct evp_rand_st { + OSSL_PROVIDER *prov; + int name_id; + CRYPTO_REF_COUNT refcnt; + 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; +} /* EVP_RAND */ ; + struct evp_keymgmt_st { int id; /* libcrypto internal */ @@ -73,29 +111,36 @@ struct evp_keymgmt_st { CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *lock; - /* Domain parameter routines */ - OSSL_OP_keymgmt_importdomparams_fn *importdomparams; - OSSL_OP_keymgmt_gendomparams_fn *gendomparams; - OSSL_OP_keymgmt_freedomparams_fn *freedomparams; - OSSL_OP_keymgmt_exportdomparams_fn *exportdomparams; - OSSL_OP_keymgmt_importdomparam_types_fn *importdomparam_types; - OSSL_OP_keymgmt_exportdomparam_types_fn *exportdomparam_types; - - /* Key routines */ - OSSL_OP_keymgmt_importkey_fn *importkey; - OSSL_OP_keymgmt_genkey_fn *genkey; - OSSL_OP_keymgmt_loadkey_fn *loadkey; - OSSL_OP_keymgmt_freekey_fn *freekey; - OSSL_OP_keymgmt_exportkey_fn *exportkey; - OSSL_OP_keymgmt_importkey_types_fn *importkey_types; - OSSL_OP_keymgmt_exportkey_types_fn *exportkey_types; + /* 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; + + /* 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; + + /* 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; + + /* 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; } /* EVP_KEYMGMT */ ; -struct keymgmt_data_st { - OPENSSL_CTX *ctx; - const char *properties; -}; - struct evp_keyexch_st { int name_id; OSSL_PROVIDER *prov; @@ -110,6 +155,8 @@ struct evp_keyexch_st { 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; } /* EVP_KEYEXCH */; struct evp_signature_st { @@ -128,9 +175,11 @@ struct evp_signature_st { 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; @@ -268,8 +317,9 @@ OSSL_PARAM *evp_pkey_to_param(EVP_PKEY *pkey, size_t *sz); void evp_pkey_ctx_free_old_ops(EVP_PKEY_CTX *ctx); /* OSSL_PROVIDER * is only used to get the library context */ -const char *evp_first_name(OSSL_PROVIDER *prov, int name_id); -int evp_is_a(OSSL_PROVIDER *prov, int number, const char *name); +const char *evp_first_name(const OSSL_PROVIDER *prov, int name_id); +int evp_is_a(OSSL_PROVIDER *prov, int number, + const char *legacy_name, const char *name); void evp_names_do_all(OSSL_PROVIDER *prov, int number, void (*fn)(const char *name, void *data), void *data);