Skip to content

Commit

Permalink
Ignore all errors if DER fails to load.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 19, 2021
1 parent 8591a4d commit 6bf5670
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions ext/openssl/ossl_x509cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,22 +789,10 @@ load_chained_certificates_DER(BIO *in) {

/* If we cannot read one certificate: */
if (certificate == NULL) {
/* If we cannot read one certificate because we could not read the DER encoding: */
if (ERR_GET_REASON(ERR_peek_last_error()) == ERR_R_NESTED_ASN1_ERROR) {
ossl_clear_error();
}

if (BIO_eof(in)) {
/* If we didn't actually read anything: */
if (BIO_tell(in) == 0) {
ossl_clear_error();
}
}
/* Ignore error. We could not load. */
ossl_clear_error();

if (ERR_peek_last_error())
ossl_raise(eX509CertError, NULL);
else
return Qnil;
return Qnil;
}

return load_chained_certificates_append(Qnil, certificate);
Expand Down

0 comments on commit 6bf5670

Please sign in to comment.