summaryrefslogtreecommitdiffstats
path: root/crypto/store
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/store
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/store')
-rw-r--r--crypto/store/store_local.h1
-rw-r--r--crypto/store/store_meth.c11
2 files changed, 7 insertions, 5 deletions
diff --git a/crypto/store/store_local.h b/crypto/store/store_local.h
index 16989707d6..b46c63d5e9 100644
--- a/crypto/store/store_local.h
+++ b/crypto/store/store_local.h
@@ -100,6 +100,7 @@ struct ossl_store_loader_st {
OSSL_PROVIDER *prov;
int scheme_id;
const char *propdef;
+ const char *description;
CRYPTO_REF_COUNT refcnt;
CRYPTO_RWLOCK *lock;
diff --git a/crypto/store/store_meth.c b/crypto/store/store_meth.c
index c74a634e9e..e12e517cd1 100644
--- a/crypto/store/store_meth.c
+++ b/crypto/store/store_meth.c
@@ -162,8 +162,8 @@ static int put_loader_in_store(OSSL_LIB_CTX *libctx, void *store,
up_ref_loader, free_loader);
}
-static void *loader_from_dispatch(int scheme_id, const OSSL_ALGORITHM *algodef,
- OSSL_PROVIDER *prov)
+static void *loader_from_algorithm(int scheme_id, const OSSL_ALGORITHM *algodef,
+ OSSL_PROVIDER *prov)
{
OSSL_STORE_LOADER *loader = NULL;
const OSSL_DISPATCH *fns = algodef->implementation;
@@ -172,6 +172,7 @@ static void *loader_from_dispatch(int scheme_id, const OSSL_ALGORITHM *algodef,
return NULL;
loader->scheme_id = scheme_id;
loader->propdef = algodef->property_definition;
+ loader->description = algodef->algorithm_description;
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
@@ -226,7 +227,7 @@ static void *loader_from_dispatch(int scheme_id, const OSSL_ALGORITHM *algodef,
/*
* The core fetching functionality passes the scheme of the implementation.
* This function is responsible to getting an identity number for them,
- * then call loader_from_dispatch() with that identity number.
+ * then call loader_from_algorithm() with that identity number.
*/
static void *construct_loader(const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov, void *data)
@@ -245,7 +246,7 @@ static void *construct_loader(const OSSL_ALGORITHM *algodef,
void *method = NULL;
if (id != 0)
- method = loader_from_dispatch(id, algodef, prov);
+ method = loader_from_algorithm(id, algodef, prov);
/*
* Flag to indicate that there was actual construction errors. This
@@ -430,7 +431,7 @@ static void loader_do_one(OSSL_PROVIDER *provider,
if (id != 0)
method =
- loader_from_dispatch(id, algodef, provider);
+ loader_from_algorithm(id, algodef, provider);
if (method != NULL) {
data->user_fn(method, data->user_arg);