From b638dad970c65e311e9a724b89972441268adc9f Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 16 Mar 2021 14:30:59 +0100 Subject: [PATCH] Add OSSL_STORE_LOADER_description() Fixes #14514 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14656) --- crypto/store/store_meth.c | 5 +++++ doc/man3/OSSL_STORE_LOADER.pod | 9 +++++++++ include/openssl/store.h | 1 + util/libcrypto.num | 1 + 4 files changed, 16 insertions(+) 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. OSSL_STORE_LOADER_number() returns the internal dynamic number assigned to the given I. +OSSL_STORE_LOADER_description() returns a description of the I, meant +for display and human consumption. The description is at the discretion of the +I implementation. + OSSL_STORE_LOADER_do_all_provided() traverses all store implementations by all activated providers in the library context I, and for each of the implementations, calls I 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, B, B, B, B, B 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: