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)
This commit is contained in:
Matt Caswell 2023-07-31 12:30:34 +01:00 committed by Tomas Mraz
parent 6207f2b657
commit 564e5b754a

View File

@ -779,10 +779,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 */