If decoders setup fails, this is a fatal error.
We indicate EOF from the store as otherwise the store
users will loop indefinitely.
Fixes #28667
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Mon Mar 2 19:38:43 2026
(Merged from https://github.com/openssl/openssl/pull/30170)
/* Expected object type. May be unspecified */
int expected_type;
+ /* Fatal error occurred. We should indicate EOF. */
+ int fatal_error;
};
static void free_file_ctx(struct file_ctx_st *ctx)
/* Setup the decoders (one time shot per session */
- if (!file_setup_decoders(ctx))
+ if (!file_setup_decoders(ctx)) {
+ ctx->fatal_error = 1;
return 0;
+ }
/* Setup for this object */
{
struct file_ctx_st *ctx = loaderctx;
+ if (ctx->fatal_error)
+ return 1;
+
switch (ctx->type) {
case IS_DIR:
return ctx->_.dir.end_reached;
const unsigned char *der_ = der;
size_t der_len_ = der_len;
- if (setup_decoder(ctx) == 0)
+ if (setup_decoder(ctx) == 0) {
+ ctx->state = STATE_EOF;
return 0;
+ }
data.object_cb = object_cb;
data.object_cbarg = object_cbarg;