summaryrefslogtreecommitdiffstats
path: root/providers/defltprov.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-08-02 12:46:00 +0200
committerRichard Levitte <levitte@openssl.org>2020-09-03 17:48:32 +0200
commit63f187cfedd21550094b5d69a52f7f617545b209 (patch)
treeaa2b6649e267d28c516d843b5e94f376ad6b3a80 /providers/defltprov.c
parent16feca71544681cabf873fecd3f860f9853bdf07 (diff)
STORE: Add a built-in 'file:' storemgmt implementation (loader)
This replaces the older 'file:' loader that is now an engine. It's still possible to use the older 'file:' loader by explicitly using the engine, and tests will remain for it as long as ENGINEs are still supported (even through deprecated). To support this storemgmt implementation, a few internal OSSL_DECODER modifications are needed: - An internal function that implements most of OSSL_DECODER_CTX_new_by_EVP_PKEY(), but operates on an already existing OSSL_DECODER_CTX instead of allocating a new one. - Allow direct creation of a OSSL_DECODER from an OSSL_ALGORITHM. It isn't attached to any provider, and is only used internally, to simply catch any DER encoded object to be passed back to the object callback with no further checking. This implementation becomes the last resort decoder, when all "normal" decodation attempts (i.e. those that are supposed to result in an OpenSSL object of some sort) have failed. Because file_store_attach() uses BIO_tell(), we must also support BIO_ctrl() as a libcrypto upcall. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12587)
Diffstat (limited to 'providers/defltprov.c')
-rw-r--r--providers/defltprov.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/providers/defltprov.c b/providers/defltprov.c
index 855497be06..beaf60bb1e 100644
--- a/providers/defltprov.c
+++ b/providers/defltprov.c
@@ -433,6 +433,15 @@ static const OSSL_ALGORITHM deflt_decoder[] = {
};
#undef DECODER
+static const OSSL_ALGORITHM deflt_store[] = {
+#define STORE(name, fips, func_table) \
+ { name, "provider=default,fips=" fips, (func_table) },
+
+#include "stores.inc"
+ { NULL, NULL, NULL }
+#undef STORE
+};
+
static const OSSL_ALGORITHM *deflt_query(void *provctx, int operation_id,
int *no_cache)
{
@@ -461,6 +470,8 @@ static const OSSL_ALGORITHM *deflt_query(void *provctx, int operation_id,
return deflt_encoder;
case OSSL_OP_DECODER:
return deflt_decoder;
+ case OSSL_OP_STORE:
+ return deflt_store;
}
return NULL;
}