Lines Matching refs:loader
18 int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader) in OSSL_STORE_LOADER_up_ref() argument
22 if (loader->prov != NULL) in OSSL_STORE_LOADER_up_ref()
23 CRYPTO_UP_REF(&loader->refcnt, &ref, loader->lock); in OSSL_STORE_LOADER_up_ref()
27 void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader) in OSSL_STORE_LOADER_free() argument
29 if (loader != NULL && loader->prov != NULL) { in OSSL_STORE_LOADER_free()
32 CRYPTO_DOWN_REF(&loader->refcnt, &i, loader->lock); in OSSL_STORE_LOADER_free()
35 ossl_provider_free(loader->prov); in OSSL_STORE_LOADER_free()
36 CRYPTO_THREAD_lock_free(loader->lock); in OSSL_STORE_LOADER_free()
38 OPENSSL_free(loader); in OSSL_STORE_LOADER_free()
47 OSSL_STORE_LOADER *loader; in new_loader() local
49 if ((loader = OPENSSL_zalloc(sizeof(*loader))) == NULL in new_loader()
50 || (loader->lock = CRYPTO_THREAD_lock_new()) == NULL) { in new_loader()
51 OPENSSL_free(loader); in new_loader()
54 loader->prov = prov; in new_loader()
56 loader->refcnt = 1; in new_loader()
58 return loader; in new_loader()
198 OSSL_STORE_LOADER *loader = NULL; in loader_from_algorithm() local
201 if ((loader = new_loader(prov)) == NULL) in loader_from_algorithm()
203 loader->scheme_id = scheme_id; in loader_from_algorithm()
204 loader->propdef = algodef->property_definition; in loader_from_algorithm()
205 loader->description = algodef->algorithm_description; in loader_from_algorithm()
210 if (loader->p_open == NULL) in loader_from_algorithm()
211 loader->p_open = OSSL_FUNC_store_open(fns); in loader_from_algorithm()
214 if (loader->p_attach == NULL) in loader_from_algorithm()
215 loader->p_attach = OSSL_FUNC_store_attach(fns); in loader_from_algorithm()
218 if (loader->p_settable_ctx_params == NULL) in loader_from_algorithm()
219 loader->p_settable_ctx_params = in loader_from_algorithm()
223 if (loader->p_set_ctx_params == NULL) in loader_from_algorithm()
224 loader->p_set_ctx_params = OSSL_FUNC_store_set_ctx_params(fns); in loader_from_algorithm()
227 if (loader->p_load == NULL) in loader_from_algorithm()
228 loader->p_load = OSSL_FUNC_store_load(fns); in loader_from_algorithm()
231 if (loader->p_eof == NULL) in loader_from_algorithm()
232 loader->p_eof = OSSL_FUNC_store_eof(fns); in loader_from_algorithm()
235 if (loader->p_close == NULL) in loader_from_algorithm()
236 loader->p_close = OSSL_FUNC_store_close(fns); in loader_from_algorithm()
239 if (loader->p_export_object == NULL) in loader_from_algorithm()
240 loader->p_export_object = OSSL_FUNC_store_export_object(fns); in loader_from_algorithm()
245 if ((loader->p_open == NULL && loader->p_attach == NULL) in loader_from_algorithm()
246 || loader->p_load == NULL in loader_from_algorithm()
247 || loader->p_eof == NULL in loader_from_algorithm()
248 || loader->p_close == NULL) { in loader_from_algorithm()
250 OSSL_STORE_LOADER_free(loader); in loader_from_algorithm()
254 return loader; in loader_from_algorithm()
445 const OSSL_PROVIDER *OSSL_STORE_LOADER_get0_provider(const OSSL_STORE_LOADER *loader) in OSSL_STORE_LOADER_get0_provider() argument
447 if (!ossl_assert(loader != NULL)) { in OSSL_STORE_LOADER_get0_provider()
452 return loader->prov; in OSSL_STORE_LOADER_get0_provider()
455 const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader) in OSSL_STORE_LOADER_get0_properties() argument
457 if (!ossl_assert(loader != NULL)) { in OSSL_STORE_LOADER_get0_properties()
462 return loader->propdef; in OSSL_STORE_LOADER_get0_properties()
465 int ossl_store_loader_get_number(const OSSL_STORE_LOADER *loader) in ossl_store_loader_get_number() argument
467 if (!ossl_assert(loader != NULL)) { in ossl_store_loader_get_number()
472 return loader->scheme_id; in ossl_store_loader_get_number()
475 const char *OSSL_STORE_LOADER_get0_description(const OSSL_STORE_LOADER *loader) in OSSL_STORE_LOADER_get0_description() argument
477 return loader->description; in OSSL_STORE_LOADER_get0_description()
480 int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader, const char *name) in OSSL_STORE_LOADER_is_a() argument
482 if (loader->prov != NULL) { in OSSL_STORE_LOADER_is_a()
483 OSSL_LIB_CTX *libctx = ossl_provider_libctx(loader->prov); in OSSL_STORE_LOADER_is_a()
486 return ossl_namemap_name2num(namemap, name) == loader->scheme_id; in OSSL_STORE_LOADER_is_a()
492 void (*user_fn)(OSSL_STORE_LOADER *loader, void *arg);
504 void (*user_fn)(OSSL_STORE_LOADER *loader, in OSSL_STORE_LOADER_do_all_provided() argument
523 int OSSL_STORE_LOADER_names_do_all(const OSSL_STORE_LOADER *loader, in OSSL_STORE_LOADER_names_do_all() argument
527 if (loader == NULL) in OSSL_STORE_LOADER_names_do_all()
530 if (loader->prov != NULL) { in OSSL_STORE_LOADER_names_do_all()
531 OSSL_LIB_CTX *libctx = ossl_provider_libctx(loader->prov); in OSSL_STORE_LOADER_names_do_all()
534 return ossl_namemap_doall_names(namemap, loader->scheme_id, fn, data); in OSSL_STORE_LOADER_names_do_all()