STORE: Add a built-in 'file:' storemgmt implementation (loader)
authorRichard Levitte <levitte@openssl.org>
Sun, 2 Aug 2020 10:46:00 +0000 (12:46 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 3 Sep 2020 15:48:32 +0000 (17:48 +0200)
commit63f187cfedd21550094b5d69a52f7f617545b209
treeaa2b6649e267d28c516d843b5e94f376ad6b3a80
parent16feca71544681cabf873fecd3f860f9853bdf07
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)
21 files changed:
crypto/encode_decode/decoder_lib.c
crypto/encode_decode/decoder_meth.c
crypto/encode_decode/decoder_pkey.c
crypto/err/openssl.txt
crypto/provider_core.c
include/crypto/decoder.h [new file with mode: 0644]
include/openssl/core_dispatch.h
include/openssl/err.h
providers/baseprov.c
providers/common/bio_prov.c
providers/common/include/prov/bio.h
providers/common/include/prov/providercommonerr.h
providers/common/provider_err.c
providers/defltprov.c
providers/implementations/build.info
providers/implementations/include/prov/implementations.h
providers/implementations/storemgmt/build.info [new file with mode: 0644]
providers/implementations/storemgmt/file_store.c [new file with mode: 0644]
providers/implementations/storemgmt/file_store_der2obj.c [new file with mode: 0644]
providers/implementations/storemgmt/file_store_local.h [new file with mode: 0644]
providers/stores.inc [new file with mode: 0644]