summaryrefslogtreecommitdiffstats
path: root/crypto/store/store_lib.c
AgeCommit message (Collapse)Author
2018-02-23STORE: Add the possibility to search for specific informationRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2688)
2018-02-23STORE: Add the possibility to specify an expected info typeRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2688)
2018-02-23STORE: In preparation for coming work, mark when loading is startedRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2688)
2018-02-14OSSL_STORE: Add OSSL_STORE_vctrl()Richard Levitte
It's a convenient complement to OSSL_STORE_ctrl() Suggested by Norm Green Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/5363)
2017-08-30Move e_os.h to be the very first include.Pauli
cryptilib.h is the second. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
2017-08-15Clear error stack on successful OSSL_STORE_open()Richard Levitte
Since OSSL_STORE_open() tries with the 'file' scheme loader first, and then on the loader implied by the URI if the former fails, the former leaves an error on the error stack. This is confusing, so let's clear the error stack on success. The implementation uses ERR_set_mark, ERR_pop_to_mark and ERR_clear_last_mark to make sure caller errors are preserved as much as possible. Fixes #4089 Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4094)
2017-07-27Fixups for STORE commitBenjamin Kaduk
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3860)
2017-07-15OSSL_STORE: Treat URIs as files first (with exceptions), then as full URIsRichard Levitte
To handle paths that contain devices (for example, C:/foo/bar.pem on Windows), try to "open" the URI using the file scheme loader first, and failing that, check if the device is really a scheme we know. The "file" scheme does the same kind of thing to pick out the path part of the URI. An exception to this special treatment is if the URI has an authority part (something that starts with "//" directly after what looks like a scheme). Such URIs will never be treated as plain file paths. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3907)
2017-07-03Make sure OSSL_STORE_load() isn't caught in an endless loopRichard Levitte
The post process callback might potentially say "no" to everything (by constantly returning NULL) and thereby cause an endless loop. Ensure that we stop all processing when "eof" is reached. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3823)
2017-06-29Add internal functions to fetch PEM data from an opened BIORichard Levitte
store_attach_pem_bio() creates a STORE_CTX with the 'file' scheme loader backend in PEM reading mode on an already opened BIO. store_detach_pem_bio() detaches the STORE_CTX from the BIO and destroys it (without destroying the BIO). These two functions can be used in place of STORE_open() and STORE_close(), and are present as internal support for other OpenSSL functions. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2745)
2017-06-29STORE: Add a OSSL_STORE_INFO type to help support file handler restartsRichard Levitte
Some containers might very simply decode into something new that deserves to be considered as new (embedded) data. With the help of a special OSSL_STORE_INFO type, make that new data available to the loader functions so they can start over. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
2017-06-29Add the STORE moduleRichard Levitte
This STORE module adds the following functionality: - A function OSSL_STORE_open(), OSSL_STORE_load() and OSSL_STORE_close() that accesses a URI and helps loading the supported objects (PKEYs, CERTs and CRLs for the moment) from it. - An opaque type OSSL_STORE_INFO that holds information on each loaded object. - A few functions to retrieve desired data from a OSSL_STORE_INFO reference. - Functions to register and unregister loaders for different URI schemes. This enables dynamic addition of loaders from applications or from engines. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)