PROVIDER-STOREMGMT(7ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so PROVIDER-STOREMGMT(7ossl) is the manual name, and this page is provider-storemgmt β€” The OSSL_STORE library <-> provider functions. literally the lore drop for how the store side talks to providers, bestie.


✨ SYNOPSIS ✨

first up, the include and the whole β€œthese are not real functions” disclaimer:

#include <openssl/core_dispatch.h>

/*
 * None of these are actual functions, but are displayed like this for
 * the function signatures for functions that are offered as function
 * pointers in OSSL_DISPATCH arrays.
 */

void *OSSL_FUNC_store_open(void *provctx, const char *uri);
void *OSSL_FUNC_store_attach(void *provctx, OSSL_CORE_BIO *bio);
const OSSL_PARAM *store_settable_ctx_params(void *provctx);
int OSSL_FUNC_store_set_ctx_params(void *loaderctx, const OSSL_PARAM[]);
int OSSL_FUNC_store_load(void *loaderctx,
                         OSSL_CALLBACK *object_cb, void *object_cbarg,
                         OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg);
int OSSL_FUNC_store_eof(void *loaderctx);
int OSSL_FUNC_store_close(void *loaderctx);

int OSSL_FUNC_store_export_object
    (void *loaderctx, const void *objref, size_t objref_sz,
     OSSL_CALLBACK *export_cb, void *export_cbarg);
void *OSSL_FUNC_store_open_ex(void *provctx, const char *uri,
                              const OSSL_PARAM params[],
                              OSSL_PASSPHRASE_CALLBACK *pw_cb,
                              void *pw_cbarg);

int OSSL_FUNC_store_delete(void *provctx, const char *uri,
                   const OSSL_PARAM params[],
                   OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg);

those OSSL_FUNC_* names are function-pointer signatures, not callable functions in your regular C code. periodt πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the STORE operation is literally the provider side of the ossl_store(7) API.

its main character job? loading all sorts of objects from a container indicated by URI. those objects get handed to the OpenSSL library in provider-native object abstraction form (see provider-object(7)). then the OpenSSL library is responsible for passing that abstraction on to suitable provided functions.

examples of functions the OpenSSL library can pass the abstraction to include OSSL_FUNC_keymgmt_load() (provider-keymgmt(7)), and OSSL_FUNC_store_export_object() (which exports the object in parameterized form).

all the β€œfunctions” we're talking about here are passed as function pointers between libcrypto and the provider in OSSL_DISPATCH(3) arrays via OSSL_ALGORITHM(3) arrays that are returned by the provider's provider_query_operation() function (see "Provider Functions" in provider-base(7)).

all these β€œfunctions” have a corresponding function type definition named OSSL_FUNC_{name}_fn, and a helper function to retrieve the function pointer from an OSSL_DISPATCH(3) element named OSSL_get_{name}. for example, the β€œfunction” OSSL_FUNC_store_attach() has these:

typedef void *(OSSL_FUNC_store_attach_fn)(void *provctx,
                                          OSSL_CORE_BIO * bio);
static ossl_inline OSSL_FUNC_store_attach_fn
    OSSL_FUNC_store_attach(const OSSL_DISPATCH *opf);

OSSL_DISPATCH(3) arrays are indexed by numbers that are provided as macros in openssl-core_dispatch.h(7), as follows:

OSSL_FUNC_store_open                 OSSL_FUNC_STORE_OPEN
OSSL_FUNC_store_attach               OSSL_FUNC_STORE_ATTACH
OSSL_FUNC_store_settable_ctx_params  OSSL_FUNC_STORE_SETTABLE_CTX_PARAMS
OSSL_FUNC_store_set_ctx_params       OSSL_FUNC_STORE_SET_CTX_PARAMS
OSSL_FUNC_store_load                 OSSL_FUNC_STORE_LOAD
OSSL_FUNC_store_eof                  OSSL_FUNC_STORE_EOF
OSSL_FUNC_store_close                OSSL_FUNC_STORE_CLOSE
OSSL_FUNC_store_export_object        OSSL_FUNC_STORE_EXPORT_OBJECT
OSSL_FUNC_store_delete               OSSL_FUNC_STORE_DELETE
OSSL_FUNC_store_open_ex              OSSL_FUNC_STORE_OPEN_EX

πŸ’… Functions πŸ’…

  • OSSL_FUNC_store_open() β€” should create a provider side context with data based on the input uri. the implementation is entirely responsible for the interpretation of the URI. no pressure lol.
  • OSSL_FUNC_store_attach() β€” should create a provider side context with the core BIO bio attached. this is an alternative to using a URI to find storage, supporting OSSL_STORE_attach(3).
  • OSSL_FUNC_store_settable_ctx_params() β€” should return a constant array of descriptor OSSL_PARAM(3), for parameters that OSSL_FUNC_store_set_ctx_params() can handle.
  • OSSL_FUNC_store_set_ctx_params() β€” should set additional parameters, such as what kind of data to expect, search criteria, and so on. more on those below, in "Load Parameters". whether unrecognised parameters are an error or simply ignored is at the implementation's discretion. passing NULL for params should return true.
  • OSSL_FUNC_store_load() β€” loads the next object from the URI opened by OSSL_FUNC_store_open(), creates an object abstraction for it (see provider-object(7)), and calls object_cb with it as well as object_cbarg. object_cb will then interpret the object abstraction and do what it can to wrap it or decode it into an OpenSSL structure. in case a passphrase needs to be prompted to unlock an object, pw_cb should be called.
  • OSSL_FUNC_store_eof() β€” indicates if the end of the set of objects from the URI has been reached. when that happens, there's no point trying to do any further loading.
  • OSSL_FUNC_store_close() β€” frees the provider side context ctx.

when a provider-native object is created by a store manager it would be unsuitable for direct use with a foreign provider. the export function allows for exporting the object to that foreign provider if the foreign provider supports the type of the object and provides an import function.

  • OSSL_FUNC_store_export_object() β€” should export the object of size objref_sz referenced by objref as an OSSL_PARAM(3) array and pass that to the export_cb as well as the given export_cbarg.
  • OSSL_FUNC_store_delete() β€” deletes the object identified by the uri. the implementation is entirely responsible for the interpretation of the URI. in case a passphrase needs to be prompted to remove an object, pw_cb should be called.
  • OSSL_FUNC_store_open_ex() β€” is an extended variant of OSSL_FUNC_store_open(). if the provider does not implement this function the code internally falls back to use the original OSSL_FUNC_store_open(). this variant additionally accepts an OSSL_PARAM(3) object and a pw_cb callback that can be used to request a passphrase in cases where the whole store needs to be unlocked before performing any load operation.

πŸ“ Load Parameters πŸ“

these are the params the store can vibe with, bestie:

  • "expect" (OSSL_STORE_PARAM_EXPECT) β€” <integer> β€” a hint of what type of data the OpenSSL library expects to get. this is only useful for optimization, as the library will check that the object types match the expectation too. the number that can be given through this parameter is found in <openssl/store.h>, with the macros having names starting with "OSSL_STORE_INFO_". these are further described in "SUPPORTED OBJECTS" in OSSL_STORE_INFO(3).
  • "subject" (OSSL_STORE_PARAM_SUBJECT) β€” <octet string> β€” indicates that the caller wants to search for an object with the given subject associated. this can be used to select specific certificates by subject. the contents of the octet string is expected to be in DER form.
  • "issuer" (OSSL_STORE_PARAM_ISSUER) β€” <octet string> β€” same energy but for issuer: indicates that the caller wants to search for an object with the given issuer associated. this can be used to select specific certificates by issuer. the contents of the octet string is expected to be in DER form.
  • "serial" (OSSL_STORE_PARAM_SERIAL) β€” <integer> β€” indicates that the caller wants to search for an object with the given serial number associated.
  • "digest" (OSSL_STORE_PARAM_DIGEST) β€” <UTF8 string> β€” says the caller wants to search for an object with the given fingerprint, computed with the given digest; this is the digest half of the combo.
  • "fingerprint" (OSSL_STORE_PARAM_FINGERPRINT) β€” <octet string> β€” the fingerprint half of that same search, computed with the given digest.
  • "alias" (OSSL_STORE_PARAM_ALIAS) β€” <UTF8 string> β€” indicates that the caller wants to search for an object with the given alias (some call it a "friendly name").
  • "properties" (OSSL_STORE_PARAM_PROPERTIES) β€” <utf8 string> β€” property string to use when querying for algorithms such as the OSSL_DECODER decoder implementations.
  • "input-type" (OSSL_STORE_PARAM_INPUT_TYPE) β€” <utf8 string> β€” type of the input format as a hint to use when decoding the objects in the store.

several of these search criteria may be combined. for example, to search for a certificate by issuer+serial, both the "issuer" and the "serial" parameters will be given.


🌸 SEE ALSO 🌸

provider(7) β€” that's it, that's the list. iconic minimalism.


⭐ HISTORY ⭐

  • the STORE interface was introduced in OpenSSL 3.0.
  • OSSL_FUNC_store_delete() callback was added in OpenSSL 3.2

Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


okay that's the whole page, bestie πŸ’… β€” this one's from OpenSSL 3.5.0, dated 2026-09-25, and its manual name is PROVIDER-STOREMGMT(7ossl). mwah 🫢

πŸ“¦ where this page comes from