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/evp_enc.c | |
parent | 650c66873793bed505802f316b15772a0f887743 (diff) | |
download | openssl-new-309a78aa305ee14878e453c78ccf9a7dc91264cf.tar.gz |
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/evp_enc.c')
-rw-r--r-- | crypto/evp/evp_enc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 79ffd2275f..64759311c0 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1440,10 +1440,11 @@ static void set_legacy_nid(const char *name, void *vlegacy_nid) } #endif -static void *evp_cipher_from_dispatch(const int name_id, - const OSSL_DISPATCH *fns, - OSSL_PROVIDER *prov) +static void *evp_cipher_from_algorithm(const int name_id, + const OSSL_ALGORITHM *algodef, + OSSL_PROVIDER *prov) { + const OSSL_DISPATCH *fns = algodef->implementation; EVP_CIPHER *cipher = NULL; int fnciphcnt = 0, fnctxcnt = 0; @@ -1463,6 +1464,7 @@ static void *evp_cipher_from_dispatch(const int name_id, #endif cipher->name_id = name_id; + cipher->description = algodef->algorithm_description; for (; fns->function_id != 0; fns++) { switch (fns->function_id) { @@ -1587,7 +1589,7 @@ EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, { EVP_CIPHER *cipher = evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties, - evp_cipher_from_dispatch, evp_cipher_up_ref, + evp_cipher_from_algorithm, evp_cipher_up_ref, evp_cipher_free); return cipher; @@ -1622,5 +1624,5 @@ void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, { evp_generic_do_all(libctx, OSSL_OP_CIPHER, (void (*)(void *, void *))fn, arg, - evp_cipher_from_dispatch, evp_cipher_free); + evp_cipher_from_algorithm, evp_cipher_free); } |