The problem of producing to-the-point diagnostics will be fixed in a follow-up PR.
Fixes #18691
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18758)
* SUBJECT_ISSUER_MISMATCH just means 'x' is clearly not issued by 'issuer'.
* Every other error code likely indicates a real error.
*/
- if (err != X509_V_ERR_SUBJECT_ISSUER_MISMATCH)
- ctx->error = err;
return 0;
}
int alt_untrusted = 0;
int max_depth;
int ok = 0;
- int prev_error = ctx->error;
int i;
/* Our chain starts with a single untrusted element. */
switch (trust) {
case X509_TRUST_TRUSTED:
- /* Must restore any previous error value for backward compatibility */
- ctx->error = prev_error;
return 1;
case X509_TRUST_REJECTED:
/* Callback already issued */