summaryrefslogtreecommitdiffstats
path: root/crypto/evp/exchange.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-03-16 14:14:43 +0100
committerRichard Levitte <levitte@openssl.org>2021-04-02 08:52:37 +0200
commit309a78aa305ee14878e453c78ccf9a7dc91264cf (patch)
tree82b3791b395f3e6557084d08cdf3058a30eb38e2 /crypto/evp/exchange.c
parent650c66873793bed505802f316b15772a0f887743 (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/exchange.c')
-rw-r--r--crypto/evp/exchange.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c
index 5bb038f118..fd8e9210a1 100644
--- a/crypto/evp/exchange.c
+++ b/crypto/evp/exchange.c
@@ -38,10 +38,11 @@ static EVP_KEYEXCH *evp_keyexch_new(OSSL_PROVIDER *prov)
return exchange;
}
-static void *evp_keyexch_from_dispatch(int name_id,
- const OSSL_DISPATCH *fns,
- OSSL_PROVIDER *prov)
+static void *evp_keyexch_from_algorithm(int name_id,
+ const OSSL_ALGORITHM *algodef,
+ OSSL_PROVIDER *prov)
{
+ const OSSL_DISPATCH *fns = algodef->implementation;
EVP_KEYEXCH *exchange = NULL;
int fncnt = 0, sparamfncnt = 0, gparamfncnt = 0;
@@ -51,6 +52,7 @@ static void *evp_keyexch_from_dispatch(int name_id,
}
exchange->name_id = name_id;
+ exchange->description = algodef->algorithm_description;
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
@@ -169,7 +171,7 @@ EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties)
{
return evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties,
- evp_keyexch_from_dispatch,
+ evp_keyexch_from_algorithm,
(int (*)(void *))EVP_KEYEXCH_up_ref,
(void (*)(void *))EVP_KEYEXCH_free);
}
@@ -474,7 +476,7 @@ void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
{
evp_generic_do_all(libctx, OSSL_OP_KEYEXCH,
(void (*)(void *, void *))fn, arg,
- evp_keyexch_from_dispatch,
+ evp_keyexch_from_algorithm,
(void (*)(void *))EVP_KEYEXCH_free);
}