• Home
  • Raw
  • Download

Lines Matching full:decoder

21 #include "crypto/decoder.h"
31 /* Index of the current decoder instance to be processed */
212 OSSL_DECODER_INSTANCE *ossl_decoder_instance_new(OSSL_DECODER *decoder, in ossl_decoder_instance_new() argument
221 if (!ossl_assert(decoder != NULL)) { in ossl_decoder_instance_new()
231 prov = OSSL_DECODER_get0_provider(decoder); in ossl_decoder_instance_new()
233 props = ossl_decoder_parsed_properties(decoder); in ossl_decoder_instance_new()
236 "there are no property definitions with decoder %s", in ossl_decoder_instance_new()
237 OSSL_DECODER_get0_name(decoder)); in ossl_decoder_instance_new()
247 "for decoder %s (properties: %s)", in ossl_decoder_instance_new()
248 OSSL_DECODER_get0_name(decoder), in ossl_decoder_instance_new()
249 OSSL_DECODER_get0_properties(decoder)); in ossl_decoder_instance_new()
260 if (!OSSL_DECODER_up_ref(decoder)) { in ossl_decoder_instance_new()
264 decoder_inst->decoder = decoder; in ossl_decoder_instance_new()
275 if (decoder_inst->decoder != NULL) in ossl_decoder_instance_free()
276 decoder_inst->decoder->freectx(decoder_inst->decoderctx); in ossl_decoder_instance_free()
278 OSSL_DECODER_free(decoder_inst->decoder); in ossl_decoder_instance_free()
279 decoder_inst->decoder = NULL; in ossl_decoder_instance_free()
298 OSSL_TRACE_BEGIN(DECODER) { in ossl_decoder_ctx_add_decoder_inst()
300 "(ctx %p) Added decoder instance %p for decoder %p\n" in ossl_decoder_ctx_add_decoder_inst()
302 (void *)ctx, (void *)di, (void *)di->decoder, in ossl_decoder_ctx_add_decoder_inst()
303 OSSL_DECODER_get0_name(di->decoder), in ossl_decoder_ctx_add_decoder_inst()
304 OSSL_DECODER_get0_properties(di->decoder)); in ossl_decoder_ctx_add_decoder_inst()
305 } OSSL_TRACE_END(DECODER); in ossl_decoder_ctx_add_decoder_inst()
310 int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder) in OSSL_DECODER_CTX_add_decoder() argument
317 if (!ossl_assert(ctx != NULL) || !ossl_assert(decoder != NULL)) { in OSSL_DECODER_CTX_add_decoder()
322 prov = OSSL_DECODER_get0_provider(decoder); in OSSL_DECODER_CTX_add_decoder()
325 if ((decoderctx = decoder->newctx(provctx)) == NULL in OSSL_DECODER_CTX_add_decoder()
327 ossl_decoder_instance_new(decoder, decoderctx)) == NULL) in OSSL_DECODER_CTX_add_decoder()
339 decoder->freectx(decoderctx); in OSSL_DECODER_CTX_add_decoder()
347 * 0 to check that the decoder's input type is the same as the decoder name
348 * 1 to check that the decoder's input type differs from the decoder name
357 static void collect_all_decoders(OSSL_DECODER *decoder, void *arg) in DEFINE_STACK_OF()
361 if (OSSL_DECODER_up_ref(decoder) in DEFINE_STACK_OF()
362 && !sk_OSSL_DECODER_push(skdecoders, decoder)) in DEFINE_STACK_OF()
363 OSSL_DECODER_free(decoder); in DEFINE_STACK_OF()
366 static void collect_extra_decoder(OSSL_DECODER *decoder, void *arg) in collect_extra_decoder() argument
370 const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder); in collect_extra_decoder()
373 if (OSSL_DECODER_is_a(decoder, data->output_type)) { in collect_extra_decoder()
377 OSSL_TRACE_BEGIN(DECODER) { in collect_extra_decoder()
379 "(ctx %p) [%d] Checking out decoder %p:\n" in collect_extra_decoder()
381 (void *)data->ctx, data->type_check, (void *)decoder, in collect_extra_decoder()
382 OSSL_DECODER_get0_name(decoder), in collect_extra_decoder()
383 OSSL_DECODER_get0_properties(decoder)); in collect_extra_decoder()
384 } OSSL_TRACE_END(DECODER); in collect_extra_decoder()
387 * Check that we don't already have this decoder in our stack, in collect_extra_decoder()
395 if (decoder->base.algodef == check_inst->decoder->base.algodef) { in collect_extra_decoder()
397 OSSL_TRACE_BEGIN(DECODER) { in collect_extra_decoder()
400 } OSSL_TRACE_END(DECODER); in collect_extra_decoder()
405 if ((decoderctx = decoder->newctx(provctx)) == NULL) in collect_extra_decoder()
408 if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) { in collect_extra_decoder()
409 decoder->freectx(decoderctx); in collect_extra_decoder()
415 /* If it differs, this is not a decoder to add for now. */ in collect_extra_decoder()
416 if (!OSSL_DECODER_is_a(decoder, in collect_extra_decoder()
419 OSSL_TRACE_BEGIN(DECODER) { in collect_extra_decoder()
422 } OSSL_TRACE_END(DECODER); in collect_extra_decoder()
427 /* If it's the same, this is not a decoder to add for now. */ in collect_extra_decoder()
428 if (OSSL_DECODER_is_a(decoder, in collect_extra_decoder()
431 OSSL_TRACE_BEGIN(DECODER) { in collect_extra_decoder()
434 } OSSL_TRACE_END(DECODER); in collect_extra_decoder()
457 * This function goes through existing decoder methods in in OSSL_DECODER_CTX_add_extra()
497 OSSL_TRACE_BEGIN(DECODER) { in OSSL_DECODER_CTX_add_extra()
500 } OSSL_TRACE_END(DECODER); in OSSL_DECODER_CTX_add_extra()
546 /* Slide the "previous decoder" windows */ in OSSL_DECODER_CTX_add_extra()
624 OSSL_DECODER *decoder = NULL; in OSSL_DECODER_export() local
635 decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst); in OSSL_DECODER_export()
637 return decoder->export_object(decoderctx, reference, reference_sz, in OSSL_DECODER_export()
646 return decoder_inst->decoder; in OSSL_DECODER_INSTANCE_get_decoder()
680 OSSL_DECODER *decoder = NULL; in decoder_process() local
709 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
711 "(ctx %p) starting to walk the decoder chain\n", in decoder_process()
713 } OSSL_TRACE_END(DECODER); in decoder_process()
726 decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst); in decoder_process()
732 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
736 } OSSL_TRACE_END(DECODER); in decoder_process()
740 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
744 } OSSL_TRACE_END(DECODER); in decoder_process()
756 * decoder that will take it. Object references are not in decoder_process()
782 * data type is already enough to find the applicable next decoder, in decoder_process()
796 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
798 "(ctx %p) %s incoming from previous decoder (%p):\n" in decoder_process()
800 (void *)new_data.ctx, LEVEL, (void *)decoder, in decoder_process()
804 } OSSL_TRACE_END(DECODER); in decoder_process()
838 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
840 "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p):\n" in decoder_process()
846 } OSSL_TRACE_END(DECODER); in decoder_process()
849 * If |decoder| is NULL, it means we've just started, and the caller in decoder_process()
853 if (decoder == NULL && ctx->start_input_type != NULL in decoder_process()
855 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
857 …] the start input type '%s' doesn't match the input type of the considered decoder, skipping...\n", in decoder_process()
860 } OSSL_TRACE_END(DECODER); in decoder_process()
865 * If we have a previous decoder, we check that the input type in decoder_process()
868 * for the decoder we're currently considering. in decoder_process()
870 if (decoder != NULL && !OSSL_DECODER_is_a(decoder, new_input_type)) { in decoder_process()
871 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
873 …"(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p), skipping...\… in decoder_process()
875 (void *)decoder); in decoder_process()
876 } OSSL_TRACE_END(DECODER); in decoder_process()
881 * If the previous decoder gave us a data type, we check to see in decoder_process()
882 * if that matches the decoder we're currently considering. in decoder_process()
885 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
887 …"(ctx %p) %s [%u] the previous decoder's data type doesn't match the name of the considered decode… in decoder_process()
889 } OSSL_TRACE_END(DECODER); in decoder_process()
894 * If the previous decoder gave us a data structure name, we check in decoder_process()
895 * to see that it matches the input data structure of the decoder in decoder_process()
902 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
904 …"(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure of the c… in decoder_process()
906 } OSSL_TRACE_END(DECODER); in decoder_process()
911 * If the decoder we're currently considering specifies a structure, in decoder_process()
922 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
924 …"(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure given by… in decoder_process()
926 } OSSL_TRACE_END(DECODER); in decoder_process()
946 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
948 "(ctx %p) %s [%u] Running decoder instance %p\n", in decoder_process()
951 } OSSL_TRACE_END(DECODER); in decoder_process()
954 * We only care about errors reported from decoder implementations in decoder_process()
968 OSSL_TRACE_BEGIN(DECODER) { in decoder_process()
970 "(ctx %p) %s [%u] Running decoder instance %p => %d" in decoder_process()
976 } OSSL_TRACE_END(DECODER); in decoder_process()
988 * Break if the decoder implementation that we called recursed, since in decoder_process()