diff options
author | Matt Caswell <matt@openssl.org> | 2023-07-31 12:30:34 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-08-01 20:10:17 +0200 |
commit | 4b52d80c48fe1f4858f43030be0be92cc2158668 (patch) | |
tree | 28f71958ed9580fa3852ef0a04454fa5f97ea531 /crypto | |
parent | 64683ba54e28e730c84beaf06c49a393f15b5d6e (diff) |
Always add a suitable error if we fail to decode
We're always supposed to add the fallback "unsupported" error if we don't
have anything better. However in some cases this wasn't happening because
we were incorrectly setting "flag_construct_called" - even though the
construct function had failed.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21603)
(cherry picked from commit 564e5b754a4680dfad38585dd73bcf025567b448)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/encode_decode/decoder_lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/encode_decode/decoder_lib.c b/crypto/encode_decode/decoder_lib.c index e24d2c6cd5..a1257571ec 100644 --- a/crypto/encode_decode/decoder_lib.c +++ b/crypto/encode_decode/decoder_lib.c @@ -743,10 +743,11 @@ static int decoder_process(const OSSL_PARAM params[], void *arg) (void *)new_data.ctx, LEVEL, rv); } OSSL_TRACE_END(DECODER); - data->flag_construct_called = 1; ok = (rv > 0); - if (ok) + if (ok) { + data->flag_construct_called = 1; goto end; + } } /* The constructor didn't return success */ |