forked from I2P_Developers/i2p.i2p
Crypto: Avoid java-to-i2p ECDSA privkey conversion when generating CRL,
failing on Android for unknown reasons (ticket #2296)
This commit is contained in:
@@ -233,7 +233,7 @@ public final class SelfSignedGenerator {
|
||||
} catch (IllegalArgumentException iae) {
|
||||
throw new GeneralSecurityException("cert error", iae);
|
||||
}
|
||||
X509CRL crl = generateCRL(cert, validDays, 1, sigoid, jpriv);
|
||||
X509CRL crl = generateCRL(cert, validDays, 1, sigoid, priv);
|
||||
|
||||
// some simple tests
|
||||
PublicKey cpub = cert.getPublicKey();
|
||||
@@ -281,10 +281,7 @@ public final class SelfSignedGenerator {
|
||||
* Generate a CRL for the given cert, signed with the given private key
|
||||
*/
|
||||
private static X509CRL generateCRL(X509Certificate cert, int validDays, int crlNum,
|
||||
byte[] sigoid, PrivateKey jpriv) throws GeneralSecurityException {
|
||||
|
||||
SigningPrivateKey priv = SigUtil.fromJavaKey(jpriv);
|
||||
|
||||
byte[] sigoid, SigningPrivateKey priv) throws GeneralSecurityException {
|
||||
byte[] tbs = genTBSCRL(cert, validDays, crlNum, sigoid);
|
||||
int tbslen = tbs.length;
|
||||
|
||||
|
||||
@@ -189,8 +189,10 @@ public final class SigUtil {
|
||||
type = SigType.ECDSA_SHA384_P384;
|
||||
else if (spec.equals(SigType.ECDSA_SHA512_P521.getParams()))
|
||||
type = SigType.ECDSA_SHA512_P521;
|
||||
else
|
||||
else {
|
||||
// failing on Android (ticket #2296)
|
||||
throw new IllegalArgumentException("Unknown EC type: " + pk.getClass() + " spec: " + spec.getClass());
|
||||
}
|
||||
return fromJavaKey(k, type);
|
||||
}
|
||||
if (pk instanceof EdDSAPrivateKey) {
|
||||
|
||||
Reference in New Issue
Block a user