DECODER: check the first decoded structure name against user given structure
authorRichard Levitte <levitte@openssl.org>
Mon, 30 Aug 2021 11:16:42 +0000 (13:16 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 5 Sep 2021 19:42:54 +0000 (21:42 +0200)
commite3a2ba6abdf0dfdec4343f6de5e5539e487abdd3
tree587c2377eb72afc4b8a1d0e14e7f5bf24bf7f874
parent45950ba740c9a3d7b3029c77d7a11fe154ae2e1c
DECODER: check the first decoded structure name against user given structure

In a chain of decoders, the first that specifies an input structure
gets it compared with the structure specified by the user, if there is
one.  If they aren't the same, that decoder is skipped.

Because the first structure can appear anywhere along a chain of
decoders, not just the decoders associated with the resulting OpenSSL
type, the code that checked the structure name when building up the
chain of decoders is removed.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16466)

(cherry picked from commit 73dd5d67c506cfeb9bf6183f0c19832c7d3f174d)
crypto/encode_decode/decoder_lib.c
crypto/encode_decode/decoder_pkey.c