Skip to content

Commit 8004fb3

Browse files
committed
Rename named curve lookup method
1 parent a32e9b6 commit 8004fb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pg/src/main/java/org/bouncycastle/openpgp/operator/jcajce/JcaPGPKeyConverter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,10 @@ private BCPGKey getPublicBCPGKey(int algorithm, PGPAlgorithmParameters algorithm
557557
ASN1ObjectIdentifier curveOid;
558558
curveOid = ASN1ObjectIdentifier.getInstance(enc);
559559

560-
// ecPublicKey is not specific enough. Drill down to find proper OID.
560+
// BCECPublicKey uses explicit parameter encoding, so we need to find the named curve manually
561561
if (X9ObjectIdentifiers.id_ecPublicKey.equals(curveOid))
562562
{
563-
enc = getCurveOIDForBCECKey((BCECPublicKey) pubKey);
563+
enc = getNamedCurveOID((BCECPublicKey) pubKey);
564564
ASN1ObjectIdentifier nCurveOid = ASN1ObjectIdentifier.getInstance(enc);
565565
if (nCurveOid != null)
566566
{
@@ -685,7 +685,7 @@ else if (pubKey.getAlgorithm().regionMatches(true, 0, "XDH", 0, 3))
685685
}
686686
}
687687

688-
private ASN1Encodable getCurveOIDForBCECKey(BCECPublicKey pubKey)
688+
private ASN1Encodable getNamedCurveOID(BCECPublicKey pubKey)
689689
{
690690
// Iterate through all registered curves to find applicable OID
691691
Enumeration names = ECNamedCurveTable.getNames();

0 commit comments

Comments
 (0)