1b077aed3SPierre Pronchery=pod 2b077aed3SPierre Pronchery 3b077aed3SPierre Pronchery=head1 NAME 4b077aed3SPierre Pronchery 5b077aed3SPierre Proncheryossl_provider_find, ossl_provider_new, ossl_provider_up_ref, 6b077aed3SPierre Proncheryossl_provider_free, 7b077aed3SPierre Proncheryossl_provider_set_fallback, ossl_provider_set_module_path, 8b077aed3SPierre Proncheryossl_provider_add_parameter, ossl_provider_set_child, ossl_provider_get_parent, 9b077aed3SPierre Proncheryossl_provider_up_ref_parent, ossl_provider_free_parent, 10b077aed3SPierre Proncheryossl_provider_default_props_update, ossl_provider_get0_dispatch, 11b077aed3SPierre Proncheryossl_provider_init_as_child, ossl_provider_deinit_child, 12b077aed3SPierre Proncheryossl_provider_activate, ossl_provider_deactivate, ossl_provider_add_to_store, 13b077aed3SPierre Proncheryossl_provider_ctx, 14b077aed3SPierre Proncheryossl_provider_doall_activated, 15b077aed3SPierre Proncheryossl_provider_name, ossl_provider_dso, 16b077aed3SPierre Proncheryossl_provider_module_name, ossl_provider_module_path, 17b077aed3SPierre Proncheryossl_provider_libctx, 18b077aed3SPierre Proncheryossl_provider_teardown, ossl_provider_gettable_params, 19b077aed3SPierre Proncheryossl_provider_get_params, 20b077aed3SPierre Proncheryossl_provider_query_operation, ossl_provider_unquery_operation, 21b077aed3SPierre Proncheryossl_provider_set_operation_bit, ossl_provider_test_operation_bit, 22b077aed3SPierre Proncheryossl_provider_get_capabilities 23b077aed3SPierre Pronchery- internal provider routines 24b077aed3SPierre Pronchery 25b077aed3SPierre Pronchery=head1 SYNOPSIS 26b077aed3SPierre Pronchery 27b077aed3SPierre Pronchery #include "internal/provider.h" 28b077aed3SPierre Pronchery 29b077aed3SPierre Pronchery OSSL_PROVIDER *ossl_provider_find(OSSL_LIB_CTX *libctx, const char *name, 30b077aed3SPierre Pronchery int noconfig); 31b077aed3SPierre Pronchery OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name, 32b077aed3SPierre Pronchery ossl_provider_init_fn *init_function 33b077aed3SPierre Pronchery int noconfig); 34b077aed3SPierre Pronchery int ossl_provider_up_ref(OSSL_PROVIDER *prov); 35b077aed3SPierre Pronchery void ossl_provider_free(OSSL_PROVIDER *prov); 36b077aed3SPierre Pronchery 37b077aed3SPierre Pronchery /* Setters */ 38b077aed3SPierre Pronchery int ossl_provider_set_fallback(OSSL_PROVIDER *prov); 39b077aed3SPierre Pronchery int ossl_provider_set_module_path(OSSL_PROVIDER *prov, const char *path); 40b077aed3SPierre Pronchery int ossl_provider_add_parameter(OSSL_PROVIDER *prov, const char *name, 41b077aed3SPierre Pronchery const char *value); 42b077aed3SPierre Pronchery 43b077aed3SPierre Pronchery /* Child Providers */ 44b077aed3SPierre Pronchery int ossl_provider_set_child(OSSL_PROVIDER *prov, 45b077aed3SPierre Pronchery const OSSL_CORE_HANDLE *handle); 46b077aed3SPierre Pronchery const OSSL_CORE_HANDLE *ossl_provider_get_parent(OSSL_PROVIDER *prov); 47b077aed3SPierre Pronchery int ossl_provider_up_ref_parent(OSSL_PROVIDER *prov, int activate); 48b077aed3SPierre Pronchery int ossl_provider_free_parent(OSSL_PROVIDER *prov, int deactivate); 49b077aed3SPierre Pronchery int ossl_provider_default_props_update(OSSL_LIB_CTX *libctx, 50b077aed3SPierre Pronchery const char *props); 51b077aed3SPierre Pronchery 52b077aed3SPierre Pronchery /* 53b077aed3SPierre Pronchery * Activate the Provider 54b077aed3SPierre Pronchery * If the Provider is a module, the module will be loaded 55b077aed3SPierre Pronchery */ 56b077aed3SPierre Pronchery int ossl_provider_activate(OSSL_PROVIDER *prov, int upcalls, int aschild); 57b077aed3SPierre Pronchery int ossl_provider_deactivate(OSSL_PROVIDER *prov, int removechildren); 58b077aed3SPierre Pronchery int ossl_provider_add_to_store(OSSL_PROVIDER *prov, OSSL_PROVIDER **actualprov, 59b077aed3SPierre Pronchery int retain_fallbacks); 60b077aed3SPierre Pronchery 61b077aed3SPierre Pronchery /* Return pointer to the provider's context */ 62b077aed3SPierre Pronchery void *ossl_provider_ctx(const OSSL_PROVIDER *prov); 63b077aed3SPierre Pronchery 64b077aed3SPierre Pronchery const OSSL_DISPATCH *ossl_provider_get0_dispatch(const OSSL_PROVIDER *prov); 65b077aed3SPierre Pronchery 66b077aed3SPierre Pronchery /* Iterate over all loaded providers */ 67b077aed3SPierre Pronchery int ossl_provider_doall_activated(OSSL_LIB_CTX *, 68b077aed3SPierre Pronchery int (*cb)(OSSL_PROVIDER *provider, 69b077aed3SPierre Pronchery void *cbdata), 70b077aed3SPierre Pronchery void *cbdata); 71b077aed3SPierre Pronchery 72b077aed3SPierre Pronchery /* Getters for other library functions */ 73b077aed3SPierre Pronchery const char *ossl_provider_name(OSSL_PROVIDER *prov); 74b077aed3SPierre Pronchery const DSO *ossl_provider_dso(OSSL_PROVIDER *prov); 75b077aed3SPierre Pronchery const char *ossl_provider_module_name(OSSL_PROVIDER *prov); 76b077aed3SPierre Pronchery const char *ossl_provider_module_path(OSSL_PROVIDER *prov); 77b077aed3SPierre Pronchery OSSL_LIB_CTX *ossl_provider_libctx(const OSSL_PROVIDER *prov); 78b077aed3SPierre Pronchery 79b077aed3SPierre Pronchery /* Thin wrappers around calls to the provider */ 80b077aed3SPierre Pronchery void ossl_provider_teardown(const OSSL_PROVIDER *prov); 81b077aed3SPierre Pronchery const OSSL_PARAM *ossl_provider_gettable_params(const OSSL_PROVIDER *prov); 82b077aed3SPierre Pronchery int ossl_provider_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]); 83b077aed3SPierre Pronchery int ossl_provider_get_capabilities(const OSSL_PROVIDER *prov, 84b077aed3SPierre Pronchery const char *capability, 85b077aed3SPierre Pronchery OSSL_CALLBACK *cb, 86b077aed3SPierre Pronchery void *arg); 87b077aed3SPierre Pronchery const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov, 88b077aed3SPierre Pronchery int operation_id, 89b077aed3SPierre Pronchery int *no_cache); 90b077aed3SPierre Pronchery void ossl_provider_unquery_operation(const OSSL_PROVIDER *prov, 91b077aed3SPierre Pronchery int operation_id, 92b077aed3SPierre Pronchery const OSSL_ALGORITHM *algs); 93b077aed3SPierre Pronchery 94b077aed3SPierre Pronchery int ossl_provider_set_operation_bit(OSSL_PROVIDER *provider, size_t bitnum); 95b077aed3SPierre Pronchery int ossl_provider_test_operation_bit(OSSL_PROVIDER *provider, size_t bitnum, 96b077aed3SPierre Pronchery int *result); 97b077aed3SPierre Pronchery 98b077aed3SPierre Pronchery int ossl_provider_init_as_child(OSSL_LIB_CTX *ctx, 99b077aed3SPierre Pronchery const OSSL_CORE_HANDLE *handle, 100b077aed3SPierre Pronchery const OSSL_DISPATCH *in); 101b077aed3SPierre Pronchery void ossl_provider_deinit_child(OSSL_LIB_CTX *ctx); 102b077aed3SPierre Pronchery 103b077aed3SPierre Pronchery=head1 DESCRIPTION 104b077aed3SPierre Pronchery 105b077aed3SPierre ProncheryI<OSSL_PROVIDER> is a type that holds all the necessary information 106b077aed3SPierre Proncheryto handle a provider, regardless of if it's built in to the 107b077aed3SPierre Proncheryapplication or the OpenSSL libraries, or if it's a loadable provider 108b077aed3SPierre Proncherymodule. 109b077aed3SPierre ProncheryInstances of this type are commonly referred to as "provider objects". 110b077aed3SPierre Pronchery 111b077aed3SPierre ProncheryA provider object is always stored in a set of provider objects 112b077aed3SPierre Proncheryin the library context. 113b077aed3SPierre Pronchery 114b077aed3SPierre ProncheryProvider objects are reference counted. 115b077aed3SPierre Pronchery 116b077aed3SPierre ProncheryProvider objects are initially inactive, i.e. they are only recorded 117b077aed3SPierre Proncheryin the store, but are not used. 118b077aed3SPierre ProncheryThey are activated with the first call to ossl_provider_activate(), 119b077aed3SPierre Proncheryand are deactivated with the last call to ossl_provider_deactivate(). 120b077aed3SPierre ProncheryActivation affects a separate counter. 121b077aed3SPierre Pronchery 122b077aed3SPierre Pronchery=head2 Functions 123b077aed3SPierre Pronchery 124b077aed3SPierre Proncheryossl_provider_find() finds an existing provider object in the provider 125b077aed3SPierre Proncheryobject store by I<name>. 126b077aed3SPierre ProncheryThe config file will be automatically loaded unless I<noconfig> is set. 127b077aed3SPierre ProncheryTypically I<noconfig> should be 0. 128b077aed3SPierre ProncheryWe set I<noconfig> to 1 only when calling these functions while processing a 129b077aed3SPierre Proncheryconfig file in order to avoid recursively attempting to load the file. 130b077aed3SPierre ProncheryThe provider object it finds has its reference count incremented. 131b077aed3SPierre Pronchery 132b077aed3SPierre Proncheryossl_provider_new() creates a new provider object named I<name> and 133b077aed3SPierre Proncherystores it in the provider object store, unless there already is one 134b077aed3SPierre Proncherythere with the same name. 135b077aed3SPierre ProncheryIf there already is one with the same name, it's returned with its 136b077aed3SPierre Proncheryreference count incremented. 137b077aed3SPierre ProncheryThe config file will be automatically loaded unless I<noconfig> is set. 138b077aed3SPierre ProncheryTypically I<noconfig> should be 0. 139b077aed3SPierre ProncheryWe set I<noconfig> to 1 only when calling these functions while processing a 140b077aed3SPierre Proncheryconfig file in order to avoid recursively attempting to load the file. 141b077aed3SPierre ProncheryThe reference count of a newly created provider object will always 142b077aed3SPierre Proncherybe 2; one for being added to the store, and one for the returned 143b077aed3SPierre Proncheryreference. 144b077aed3SPierre ProncheryIf I<init_function> is NULL, the provider is assumed to be a 145b077aed3SPierre Proncherydynamically loadable module, with the symbol B<OSSL_provider_init> as 146b077aed3SPierre Proncheryits initialisation function. 147b077aed3SPierre ProncheryIf I<init_function> isn't NULL, the provider is assumed to be built 148b077aed3SPierre Proncheryin, with I<init_function> being the pointer to its initialisation 149b077aed3SPierre Proncheryfunction. 150b077aed3SPierre ProncheryFor further description of the initialisation function, see the 151b077aed3SPierre Proncherydescription of ossl_provider_activate() below. 152b077aed3SPierre Pronchery 153b077aed3SPierre Proncheryossl_provider_up_ref() increments the provider object I<prov>'s 154b077aed3SPierre Proncheryreference count. 155b077aed3SPierre Pronchery 156b077aed3SPierre Proncheryossl_provider_free() decrements the provider object I<prov>'s 157b077aed3SPierre Proncheryreference count; when it drops to zero, the provider object is assumed 158b077aed3SPierre Proncheryto have fallen out of use and will be deinitialized (its I<teardown> 159b077aed3SPierre Proncheryfunction is called), and the associated module will be unloaded if one 160b077aed3SPierre Proncherywas loaded, and I<prov> itself will be freed. 161b077aed3SPierre Pronchery 162b077aed3SPierre Proncheryossl_provider_set_fallback() marks an available provider I<prov> as 163b077aed3SPierre Proncheryfallback. 164b077aed3SPierre ProncheryNote that after this call, the provider object pointer that was 165b077aed3SPierre Proncheryused can simply be dropped, but not freed. 166b077aed3SPierre Pronchery 167b077aed3SPierre Proncheryossl_provider_set_module_path() sets the module path to load the 168b077aed3SPierre Proncheryprovider module given the provider object I<prov>. 169b077aed3SPierre ProncheryThis will be used in preference to automatically trying to figure out 170b077aed3SPierre Proncherythe path from the provider name and the default module directory (more 171b077aed3SPierre Proncheryon this in L</NOTES>). 172b077aed3SPierre Pronchery 173b077aed3SPierre Proncheryossl_provider_libctx() returns the library context the given 174b077aed3SPierre Proncheryprovider I<prov> is registered in. 175b077aed3SPierre Pronchery 176b077aed3SPierre Proncheryossl_provider_add_parameter() adds a global parameter for the provider 177b077aed3SPierre Proncheryto retrieve as it sees fit. 178b077aed3SPierre ProncheryThe parameters are a combination of I<name> and I<value>, and the 179b077aed3SPierre Proncheryprovider will use the name to find the value it wants. 180b077aed3SPierre ProncheryOnly text parameters can be given, and it's up to the provider to 181b077aed3SPierre Proncheryinterpret them. 182b077aed3SPierre Pronchery 183b077aed3SPierre Proncheryossl_provider_set_child() marks this provider as a child of a provider in the 184b077aed3SPierre Proncheryparent library context. I<handle> is the B<OSSL_CORE_HANDLE> object passed to 185b077aed3SPierre Proncherythe provider's B<OSSL_provider_init> function. 186b077aed3SPierre Pronchery 187b077aed3SPierre Proncheryossl_provider_get_parent() obtains the handle on the parent provider. 188b077aed3SPierre Pronchery 189b077aed3SPierre Proncheryossl_provider_up_ref_parent() increases the reference count on the parent 190b077aed3SPierre Proncheryprovider. If I<activate> is nonzero then the parent provider is also activated. 191b077aed3SPierre Pronchery 192b077aed3SPierre Proncheryossl_provider_free_parent() decreases the reference count on the parent 193b077aed3SPierre Proncheryprovider. If I<deactivate> is nonzero then the parent provider is also 194b077aed3SPierre Proncherydeactivated. 195b077aed3SPierre Pronchery 196b077aed3SPierre Proncheryossl_provider_default_props_update() is responsible for informing any child 197b077aed3SPierre Proncheryproviders of an update to the default properties. The new properties are 198b077aed3SPierre Proncherysupplied in the I<props> string. 199b077aed3SPierre Pronchery 200b077aed3SPierre Proncheryossl_provider_activate() "activates" the provider for the given 201b077aed3SPierre Proncheryprovider object I<prov> by incrementing its activation count, flagging 202b077aed3SPierre Proncheryit as activated, and initializing it if it isn't already initialized. 203b077aed3SPierre ProncheryInitializing means one of the following: 204b077aed3SPierre Pronchery 205b077aed3SPierre Pronchery=over 4 206b077aed3SPierre Pronchery 207b077aed3SPierre Pronchery=item * 208b077aed3SPierre Pronchery 209b077aed3SPierre ProncheryIf an initialization function was given with ossl_provider_new(), that 210b077aed3SPierre Proncheryfunction will get called. 211b077aed3SPierre Pronchery 212b077aed3SPierre Pronchery=item * 213b077aed3SPierre Pronchery 214b077aed3SPierre ProncheryIf no initialization function was given with ossl_provider_new(), a 215b077aed3SPierre Proncheryloadable module with the I<name> that was given to ossl_provider_new() 216b077aed3SPierre Proncherywill be located and loaded, then the symbol B<OSSL_provider_init> will 217b077aed3SPierre Proncherybe located in that module, and called. 218b077aed3SPierre Pronchery 219b077aed3SPierre Pronchery=back 220b077aed3SPierre Pronchery 221b077aed3SPierre ProncheryIf I<upcalls> is nonzero then, if this is a child provider, upcalls to the 222b077aed3SPierre Proncheryparent libctx will be made to inform it of an up-ref. If I<aschild> is nonzero 223b077aed3SPierre Proncherythen the provider will only be activated if it is a child provider. Otherwise 224b077aed3SPierre Proncheryno action is taken and ossl_provider_activate() returns success. 225b077aed3SPierre Pronchery 226b077aed3SPierre Proncheryossl_provider_deactivate() "deactivates" the provider for the given 227b077aed3SPierre Proncheryprovider object I<prov> by decrementing its activation count. When 228b077aed3SPierre Proncherythat count reaches zero, the activation flag is cleared. If the 229b077aed3SPierre ProncheryI<removechildren> parameter is 0 then no attempt is made to remove any 230b077aed3SPierre Proncheryassociated child providers. 231b077aed3SPierre Pronchery 232b077aed3SPierre Proncheryossl_provider_add_to_store() adds the provider I<prov> to the provider store and 233b077aed3SPierre Proncherymakes it available to other threads. This will prevent future automatic loading 234b077aed3SPierre Proncheryof fallback providers, unless I<retain_fallbacks> is true. If a provider of the 235b077aed3SPierre Proncherysame name already exists in the store then it is not added but this function 236b077aed3SPierre Proncherystill returns success. On success the I<actualprov> value is populated with a 237b077aed3SPierre Proncherypointer to the provider of the given name that is now in the store. The 238b077aed3SPierre Proncheryreference passed in the I<prov> argument is consumed by this function. A 239b077aed3SPierre Proncheryreference to the provider that should be used is passed back in the 240b077aed3SPierre ProncheryI<actualprov> argument. 241b077aed3SPierre Pronchery 242b077aed3SPierre Proncheryossl_provider_ctx() returns a context created by the provider. 243b077aed3SPierre ProncheryOutside of the provider, it's completely opaque, but it needs to be 244b077aed3SPierre Proncherypassed back to some of the provider functions. 245b077aed3SPierre Pronchery 246b077aed3SPierre Proncheryossl_provider_get0_dispatch() returns the dispatch table that the provider 247b077aed3SPierre Proncheryinitially returned in the I<out> parameter of its B<OSSL_provider_init> 248b077aed3SPierre Proncheryfunction. 249b077aed3SPierre Pronchery 250b077aed3SPierre Proncheryossl_provider_doall_activated() iterates over all the currently 251b077aed3SPierre Pronchery"activated" providers, and calls I<cb> for each of them. 252b077aed3SPierre ProncheryIf no providers have been "activated" yet, it tries to activate all 253b077aed3SPierre Proncheryavailable fallback providers before iterating over them. 254b077aed3SPierre Pronchery 255b077aed3SPierre Proncheryossl_provider_name() returns the name that was given with 256b077aed3SPierre Proncheryossl_provider_new(). 257b077aed3SPierre Pronchery 258b077aed3SPierre Proncheryossl_provider_dso() returns a reference to the module, for providers 259b077aed3SPierre Proncherythat come in the form of loadable modules. 260b077aed3SPierre Pronchery 261b077aed3SPierre Proncheryossl_provider_module_name() returns the filename of the module, for 262b077aed3SPierre Proncheryproviders that come in the form of loadable modules. 263b077aed3SPierre Pronchery 264b077aed3SPierre Proncheryossl_provider_module_path() returns the full path of the module file, 265b077aed3SPierre Proncheryfor providers that come in the form of loadable modules. 266b077aed3SPierre Pronchery 267b077aed3SPierre Proncheryossl_provider_teardown() calls the provider's I<teardown> function, if 268b077aed3SPierre Proncherythe provider has one. 269b077aed3SPierre Pronchery 270b077aed3SPierre Proncheryossl_provider_gettable_params() calls the provider's I<gettable_params> 271b077aed3SPierre Proncheryfunction, if the provider has one. 272b077aed3SPierre ProncheryIt should return an array of I<OSSL_PARAM> to describe all the 273b077aed3SPierre Proncheryparameters that the provider has for the provider object. 274b077aed3SPierre Pronchery 275b077aed3SPierre Proncheryossl_provider_get_params() calls the provider's parameter request 276b077aed3SPierre Proncheryresponder. 277b077aed3SPierre ProncheryIt should treat the given I<OSSL_PARAM> array as described in 278b077aed3SPierre ProncheryL<OSSL_PARAM(3)>. 279b077aed3SPierre Pronchery 280b077aed3SPierre Proncheryossl_provider_get_capabilities() calls the provider's I<get_capabilities> function, 281b077aed3SPierre Proncheryif the provider has one. It provides the name of the I<capability> and a 282b077aed3SPierre Proncherycallback I<cb> parameter to call for each capability that has a matching name in 283b077aed3SPierre Proncherythe provider. The callback gets passed OSSL_PARAM details about the capability as 284b077aed3SPierre Proncherywell as the caller supplied argument I<arg>. 285b077aed3SPierre Pronchery 286b077aed3SPierre Proncheryossl_provider_query_operation() calls the provider's 287b077aed3SPierre ProncheryI<query_operation> function, if the provider has one. 288b077aed3SPierre ProncheryIt should return an array of I<OSSL_ALGORITHM> for the given 289b077aed3SPierre ProncheryI<operation_id>. 290b077aed3SPierre Pronchery 291b077aed3SPierre Proncheryossl_provider_unquery_operation() informs the provider that the result of 292b077aed3SPierre Proncheryossl_provider_query_operation() is no longer going to be directly accessed and 293b077aed3SPierre Proncherythat all relevant information has been copied. 294b077aed3SPierre Pronchery 295b077aed3SPierre Proncheryossl_provider_set_operation_bit() registers a 1 for operation I<bitnum> 296b077aed3SPierre Proncheryin a bitstring that's internal to I<provider>. 297b077aed3SPierre Pronchery 298b077aed3SPierre Proncheryossl_provider_test_operation_bit() checks if the bit operation I<bitnum> 299b077aed3SPierre Proncheryis set (1) or not (0) in the internal I<provider> bitstring, and sets 300*44096ebdSEnji CooperI<*result> to 1 or 0 accordingly. 301b077aed3SPierre Pronchery 302b077aed3SPierre Proncheryossl_provider_init_as_child() stores in the library context I<ctx> references to 303b077aed3SPierre Proncherythe necessary upcalls for managing child providers. The I<handle> and I<in> 304b077aed3SPierre Proncheryparameters are the B<OSSL_CORE_HANDLE> and L<OSSL_DISPATCH(3)> pointers that were 305b077aed3SPierre Proncherypassed to the provider's B<OSSL_provider_init> function. 306b077aed3SPierre Pronchery 307b077aed3SPierre Proncheryossl_provider_deinit_child() deregisters callbacks from the parent library 308b077aed3SPierre Proncherycontext about provider creation or removal events for the child library context 309b077aed3SPierre ProncheryI<ctx>. Must only be called if I<ctx> is a child library context. 310b077aed3SPierre Pronchery 311b077aed3SPierre Pronchery=head1 NOTES 312b077aed3SPierre Pronchery 313b077aed3SPierre ProncheryLocating a provider module happens as follows: 314b077aed3SPierre Pronchery 315b077aed3SPierre Pronchery=over 4 316b077aed3SPierre Pronchery 317b077aed3SPierre Pronchery=item 1. 318b077aed3SPierre Pronchery 319b077aed3SPierre ProncheryIf a path was given with ossl_provider_set_module_path(), use that as 320b077aed3SPierre Proncherymodule path. 321b077aed3SPierre ProncheryOtherwise, use the provider object's name as module path, with 322b077aed3SPierre Proncheryplatform specific standard extensions added. 323b077aed3SPierre Pronchery 324b077aed3SPierre Pronchery=item 2. 325b077aed3SPierre Pronchery 326b077aed3SPierre ProncheryIf the environment variable B<OPENSSL_MODULES> is defined, assume its 327b077aed3SPierre Proncheryvalue is a directory specification and merge it with the module path. 328b077aed3SPierre ProncheryOtherwise, merge the value of the OpenSSL built in macro B<MODULESDIR> 329b077aed3SPierre Proncherywith the module path. 330b077aed3SPierre Pronchery 331b077aed3SPierre Pronchery=back 332b077aed3SPierre Pronchery 333b077aed3SPierre ProncheryWhen this process is done, the result is used when trying to load the 334b077aed3SPierre Proncheryprovider module. 335b077aed3SPierre Pronchery 336b077aed3SPierre ProncheryThe command C<openssl version -m> can be used to find out the value 337b077aed3SPierre Proncheryof the built in macro B<MODULESDIR>. 338b077aed3SPierre Pronchery 339b077aed3SPierre Pronchery=head1 RETURN VALUES 340b077aed3SPierre Pronchery 341b077aed3SPierre Proncheryossl_provider_find() and ossl_provider_new() return a pointer to a 342b077aed3SPierre Proncheryprovider object (I<OSSL_PROVIDER>) on success, or NULL on error. 343b077aed3SPierre Pronchery 344b077aed3SPierre Proncheryossl_provider_up_ref() returns the value of the reference count after 345b077aed3SPierre Proncheryit has been incremented. 346b077aed3SPierre Pronchery 347b077aed3SPierre Proncheryossl_provider_free() doesn't return any value. 348b077aed3SPierre Pronchery 349b077aed3SPierre Proncheryossl_provider_doall_activated() returns 1 if the callback was called for all 350b077aed3SPierre Proncheryactivated providers. A return value of 0 means that the callback was not 351b077aed3SPierre Proncherycalled for any activated providers. 352b077aed3SPierre Pronchery 353b077aed3SPierre Proncheryossl_provider_set_module_path(), ossl_provider_set_fallback(), 354b077aed3SPierre Proncheryossl_provider_activate(), ossl_provider_activate_leave_fallbacks() and 355b077aed3SPierre Proncheryossl_provider_deactivate(), ossl_provider_add_to_store(), 356b077aed3SPierre Proncheryossl_provider_default_props_update() return 1 on success, or 0 on error. 357b077aed3SPierre Pronchery 358b077aed3SPierre Proncheryossl_provider_name(), ossl_provider_dso(), 359b077aed3SPierre Proncheryossl_provider_module_name(), and ossl_provider_module_path() return a 360b077aed3SPierre Proncherypointer to their respective data if it's available, otherwise NULL 361b077aed3SPierre Proncheryis returned. 362b077aed3SPierre Pronchery 363b077aed3SPierre Proncheryossl_provider_libctx() return a pointer to the library context. 364b077aed3SPierre ProncheryThis may be NULL, and is perfectly valid, as it denotes the default 365b077aed3SPierre Proncheryglobal library context. 366b077aed3SPierre Pronchery 367b077aed3SPierre Proncheryossl_provider_teardown() doesn't return any value. 368b077aed3SPierre Pronchery 369b077aed3SPierre Proncheryossl_provider_gettable_params() returns a pointer to a constant 370b077aed3SPierre ProncheryI<OSSL_PARAM> array if this function is available in the provider, 371b077aed3SPierre Proncheryotherwise NULL. 372b077aed3SPierre Pronchery 373b077aed3SPierre Proncheryossl_provider_get_params() returns 1 on success, or 0 on error. 374b077aed3SPierre ProncheryIf this function isn't available in the provider, 0 is returned. 375b077aed3SPierre Pronchery 376b077aed3SPierre Proncheryossl_provider_set_operation_bit() and ossl_provider_test_operation_bit() 377b077aed3SPierre Proncheryreturn 1 on success, or 0 on error. 378b077aed3SPierre Pronchery 379b077aed3SPierre Proncheryossl_provider_get_capabilities() returns 1 on success, or 0 on error. 380b077aed3SPierre ProncheryIf this function isn't available in the provider or the provider does not 381b077aed3SPierre Proncherysupport the requested capability then 0 is returned. 382b077aed3SPierre Pronchery 383b077aed3SPierre Pronchery=head1 SEE ALSO 384b077aed3SPierre Pronchery 385b077aed3SPierre ProncheryL<OSSL_PROVIDER(3)>, L<provider(7)>, L<openssl(1)> 386b077aed3SPierre Pronchery 387b077aed3SPierre Pronchery=head1 HISTORY 388b077aed3SPierre Pronchery 389b077aed3SPierre ProncheryThe functions described here were all added in OpenSSL 3.0. 390b077aed3SPierre Pronchery 391b077aed3SPierre Pronchery=head1 COPYRIGHT 392b077aed3SPierre Pronchery 393*44096ebdSEnji CooperCopyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved. 394b077aed3SPierre Pronchery 395b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 396b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 397b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 398b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 399b077aed3SPierre Pronchery 400b077aed3SPierre Pronchery=cut 401