summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-03-16 14:30:59 +0100
committerRichard Levitte <levitte@openssl.org>2021-04-02 08:57:47 +0200
commitb638dad970c65e311e9a724b89972441268adc9f (patch)
tree639d4e58b8262d8039d4335cd49aa9e0f2060af9
parent1010884e0a6d391d3628ffdb057f1812ef08ed73 (diff)
Add OSSL_STORE_LOADER_description()
Fixes #14514 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
-rw-r--r--crypto/store/store_meth.c5
-rw-r--r--doc/man3/OSSL_STORE_LOADER.pod9
-rw-r--r--include/openssl/store.h1
-rw-r--r--util/libcrypto.num1
4 files changed, 16 insertions, 0 deletions
diff --git a/crypto/store/store_meth.c b/crypto/store/store_meth.c
index e12e517cd1..be78adaab8 100644
--- a/crypto/store/store_meth.c
+++ b/crypto/store/store_meth.c
@@ -402,6 +402,11 @@ int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader)
return loader->scheme_id;
}
+const char *OSSL_STORE_LOADER_description(const OSSL_STORE_LOADER *loader)
+{
+ return loader->description;
+}
+
int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader, const char *name)
{
if (loader->prov != NULL) {
diff --git a/doc/man3/OSSL_STORE_LOADER.pod b/doc/man3/OSSL_STORE_LOADER.pod
index 1cfce445b8..7413104079 100644
--- a/doc/man3/OSSL_STORE_LOADER.pod
+++ b/doc/man3/OSSL_STORE_LOADER.pod
@@ -10,6 +10,7 @@ OSSL_STORE_LOADER_provider,
OSSL_STORE_LOADER_properties,
OSSL_STORE_LOADER_is_a,
OSSL_STORE_LOADER_number,
+OSSL_STORE_LOADER_description,
OSSL_STORE_LOADER_do_all_provided,
OSSL_STORE_LOADER_names_do_all,
OSSL_STORE_LOADER_CTX, OSSL_STORE_LOADER_new,
@@ -42,6 +43,7 @@ unregister STORE loaders for different URI schemes
loader);
const char *OSSL_STORE_LOADER_properties(const OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader);
+ const char *OSSL_STORE_LOADER_description(const OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader,
const char *scheme);
void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
@@ -139,6 +141,10 @@ of an algorithm that's identifiable with I<scheme>.
OSSL_STORE_LOADER_number() returns the internal dynamic number assigned
to the given I<loader>.
+OSSL_STORE_LOADER_description() returns a description of the I<loader>, meant
+for display and human consumption. The description is at the discretion of the
+I<loader> implementation.
+
OSSL_STORE_LOADER_do_all_provided() traverses all store implementations
by all activated providers in the library context I<libctx>, and for each
of the implementations, calls I<fn> with the implementation method and
@@ -328,6 +334,9 @@ otherwise 0.
OSSL_STORE_LOADER_number() returns an integer.
+OSSL_STORE_LOADER_description() returns a pointer to a decription, or NULL if
+there isn't one.
+
The functions with the types B<OSSL_STORE_open_fn>,
B<OSSL_STORE_open_ex_fn>, B<OSSL_STORE_ctrl_fn>,
B<OSSL_STORE_expect_fn>, B<OSSL_STORE_load_fn>, B<OSSL_STORE_eof_fn>
diff --git a/include/openssl/store.h b/include/openssl/store.h
index 19669b55f1..f0c20e56fe 100644
--- a/include/openssl/store.h
+++ b/include/openssl/store.h
@@ -260,6 +260,7 @@ const OSSL_PROVIDER *OSSL_STORE_LOADER_provider(const OSSL_STORE_LOADER *
loader);
const char *OSSL_STORE_LOADER_properties(const OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader);
+const char *OSSL_STORE_LOADER_description(const OSSL_STORE_LOADER *loader);
int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader,
const char *scheme);
void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 203d50263b..eb84f1763e 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -5335,3 +5335,4 @@ RSA_PSS_PARAMS_dup ? 3_0_0 EXIST::FUNCTION:
EVP_PKEY_derive_set_peer_ex ? 3_0_0 EXIST::FUNCTION:
OSSL_DECODER_description ? 3_0_0 EXIST::FUNCTION:
OSSL_ENCODER_description ? 3_0_0 EXIST::FUNCTION:
+OSSL_STORE_LOADER_description ? 3_0_0 EXIST::FUNCTION: