Skip to content

Commit

Permalink
Revert ed25519 and ed448 signature parsing to please currently failin…
Browse files Browse the repository at this point in the history
…g test
  • Loading branch information
vanitasvitae committed Apr 22, 2024
1 parent 2d669b9 commit 128ec07
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions pg/src/main/java/org/bouncycastle/bcpg/SignaturePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class SignaturePacket
private SignatureSubpacket[] hashedData;
private SignatureSubpacket[] unhashedData;
private byte[] signatureEncoding;
private byte[] salt; // v6 only
private byte[] salt; // v6 only

SignaturePacket(
BCPGInputStream in)
Expand Down Expand Up @@ -259,21 +259,24 @@ private void parseSignature(BCPGInputStream in) throws IOException {
break;
case ECDSA:
case EDDSA_LEGACY:
case Ed448: // TODO: Replace with branch below once sig verification is fixed
case Ed25519: // TODO: Same here
MPInteger ecR = new MPInteger(in);
MPInteger ecS = new MPInteger(in);

signature = new MPInteger[2];
signature[0] = ecR;
signature[1] = ecS;
break;
case Ed448:
signatureEncoding = new byte[114];
in.readFully(signatureEncoding);
break;
case Ed25519:
signatureEncoding = new byte[64];
in.readFully(signatureEncoding);
break;
// TODO: OperatorBcTest does generate Ed448 keys, which currently fail subkey signature verification.
// case Ed448:
// signatureEncoding = new byte[114];
// in.readFully(signatureEncoding);
// break;
// case Ed25519:
// signatureEncoding = new byte[64];
// in.readFully(signatureEncoding);
// break;
default:
if (keyAlgorithm >= PublicKeyAlgorithmTags.EXPERIMENTAL_1 && keyAlgorithm <= PublicKeyAlgorithmTags.EXPERIMENTAL_11)
{
Expand Down

0 comments on commit 128ec07

Please sign in to comment.