When there is other PEM data in between certs the OSSL_STORE_load
returns NULL and reports error. Avoid printing that error unless
there was nothing read at all.
Fixes #15945
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15949)
OSSL_PARAM itp[2];
const OSSL_PARAM *params = NULL;
- if (suppress_decode_errors)
- ERR_set_mark();
-
if (ppkey != NULL) {
*ppkey = NULL;
cnt_expectations++;
* certificate in it. We just retry until eof.
*/
if (info == NULL) {
- if (OSSL_STORE_error(ctx)) {
- ERR_print_errors(bio_err);
- ERR_clear_error();
- }
continue;
}
BIO_printf(bio_err, "\n");
ERR_print_errors(bio_err);
}
- if (suppress_decode_errors)
- ERR_pop_to_mark();
+ if (suppress_decode_errors || failed == NULL)
+ /* clear any spurious errors */
+ ERR_clear_error();
return failed == NULL;
}