diff options
author | Richard Levitte <levitte@openssl.org> | 2021-03-16 14:14:43 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-04-02 08:52:37 +0200 |
commit | 309a78aa305ee14878e453c78ccf9a7dc91264cf (patch) | |
tree | 82b3791b395f3e6557084d08cdf3058a30eb38e2 /crypto/evp/asymcipher.c | |
parent | 650c66873793bed505802f316b15772a0f887743 (diff) |
CORE: Add an algorithm_description field to OSSL_ALGORITHM
This corresponds to the |info| field in EVP_PKEY_ASN1_METHOD, as well
as the generic use of OBJ_nid2ln() as a one line description.
We also add the base functionality to make use of this field.
Fixes #14514
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14656)
Diffstat (limited to 'crypto/evp/asymcipher.c')
-rw-r--r-- | crypto/evp/asymcipher.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/asymcipher.c b/crypto/evp/asymcipher.c index e74aafcb13..60f3ce67cf 100644 --- a/crypto/evp/asymcipher.c +++ b/crypto/evp/asymcipher.c @@ -274,10 +274,11 @@ static EVP_ASYM_CIPHER *evp_asym_cipher_new(OSSL_PROVIDER *prov) return cipher; } -static void *evp_asym_cipher_from_dispatch(int name_id, - const OSSL_DISPATCH *fns, - OSSL_PROVIDER *prov) +static void *evp_asym_cipher_from_algorithm(int name_id, + const OSSL_ALGORITHM *algodef, + OSSL_PROVIDER *prov) { + const OSSL_DISPATCH *fns = algodef->implementation; EVP_ASYM_CIPHER *cipher = NULL; int ctxfncnt = 0, encfncnt = 0, decfncnt = 0; int gparamfncnt = 0, sparamfncnt = 0; @@ -288,6 +289,7 @@ static void *evp_asym_cipher_from_dispatch(int name_id, } cipher->name_id = name_id; + cipher->description = algodef->algorithm_description; for (; fns->function_id != 0; fns++) { switch (fns->function_id) { @@ -418,7 +420,7 @@ EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { return evp_generic_fetch(ctx, OSSL_OP_ASYM_CIPHER, algorithm, properties, - evp_asym_cipher_from_dispatch, + evp_asym_cipher_from_algorithm, (int (*)(void *))EVP_ASYM_CIPHER_up_ref, (void (*)(void *))EVP_ASYM_CIPHER_free); } @@ -440,7 +442,7 @@ void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, { evp_generic_do_all(libctx, OSSL_OP_ASYM_CIPHER, (void (*)(void *, void *))fn, arg, - evp_asym_cipher_from_dispatch, + evp_asym_cipher_from_algorithm, (void (*)(void *))EVP_ASYM_CIPHER_free); } |