Skip to content

Commit

Permalink
Fix exception handling in PKCS7.encodeSignedData()
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Feb 17, 2021
1 parent 86e7763 commit ea44c69
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions org/mozilla/jss/netscape/security/pkcs/PKCS7.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,9 @@ public void encodeSignedData(DerOutputStream out, boolean sort)
implCerts[i] = (X509CertImpl) certificates[i];
}
} catch (ClassCastException e) {
IOException ioe =
new IOException("Certificates in PKCS7 " +
"must be of class " +
"org.mozilla.jss.netscape.security.X509CertImpl");
ioe.fillInStackTrace();
throw new IOException(
"Certificates in PKCS7 must be of class " +
"org.mozilla.jss.netscape.security.X509CertImpl: " + e.getMessage(), e);
}

// Add the certificate set (tagged with [0] IMPLICIT)
Expand Down

0 comments on commit ea44c69

Please sign in to comment.