OSSL_STORE_LOADER(3ossl)
π OSSL_STORE_LOADER β the whole entire vibe β¨
okay so bestie, this is the OSSL_STORE_LOADER(3ossl) page from OpenSSL, and it's literally the main character energy for STORE loaders. no cap. π
πΈ NAME πΈ
OSSL_STORE_LOADER, OSSL_STORE_LOADER_fetch, OSSL_STORE_LOADER_up_ref, OSSL_STORE_LOADER_free, OSSL_STORE_LOADER_get0_provider, OSSL_STORE_LOADER_get0_properties, OSSL_STORE_LOADER_is_a, OSSL_STORE_LOADER_get0_description, OSSL_STORE_LOADER_do_all_provided, OSSL_STORE_LOADER_names_do_all, OSSL_STORE_LOADER_CTX, OSSL_STORE_LOADER_new, OSSL_STORE_LOADER_get0_engine, OSSL_STORE_LOADER_get0_scheme, OSSL_STORE_LOADER_set_open, OSSL_STORE_LOADER_set_open_ex, OSSL_STORE_LOADER_set_attach, OSSL_STORE_LOADER_set_ctrl, OSSL_STORE_LOADER_set_expect, OSSL_STORE_LOADER_set_find, OSSL_STORE_LOADER_set_load, OSSL_STORE_LOADER_set_eof, OSSL_STORE_LOADER_set_error, OSSL_STORE_LOADER_set_close, OSSL_STORE_register_loader, OSSL_STORE_unregister_loader, OSSL_STORE_open_fn, OSSL_STORE_open_ex_fn, OSSL_STORE_attach_fn, OSSL_STORE_ctrl_fn, OSSL_STORE_expect_fn, OSSL_STORE_find_fn, OSSL_STORE_load_fn, OSSL_STORE_eof_fn, OSSL_STORE_error_fn, OSSL_STORE_close_fn β literally all the types and functions you need to manipulate, register, and unregister STORE loaders for all the different URI schemes. iykyk π
β¨ SYNOPSIS β¨
here's the whole lineup, bestie. copy-paste energy:
#include <openssl/store.h>
typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(OSSL_LIB_CTX *libctx,
const char *scheme,
const char *properties);
int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader);
void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader);
const OSSL_PROVIDER *OSSL_STORE_LOADER_get0_provider(const OSSL_STORE_LOADER *
loader);
const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader);
const char *OSSL_STORE_LOADER_get0_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,
void (*user_fn)(OSSL_STORE_LOADER *loader,
void *arg),
void *user_arg);
int OSSL_STORE_LOADER_names_do_all(const OSSL_STORE_LOADER *loader,
void (*fn)(const char *name, void *data),
void *data);
okay but like β heads up, the following functions have been deprecated since OpenSSL 3.0, and can be hidden entirely by defining OPENSSL_API_COMPAT with a suitable version value. see openssl_user_macros(7) for the deets. lowkey sad but we move π
OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER
*store_loader);
const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER
*store_loader);
/* struct ossl_store_loader_ctx_st is defined differently by each loader */
typedef struct ossl_store_loader_ctx_st OSSL_STORE_LOADER_CTX;
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_fn)(
const char *uri, const UI_METHOD *ui_method, void *ui_data);
int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_open_fn store_open_function);
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_ex_fn)(
const char *uri, const UI_METHOD *ui_method, void *ui_data);
int OSSL_STORE_LOADER_set_open_ex
(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_open_ex_fn store_open_ex_function);
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)
(const OSSL_STORE_LOADER *loader, BIO *bio,
OSSL_LIB_CTX *libctx, const char *propq,
const UI_METHOD *ui_method, void *ui_data);
int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader,
OSSL_STORE_attach_fn attach_function);
typedef int (*OSSL_STORE_ctrl_fn)(OSSL_STORE_LOADER_CTX *ctx, int cmd,
va_list args);
int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_ctrl_fn store_ctrl_function);
typedef int (*OSSL_STORE_expect_fn)(OSSL_STORE_LOADER_CTX *ctx, int expected);
int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader,
OSSL_STORE_expect_fn expect_function);
typedef int (*OSSL_STORE_find_fn)(OSSL_STORE_LOADER_CTX *ctx,
OSSL_STORE_SEARCH *criteria);
int OSSL_STORE_LOADER_set_find(OSSL_STORE_LOADER *loader,
OSSL_STORE_find_fn find_function);
typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)(OSSL_STORE_LOADER_CTX *ctx,
UI_METHOD *ui_method,
void *ui_data);
int OSSL_STORE_LOADER_set_load(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_load_fn store_load_function);
typedef int (*OSSL_STORE_eof_fn)(OSSL_STORE_LOADER_CTX *ctx);
int OSSL_STORE_LOADER_set_eof(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_eof_fn store_eof_function);
typedef int (*OSSL_STORE_error_fn)(OSSL_STORE_LOADER_CTX *ctx);
int OSSL_STORE_LOADER_set_error(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_error_fn store_error_function);
typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx);
int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *store_loader,
OSSL_STORE_close_fn store_close_function);
int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme);
π¦ DESCRIPTION π¦
okay so boom β these functions let you see and work with STORE loaders, which are the little legends that actually implement the STORE API so it can work with URIs of different schemes. it's giving behind-the-scenes crew that makes everything slay. we got the boring chapters (examining and maneuvring) and the main character part (creating and manipulating your own loader). periodt. π
the exported fetchers and loaders, bestie
OSSL_STORE_LOADER_fetch() fetches a STORE loader implementation from any provider that's been loaded into the OSSL_LIB_CTX that libctx points at, using a URI scheme as its name, and with the property query properties. like grabbing the right one for the job. β¨
`OSSL_STORE_LOADER_up_ref()` increments the reference count for a loader,
`OSSL_STORE_LOADER_free()` decrements it β and when it hits zero, the loader is done-zo.
OSSL_STORE_LOADER_get0_provider() returns the provider that this loader was fetched from. no cap, that's where it came from. π
OSSL_STORE_LOADER_get0_properties() returns the property definition associated with the loader. it's giving receipts.
OSSL_STORE_LOADER_is_a() checks if the loader's implementation name matches scheme β basically "are you who you say you are?" vibe check. π
OSSL_STORE_LOADER_get0_description() returns a human readable description of the loader, or NULL if there isn't one. nice-to-have, not must-have. π«Ά
OSSL_STORE_LOADER_do_all_provided() iterates over all loaders implemented by any activated provider, calling user_fn for each one, with the loader as the first argument and user_arg as the second. literal tour of the whole roster. π
OSSL_STORE_LOADER_names_do_all() iterates over all names that the loader has been given or can be fetched under, calling fn for each, with the name and data as args. slay names, slay vibes. β
the maneuvring functions (deprecated era, lowkey)
OSSL_STORE_LOADER_new() creates a new OSSL_STORE_LOADER, with the given ENGINE e and the given scheme name. the ENGINE is only used for the loader name. OSSL_STORE_LOADER_get0_engine() gets that engine. OSSL_STORE_LOADER_get0_scheme() gets the scheme name. all deprecated, all still documented for the culture. π
how each function gets set (the deprecation era continues)
OSSL_STORE_LOADER_set_open()sets the function the loader can use to start a new operation stream (open).OSSL_STORE_LOADER_set_open_ex()does the same, but it's literally the same prototype asOSSL_STORE_open_fn, so ngl bestie, kinda sus it exists at all. but there it is.OSSL_STORE_LOADER_set_attach()sets the function that attaches the loader to aBIO. once set, you can't set it again. one and done. πOSSL_STORE_LOADER_set_ctrl()sets the function that can accept commands (control interface).OSSL_STORE_LOADER_set_expect()sets the function that can say "okay, I only care about this kind of stuff" (expect).OSSL_STORE_LOADER_set_find()sets the function that can find specific objects (OSSL_STORE_SEARCH).OSSL_STORE_LOADER_set_load()sets the function that actually loads your data.OSSL_STORE_LOADER_set_eof()sets the function that tells you when you've hit the end.OSSL_STORE_LOADER_set_error()sets the function that checks for an outstanding error on the context.OSSL_STORE_LOADER_set_close()sets the function that closes the loader's context.
yeah bestie, it's a lot of setters, but they all matter β and you can only set each one once. don't try to double up. π
the context types and callbacks, because besties need types
OSSL_STORE_LOADER_CTX is a type that's defined per loader β the docs literally say "struct ossl_store_loader_ctx_st is defined differently by each loader." so it's giving customizable, main character, yours-to-shape energy. π§
OSSL_STORE_open_fn and OSSL_STORE_open_ex_fn take a URI, a UI_METHOD pointer, and a void pointer to UI data, and return an OSSL_STORE_LOADER_CTX *. basically "start me up." π
OSSL_STORE_attach_fn takes the loader itself, a BIO *, a OSSL_LIB_CTX *, a propq, a UI_METHOD, and UI data β and returns the context. attach energy.
OSSL_STORE_ctrl_fn takes a context, an int cmd, and a va_list args β returns int. this is where commands get handled.
OSSL_STORE_expect_fn takes a context and the int expected β returns int. expectation setting, very boundary queen.
OSSL_STORE_find_fn takes a context and an OSSL_STORE_SEARCH *criteria β returns int. finding exactly what you came for. π₯
OSSL_STORE_load_fn takes a context, a UI_METHOD *, and UI data β returns an OSSL_STORE_INFO *. the actual loading, iconic.
OSSL_STORE_eof_fn is a context in, int out β checks if you're at the end. no cap.
OSSL_STORE_error_fn is a context in, int out β checks for an error. because sometimes things go π.
OSSL_STORE_close_fn is a context in, int out β closes the context. clean exit, bestie. πΈ
register and unregister (the deprecated glue)
OSSL_STORE_register_loader() registers the given loader β stored for future reference. and OSSL_STORE_unregister_loader() takes a scheme name and unregisters (and pops off) the loader associated with it. bay goodbye to that scheme! π
okay bestie, that's part one β go forth and maneuvre some storage. more coming! πβ¨
πΎ DESCRIPTION πΎ
okay so OSSL_STORE_LOADER is the method for OSSL_STORE loaders β the little implementation crew that makes OSSL_STORE_open(), OSSL_STORE_open_ex(), OSSL_STORE_load(), OSSL_STORE_eof(), OSSL_STORE_error() and OSSL_STORE_close() work for specific storage schemes. π
Meet the provider-side functions:
OSSL_STORE_LOADER_fetch()β looks for an implementation for a storage scheme within the providers that has been loaded into theOSSL_LIB_CTXgiven bylibctx, and with the properties given byproperties. β¨OSSL_STORE_LOADER_up_ref()β increments the reference count for the given loader. π«ΆOSSL_STORE_LOADER_free()β decrements the reference count for the given loader, and when the count reaches zero, frees it. If the argument isNULL, nothing is done. πOSSL_STORE_LOADER_get0_provider()β returns the provider of the given loader. πOSSL_STORE_LOADER_get0_properties()β returns the property definition associated with the given loader. πOSSL_STORE_LOADER_is_a()β checks ifloaderis an implementation of an algorithm thatβs identifiable withscheme. π₯OSSL_STORE_LOADER_get0_description()β returns a description of the loader, meant for display and human consumption. The description is at the discretion of the loader implementation. πΈOSSL_STORE_LOADER_do_all_provided()β traverses all store implementations by all activated providers in the library contextlibctx, and for each of the implementations, callsuser_fnwith the implementation method anduser_argas arguments. π¦OSSL_STORE_LOADER_names_do_all()β traverses all names for the given loader, and callsfnwith each name anddata. π
π§Έ Legacy Types and Functions (deprecated) π§Έ
These functions help applications and engines to create loaders for schemes they support. These are all deprecated and discouraged in favour of provider implementations, see provider-storemgmt(7). periodt β the provider route is the main character here. π
OSSL_STORE_LOADER_CTXβ is a type template, to be defined by each loader using"struct ossl_store_loader_ctx_st { ... }". π§OSSL_STORE_open_fn,OSSL_STORE_open_ex_fn,OSSL_STORE_ctrl_fn,OSSL_STORE_expect_fn,OSSL_STORE_find_fn,OSSL_STORE_load_fn,OSSL_STORE_eof_fn, andOSSL_STORE_close_fnβ are the function pointer types used within a STORE loader. The functions pointed at define the functionality of the given loader. π
πͺ The legacy function-pointer squad
OSSL_STORE_open_fnandOSSL_STORE_open_ex_fnβOSSL_STORE_open_ex_fntakes a URI and is expected to interpret it in the best manner possible according to the scheme the loader implements. It also takes aUI_METHODand associated data, to be used any time something needs to be prompted for, as well as a library contextlibctxwith an associated property querypropq, to be used when fetching necessary algorithms to perform the loads. Furthermore, this function is expected to initialize what needs to be initialized, to create a private data store (OSSL_STORE_LOADER_CTX, see above), and to return it. If something goes wrong, this function is expected to returnNULL. π
OSSL_STORE_open_fn does the same thing as OSSL_STORE_open_ex_fn but uses NULL for the library context libctx and property query propq. π«Ά
OSSL_STORE_attach_fnβ this function takes aBIO, otherwise works likeOSSL_STORE_open_ex_fn. πOSSL_STORE_ctrl_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer, a command numbercmdand ava_listargsand is used to manipulate loader specific parameters. π
Loader specific command numbers must begin at OSSL_STORE_C_CUSTOM_START. Any number below that is reserved for future globally known command numbers.
This function is expected to return 1 on success, 0 on error. β
OSSL_STORE_expect_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer and aOSSL_STORE_INFOidentityexpected, and is used to tell the loader what object type is expected.expectedmay be zero to signify that no specific object type is expected. π¦
This function is expected to return 1 on success, 0 on error. πΈ
OSSL_STORE_find_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer and aOSSL_STORE_SEARCHsearch criterion, and is used to tell the loader what to search for. π
When called with the loader context being NULL, this function is expected to return 1 if the loader supports the criterion, otherwise 0. π
When called with the loader context being something other than NULL, this function is expected to return 1 on success, 0 on error. π
OSSL_STORE_load_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer and aUI_METHODwith associated data. Itβs expected to load the next available data, mold it into a data structure that can be wrapped in aOSSL_STORE_INFOusing one of theOSSL_STORE_INFO(3)functions. If no more data is available or an error occurs, this function is expected to returnNULL. TheOSSL_STORE_eof_fnandOSSL_STORE_error_fnfunctions must indicate if it was in fact the end of data or if an error occurred. π
Note that this function retrieves one data item only. βοΈ
OSSL_STORE_eof_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer and is expected to return1to indicate that the end of available data has been reached. It is otherwise expected to return0. πOSSL_STORE_error_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer and is expected to return1to indicate that an error occurred in a previous call to theOSSL_STORE_load_fnfunction. It is otherwise expected to return0. πOSSL_STORE_close_fnβ this function takes aOSSL_STORE_LOADER_CTXpointer and is expected to close or shut down what needs to be closed, and finally free the contents of theOSSL_STORE_LOADER_CTXpointer. It returns1on success and0on error. π«Ά
π οΈ Legacy loader-building bits
OSSL_STORE_LOADER_new()β creates a newOSSL_STORE_LOADER. It takes anENGINEeand a stringscheme.schememust always be set. Botheandschemeare used as is and must therefore be alive as long as the created loader is. π₯OSSL_STORE_LOADER_get0_engine()β returns the engine of thestore_loader.OSSL_STORE_LOADER_get0_scheme()β returns the scheme of thestore_loader. πOSSL_STORE_LOADER_set_open()β sets the opener function for thestore_loader. πOSSL_STORE_LOADER_set_open_ex()β sets the opener with library context function for thestore_loader. β¨OSSL_STORE_LOADER_set_attach()β sets the attacher function for thestore_loader. π¦OSSL_STORE_LOADER_set_ctrl()β sets the control function for thestore_loader. πOSSL_STORE_LOADER_set_expect()β sets the expect function for thestore_loader. πΈOSSL_STORE_LOADER_set_load()β sets the loader function for thestore_loader. πOSSL_STORE_LOADER_set_eof()β sets the end of file checker function for thestore_loader. πOSSL_STORE_LOADER_set_close()β sets the closing function for thestore_loader. π«ΆOSSL_STORE_LOADER_free()β frees the givenstore_loader. If the argument isNULL, nothing is done. πOSSL_STORE_register_loader()β register the givenstore_loaderand thereby makes it available for use withOSSL_STORE_open(),OSSL_STORE_open_ex(),OSSL_STORE_load(),OSSL_STORE_eof()andOSSL_STORE_close(). πOSSL_STORE_unregister_loader()β unregister the store loader for the givenscheme. π
π RETURN VALUES π
OSSL_STORE_LOADER_fetch()β returns a pointer to anOSSL_STORE_LOADERobject, orNULLon error. πOSSL_STORE_LOADER_up_ref()β returns1on success, or0on error. π«ΆOSSL_STORE_LOADER_names_do_all()β returns1if the callback was called for all names. A return value of0means that the callback was not called for any names. πOSSL_STORE_LOADER_free()β doesnβt return any value. πOSSL_STORE_LOADER_get0_provider()β returns a pointer to a provider object, orNULLon error. πOSSL_STORE_LOADER_get0_properties()β returns a pointer to a property definition string, orNULLon error. β¨OSSL_STORE_LOADER_is_a()β returns1ifloaderwas identifiable, otherwise0. π₯OSSL_STORE_LOADER_get0_description()β returns a pointer to a description, orNULLif there isnβt one. πΈ
The functions with the types OSSL_STORE_open_fn, OSSL_STORE_open_ex_fn, OSSL_STORE_ctrl_fn, OSSL_STORE_expect_fn, OSSL_STORE_load_fn, OSSL_STORE_eof_fn and OSSL_STORE_close_fn have the same return values as OSSL_STORE_open(), OSSL_STORE_open_ex(), OSSL_STORE_ctrl(), OSSL_STORE_expect(), OSSL_STORE_load(), OSSL_STORE_eof() and OSSL_STORE_close(), respectively. π«Ά
OSSL_STORE_LOADER_new()β returns a pointer to aOSSL_STORE_LOADERon success, orNULLon failure. πOSSL_STORE_LOADER_set_open(),OSSL_STORE_LOADER_set_open_ex(),OSSL_STORE_LOADER_set_ctrl(),OSSL_STORE_LOADER_set_load(),OSSL_STORE_LOADER_set_eof()andOSSL_STORE_LOADER_set_close()β return1on success, or0on failure. πOSSL_STORE_register_loader()β returns1on success, or0on failure. πOSSL_STORE_unregister_loader()β returns the unregistered loader on success, orNULLon failure. π
π SEE ALSO π
π°οΈ HISTORY π°οΈ
OSSL_STORE_LOADER_fetch(),OSSL_STORE_LOADER_up_ref(),OSSL_STORE_LOADER_get0_provider(),OSSL_STORE_LOADER_get0_properties(),OSSL_STORE_LOADER_get0_description(),OSSL_STORE_LOADER_is_a(),OSSL_STORE_LOADER_do_all_provided()andOSSL_STORE_LOADER_names_do_all()were added in OpenSSL 3.0. β¨OSSL_STORE_LOADERandOSSL_STORE_LOADER_free()were added in OpenSSL 1.1.1. π§OSSL_STORE_LOADER_set_open_ex()andOSSL_STORE_open_ex_fn()were added in OpenSSL 3.0, and are deprecated. πOSSL_STORE_LOADER_CTX,OSSL_STORE_LOADER_new(),OSSL_STORE_LOADER_set0_scheme(),OSSL_STORE_LOADER_get0_scheme(),OSSL_STORE_LOADER_get0_engine(),OSSL_STORE_LOADER_set_expect(),OSSL_STORE_LOADER_set_find(),OSSL_STORE_LOADER_set_attach(),OSSL_STORE_LOADER_set_open_ex(),OSSL_STORE_LOADER_set_open(),OSSL_STORE_LOADER_set_ctrl(),OSSL_STORE_LOADER_set_load(),OSSL_STORE_LOADER_set_eof(),OSSL_STORE_LOADER_set_close(),OSSL_STORE_register_loader(),OSSL_STORE_LOADER_set_error(),OSSL_STORE_unregister_loader(),OSSL_STORE_open_fn(),OSSL_STORE_ctrl_fn(),OSSL_STORE_load_fn(),OSSL_STORE_eof_fn()andOSSL_STORE_close_fn()were added in OpenSSL 1.1.1, and became deprecated in OpenSSL 3.0. π
π COPYRIGHT π
Copyright 2016-2024 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>. π
π
thatβs the whole page, bestie β itβs from OpenSSL 3.5.0, dated 2026-09-25, and yes the page is OSSL_STORE_LOADER(3ossl). stay slay, and may your loaders always up_ref() correctly. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms