Skip to content

Commit

Permalink
Always add a suitable error if we fail to decode
Browse files Browse the repository at this point in the history
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 #21603)

(cherry picked from commit 564e5b7)
  • Loading branch information
mattcaswell authored and t8m committed Aug 1, 2023
1 parent 1383dc6 commit bc34490
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crypto/encode_decode/decoder_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,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 */
Expand Down

0 comments on commit bc34490

Please sign in to comment.