Lines Matching refs:decoder

30     OSSL_DECODER *decoder = NULL;  in ossl_decoder_new()  local
32 if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL) in ossl_decoder_new()
34 if (!CRYPTO_NEW_REF(&decoder->base.refcnt, 1)) { in ossl_decoder_new()
35 OSSL_DECODER_free(decoder); in ossl_decoder_new()
39 return decoder; in ossl_decoder_new()
42 int OSSL_DECODER_up_ref(OSSL_DECODER *decoder) in OSSL_DECODER_up_ref() argument
46 CRYPTO_UP_REF(&decoder->base.refcnt, &ref); in OSSL_DECODER_up_ref()
50 void OSSL_DECODER_free(OSSL_DECODER *decoder) in OSSL_DECODER_free() argument
54 if (decoder == NULL) in OSSL_DECODER_free()
57 CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref); in OSSL_DECODER_free()
60 OPENSSL_free(decoder->base.name); in OSSL_DECODER_free()
61 ossl_property_free(decoder->base.parsed_propdef); in OSSL_DECODER_free()
62 ossl_provider_free(decoder->base.prov); in OSSL_DECODER_free()
63 CRYPTO_FREE_REF(&decoder->base.refcnt); in OSSL_DECODER_free()
64 OPENSSL_free(decoder); in OSSL_DECODER_free()
202 OSSL_DECODER *decoder = NULL; in ossl_decoder_from_algorithm() local
206 if ((decoder = ossl_decoder_new()) == NULL) in ossl_decoder_from_algorithm()
208 decoder->base.id = id; in ossl_decoder_from_algorithm()
209 if ((decoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) { in ossl_decoder_from_algorithm()
210 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
213 decoder->base.algodef = algodef; in ossl_decoder_from_algorithm()
214 if ((decoder->base.parsed_propdef in ossl_decoder_from_algorithm()
216 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
223 if (decoder->newctx == NULL) in ossl_decoder_from_algorithm()
224 decoder->newctx = OSSL_FUNC_decoder_newctx(fns); in ossl_decoder_from_algorithm()
227 if (decoder->freectx == NULL) in ossl_decoder_from_algorithm()
228 decoder->freectx = OSSL_FUNC_decoder_freectx(fns); in ossl_decoder_from_algorithm()
231 if (decoder->get_params == NULL) in ossl_decoder_from_algorithm()
232 decoder->get_params = in ossl_decoder_from_algorithm()
236 if (decoder->gettable_params == NULL) in ossl_decoder_from_algorithm()
237 decoder->gettable_params = in ossl_decoder_from_algorithm()
241 if (decoder->set_ctx_params == NULL) in ossl_decoder_from_algorithm()
242 decoder->set_ctx_params = in ossl_decoder_from_algorithm()
246 if (decoder->settable_ctx_params == NULL) in ossl_decoder_from_algorithm()
247 decoder->settable_ctx_params = in ossl_decoder_from_algorithm()
251 if (decoder->does_selection == NULL) in ossl_decoder_from_algorithm()
252 decoder->does_selection = in ossl_decoder_from_algorithm()
256 if (decoder->decode == NULL) in ossl_decoder_from_algorithm()
257 decoder->decode = OSSL_FUNC_decoder_decode(fns); in ossl_decoder_from_algorithm()
260 if (decoder->export_object == NULL) in ossl_decoder_from_algorithm()
261 decoder->export_object = OSSL_FUNC_decoder_export_object(fns); in ossl_decoder_from_algorithm()
270 if (!((decoder->newctx == NULL && decoder->freectx == NULL) in ossl_decoder_from_algorithm()
271 || (decoder->newctx != NULL && decoder->freectx != NULL)) in ossl_decoder_from_algorithm()
272 || decoder->decode == NULL) { in ossl_decoder_from_algorithm()
273 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
279 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
283 decoder->base.prov = prov; in ossl_decoder_from_algorithm()
284 return decoder; in ossl_decoder_from_algorithm()
454 const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_provider() argument
456 if (!ossl_assert(decoder != NULL)) { in OSSL_DECODER_get0_provider()
461 return decoder->base.prov; in OSSL_DECODER_get0_provider()
464 const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_properties() argument
466 if (!ossl_assert(decoder != NULL)) { in OSSL_DECODER_get0_properties()
471 return decoder->base.algodef->property_definition; in OSSL_DECODER_get0_properties()
475 ossl_decoder_parsed_properties(const OSSL_DECODER *decoder) in ossl_decoder_parsed_properties() argument
477 if (!ossl_assert(decoder != NULL)) { in ossl_decoder_parsed_properties()
482 return decoder->base.parsed_propdef; in ossl_decoder_parsed_properties()
485 int ossl_decoder_get_number(const OSSL_DECODER *decoder) in ossl_decoder_get_number() argument
487 if (!ossl_assert(decoder != NULL)) { in ossl_decoder_get_number()
492 return decoder->base.id; in ossl_decoder_get_number()
495 const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_name() argument
497 return decoder->base.name; in OSSL_DECODER_get0_name()
500 const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_description() argument
502 return decoder->base.algodef->algorithm_description; in OSSL_DECODER_get0_description()
505 int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name) in OSSL_DECODER_is_a() argument
507 if (decoder->base.prov != NULL) { in OSSL_DECODER_is_a()
508 OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); in OSSL_DECODER_is_a()
511 return ossl_namemap_name2num(namemap, name) == decoder->base.id; in OSSL_DECODER_is_a()
516 static int resolve_name(OSSL_DECODER *decoder, const char *name) in resolve_name() argument
518 OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); in resolve_name()
524 int ossl_decoder_fast_is_a(OSSL_DECODER *decoder, const char *name, int *id_cache) in ossl_decoder_fast_is_a() argument
529 *id_cache = id = resolve_name(decoder, name); in ossl_decoder_fast_is_a()
531 return id > 0 && ossl_decoder_get_number(decoder) == id; in ossl_decoder_fast_is_a()
535 void (*user_fn)(OSSL_DECODER *decoder, void *arg);
547 void (*user_fn)(OSSL_DECODER *decoder, in OSSL_DECODER_do_all_provided() argument
566 int OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder, in OSSL_DECODER_names_do_all() argument
570 if (decoder == NULL) in OSSL_DECODER_names_do_all()
573 if (decoder->base.prov != NULL) { in OSSL_DECODER_names_do_all()
574 OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); in OSSL_DECODER_names_do_all()
577 return ossl_namemap_doall_names(namemap, decoder->base.id, fn, data); in OSSL_DECODER_names_do_all()
584 OSSL_DECODER_gettable_params(OSSL_DECODER *decoder) in OSSL_DECODER_gettable_params() argument
586 if (decoder != NULL && decoder->gettable_params != NULL) { in OSSL_DECODER_gettable_params()
587 void *provctx = ossl_provider_ctx(OSSL_DECODER_get0_provider(decoder)); in OSSL_DECODER_gettable_params()
589 return decoder->gettable_params(provctx); in OSSL_DECODER_gettable_params()
594 int OSSL_DECODER_get_params(OSSL_DECODER *decoder, OSSL_PARAM params[]) in OSSL_DECODER_get_params() argument
596 if (decoder != NULL && decoder->get_params != NULL) in OSSL_DECODER_get_params()
597 return decoder->get_params(params); in OSSL_DECODER_get_params()
602 OSSL_DECODER_settable_ctx_params(OSSL_DECODER *decoder) in OSSL_DECODER_settable_ctx_params() argument
604 if (decoder != NULL && decoder->settable_ctx_params != NULL) { in OSSL_DECODER_settable_ctx_params()
605 void *provctx = ossl_provider_ctx(OSSL_DECODER_get0_provider(decoder)); in OSSL_DECODER_settable_ctx_params()
607 return decoder->settable_ctx_params(provctx); in OSSL_DECODER_settable_ctx_params()
649 OSSL_DECODER *decoder = in OSSL_DECODER_CTX_set_params() local
654 if (decoderctx == NULL || decoder->set_ctx_params == NULL) in OSSL_DECODER_CTX_set_params()
656 if (!decoder->set_ctx_params(decoderctx, params)) in OSSL_DECODER_CTX_set_params()