Lines Matching refs:decoder

29     OSSL_DECODER *decoder = NULL;  in ossl_decoder_new()  local
31 if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL in ossl_decoder_new()
32 || (decoder->base.lock = CRYPTO_THREAD_lock_new()) == NULL) { in ossl_decoder_new()
33 OSSL_DECODER_free(decoder); in ossl_decoder_new()
38 decoder->base.refcnt = 1; in ossl_decoder_new()
40 return decoder; in ossl_decoder_new()
43 int OSSL_DECODER_up_ref(OSSL_DECODER *decoder) in OSSL_DECODER_up_ref() argument
47 CRYPTO_UP_REF(&decoder->base.refcnt, &ref, decoder->base.lock); in OSSL_DECODER_up_ref()
51 void OSSL_DECODER_free(OSSL_DECODER *decoder) in OSSL_DECODER_free() argument
55 if (decoder == NULL) in OSSL_DECODER_free()
58 CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref, decoder->base.lock); in OSSL_DECODER_free()
61 OPENSSL_free(decoder->base.name); in OSSL_DECODER_free()
62 ossl_property_free(decoder->base.parsed_propdef); in OSSL_DECODER_free()
63 ossl_provider_free(decoder->base.prov); in OSSL_DECODER_free()
64 CRYPTO_THREAD_lock_free(decoder->base.lock); in OSSL_DECODER_free()
65 OPENSSL_free(decoder); in OSSL_DECODER_free()
201 OSSL_DECODER *decoder = NULL; in ossl_decoder_from_algorithm() local
205 if ((decoder = ossl_decoder_new()) == NULL) in ossl_decoder_from_algorithm()
207 decoder->base.id = id; in ossl_decoder_from_algorithm()
208 if ((decoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) { in ossl_decoder_from_algorithm()
209 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
212 decoder->base.algodef = algodef; in ossl_decoder_from_algorithm()
213 decoder->base.parsed_propdef in ossl_decoder_from_algorithm()
219 if (decoder->newctx == NULL) in ossl_decoder_from_algorithm()
220 decoder->newctx = OSSL_FUNC_decoder_newctx(fns); in ossl_decoder_from_algorithm()
223 if (decoder->freectx == NULL) in ossl_decoder_from_algorithm()
224 decoder->freectx = OSSL_FUNC_decoder_freectx(fns); in ossl_decoder_from_algorithm()
227 if (decoder->get_params == NULL) in ossl_decoder_from_algorithm()
228 decoder->get_params = in ossl_decoder_from_algorithm()
232 if (decoder->gettable_params == NULL) in ossl_decoder_from_algorithm()
233 decoder->gettable_params = in ossl_decoder_from_algorithm()
237 if (decoder->set_ctx_params == NULL) in ossl_decoder_from_algorithm()
238 decoder->set_ctx_params = in ossl_decoder_from_algorithm()
242 if (decoder->settable_ctx_params == NULL) in ossl_decoder_from_algorithm()
243 decoder->settable_ctx_params = in ossl_decoder_from_algorithm()
247 if (decoder->does_selection == NULL) in ossl_decoder_from_algorithm()
248 decoder->does_selection = in ossl_decoder_from_algorithm()
252 if (decoder->decode == NULL) in ossl_decoder_from_algorithm()
253 decoder->decode = OSSL_FUNC_decoder_decode(fns); in ossl_decoder_from_algorithm()
256 if (decoder->export_object == NULL) in ossl_decoder_from_algorithm()
257 decoder->export_object = OSSL_FUNC_decoder_export_object(fns); in ossl_decoder_from_algorithm()
266 if (!((decoder->newctx == NULL && decoder->freectx == NULL) in ossl_decoder_from_algorithm()
267 || (decoder->newctx != NULL && decoder->freectx != NULL)) in ossl_decoder_from_algorithm()
268 || decoder->decode == NULL) { in ossl_decoder_from_algorithm()
269 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
275 OSSL_DECODER_free(decoder); in ossl_decoder_from_algorithm()
279 decoder->base.prov = prov; in ossl_decoder_from_algorithm()
280 return decoder; in ossl_decoder_from_algorithm()
451 const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_provider() argument
453 if (!ossl_assert(decoder != NULL)) { in OSSL_DECODER_get0_provider()
458 return decoder->base.prov; in OSSL_DECODER_get0_provider()
461 const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_properties() argument
463 if (!ossl_assert(decoder != NULL)) { in OSSL_DECODER_get0_properties()
468 return decoder->base.algodef->property_definition; in OSSL_DECODER_get0_properties()
472 ossl_decoder_parsed_properties(const OSSL_DECODER *decoder) in ossl_decoder_parsed_properties() argument
474 if (!ossl_assert(decoder != NULL)) { in ossl_decoder_parsed_properties()
479 return decoder->base.parsed_propdef; in ossl_decoder_parsed_properties()
482 int ossl_decoder_get_number(const OSSL_DECODER *decoder) in ossl_decoder_get_number() argument
484 if (!ossl_assert(decoder != NULL)) { in ossl_decoder_get_number()
489 return decoder->base.id; in ossl_decoder_get_number()
492 const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_name() argument
494 return decoder->base.name; in OSSL_DECODER_get0_name()
497 const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder) in OSSL_DECODER_get0_description() argument
499 return decoder->base.algodef->algorithm_description; in OSSL_DECODER_get0_description()
502 int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name) in OSSL_DECODER_is_a() argument
504 if (decoder->base.prov != NULL) { in OSSL_DECODER_is_a()
505 OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); in OSSL_DECODER_is_a()
508 return ossl_namemap_name2num(namemap, name) == decoder->base.id; in OSSL_DECODER_is_a()
514 void (*user_fn)(OSSL_DECODER *decoder, void *arg);
526 void (*user_fn)(OSSL_DECODER *decoder, in OSSL_DECODER_do_all_provided() argument
545 int OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder, in OSSL_DECODER_names_do_all() argument
549 if (decoder == NULL) in OSSL_DECODER_names_do_all()
552 if (decoder->base.prov != NULL) { in OSSL_DECODER_names_do_all()
553 OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); in OSSL_DECODER_names_do_all()
556 return ossl_namemap_doall_names(namemap, decoder->base.id, fn, data); in OSSL_DECODER_names_do_all()
563 OSSL_DECODER_gettable_params(OSSL_DECODER *decoder) in OSSL_DECODER_gettable_params() argument
565 if (decoder != NULL && decoder->gettable_params != NULL) { in OSSL_DECODER_gettable_params()
566 void *provctx = ossl_provider_ctx(OSSL_DECODER_get0_provider(decoder)); in OSSL_DECODER_gettable_params()
568 return decoder->gettable_params(provctx); in OSSL_DECODER_gettable_params()
573 int OSSL_DECODER_get_params(OSSL_DECODER *decoder, OSSL_PARAM params[]) in OSSL_DECODER_get_params() argument
575 if (decoder != NULL && decoder->get_params != NULL) in OSSL_DECODER_get_params()
576 return decoder->get_params(params); in OSSL_DECODER_get_params()
581 OSSL_DECODER_settable_ctx_params(OSSL_DECODER *decoder) in OSSL_DECODER_settable_ctx_params() argument
583 if (decoder != NULL && decoder->settable_ctx_params != NULL) { in OSSL_DECODER_settable_ctx_params()
584 void *provctx = ossl_provider_ctx(OSSL_DECODER_get0_provider(decoder)); in OSSL_DECODER_settable_ctx_params()
586 return decoder->settable_ctx_params(provctx); in OSSL_DECODER_settable_ctx_params()
630 OSSL_DECODER *decoder = in OSSL_DECODER_CTX_set_params() local
635 if (decoderctx == NULL || decoder->set_ctx_params == NULL) in OSSL_DECODER_CTX_set_params()
637 if (!decoder->set_ctx_params(decoderctx, params)) in OSSL_DECODER_CTX_set_params()