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/mac_meth.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/mac_meth.c')
-rw-r--r-- | crypto/evp/mac_meth.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c index 85f87e4c61..bd43e880ae 100644 --- a/crypto/evp/mac_meth.c +++ b/crypto/evp/mac_meth.c @@ -46,10 +46,11 @@ static void *evp_mac_new(void) return mac; } -static void *evp_mac_from_dispatch(int name_id, - const OSSL_DISPATCH *fns, - OSSL_PROVIDER *prov) +static void *evp_mac_from_algorithm(int name_id, + const OSSL_ALGORITHM *algodef, + OSSL_PROVIDER *prov) { + const OSSL_DISPATCH *fns = algodef->implementation; EVP_MAC *mac = NULL; int fnmaccnt = 0, fnctxcnt = 0; @@ -58,6 +59,7 @@ static void *evp_mac_from_dispatch(int name_id, return NULL; } mac->name_id = name_id; + mac->description = algodef->algorithm_description; for (; fns->function_id != 0; fns++) { switch (fns->function_id) { @@ -153,7 +155,7 @@ EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties) { return evp_generic_fetch(libctx, OSSL_OP_MAC, algorithm, properties, - evp_mac_from_dispatch, evp_mac_up_ref, + evp_mac_from_algorithm, evp_mac_up_ref, evp_mac_free); } @@ -225,5 +227,5 @@ void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx, { evp_generic_do_all(libctx, OSSL_OP_MAC, (void (*)(void *, void *))fn, arg, - evp_mac_from_dispatch, evp_mac_free); + evp_mac_from_algorithm, evp_mac_free); } |