summaryrefslogtreecommitdiffstats
path: root/crypto/encode_decode/encoder_meth.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/encode_decode/encoder_meth.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/encode_decode/encoder_meth.c')
-rw-r--r--crypto/encode_decode/encoder_meth.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c
index 490eeb2e0a..81a22508d6 100644
--- a/crypto/encode_decode/encoder_meth.c
+++ b/crypto/encode_decode/encoder_meth.c
@@ -159,8 +159,8 @@ static int put_encoder_in_store(OSSL_LIB_CTX *libctx, void *store,
}
/* Create and populate a encoder method */
-static void *encoder_from_dispatch(int id, const OSSL_ALGORITHM *algodef,
- OSSL_PROVIDER *prov)
+static void *encoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
+ OSSL_PROVIDER *prov)
{
OSSL_ENCODER *encoder = NULL;
const OSSL_DISPATCH *fns = algodef->implementation;
@@ -169,6 +169,7 @@ static void *encoder_from_dispatch(int id, const OSSL_ALGORITHM *algodef,
return NULL;
encoder->base.id = id;
encoder->base.propdef = algodef->property_definition;
+ encoder->base.description = algodef->algorithm_description;
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
@@ -253,7 +254,7 @@ static void *encoder_from_dispatch(int id, const OSSL_ALGORITHM *algodef,
/*
* The core fetching functionality passes the names of the implementation.
* This function is responsible to getting an identity number for them,
- * then call encoder_from_dispatch() with that identity number.
+ * then call encoder_from_algorithm() with that identity number.
*/
static void *construct_encoder(const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov, void *data)
@@ -272,7 +273,7 @@ static void *construct_encoder(const OSSL_ALGORITHM *algodef,
void *method = NULL;
if (id != 0)
- method = encoder_from_dispatch(id, algodef, prov);
+ method = encoder_from_algorithm(id, algodef, prov);
/*
* Flag to indicate that there was actual construction errors. This
@@ -465,7 +466,7 @@ static void encoder_do_one(OSSL_PROVIDER *provider,
if (id != 0)
method =
- encoder_from_dispatch(id, algodef, provider);
+ encoder_from_algorithm(id, algodef, provider);
if (method != NULL) {
data->user_fn(method, data->user_arg);