1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

Document workaround for BCs ECUtil.getCurveName() returning null for ed25519 keys

See https://github.com/bcgit/bc-java/issues/1087
This commit is contained in:
Paul Schaub 2022-01-10 14:51:17 +01:00
parent 01839728f0
commit bbc42fd8e4

View file

@ -89,12 +89,19 @@ public class KeyInfo {
public static String getCurveName(ECPublicBCPGKey key) {
ASN1ObjectIdentifier identifier = key.getCurveOID();
String curveName = ECUtil.getCurveName(identifier);
if (curveName != null) {
return curveName;
}
// Workaround for ECUtil not recognizing ed25519
// see https://github.com/bcgit/bc-java/issues/1087
// TODO: Remove once BC 1.71 gets released and contains a fix
if (identifier.equals(GNUObjectIdentifiers.Ed25519)) {
return EdDSACurve._Ed25519.getName();
}
return ECUtil.getCurveName(identifier);
return null;
}
/**