Skip to content

Commit 394b5d6

Browse files
committed
ClassCastException still happen deep within BC - turn them into SignatureExeption
this happens when the signature is DSA but the public key for verification is RSA. Sponsored by Lookout Inc.
1 parent 79269fd commit 394b5d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/jruby/ext/openssl/SecurityHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,10 @@ static boolean verify(final X509CRL crl, final PublicKey publicKey, final boolea
602602
catch (CertException e) {
603603
throw new SignatureException(e);
604604
}
605+
// can happen if the input is DER but does not match expected strucure
606+
catch (ClassCastException e) {
607+
throw new SignatureException(e);
608+
}
605609
catch (IOException e) {
606610
throw new SignatureException(e);
607611
}

0 commit comments

Comments
 (0)