Skip to content

Commit acbb3ae

Browse files
committed
corrected Elgamal Signature parsing!
1 parent 3480849 commit acbb3ae

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pg/src/main/java/org/bouncycastle/bcpg/SignaturePacket.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,24 +254,15 @@ private void parseSignature(BCPGInputStream in)
254254
signature[0] = v;
255255
break;
256256
case DSA:
257+
case ELGAMAL_ENCRYPT: // yep, this really does happen sometimes.
258+
case ELGAMAL_GENERAL:
257259
MPInteger r = new MPInteger(in);
258260
MPInteger s = new MPInteger(in);
259261

260262
signature = new MPInteger[2];
261263
signature[0] = r;
262264
signature[1] = s;
263265
break;
264-
case ELGAMAL_ENCRYPT: // yep, this really does happen sometimes.
265-
case ELGAMAL_GENERAL:
266-
MPInteger p = new MPInteger(in);
267-
MPInteger g = new MPInteger(in);
268-
MPInteger y = new MPInteger(in);
269-
270-
signature = new MPInteger[3];
271-
signature[0] = p;
272-
signature[1] = g;
273-
signature[2] = y;
274-
break;
275266
case Ed448:
276267
signatureEncoding = new byte[org.bouncycastle.math.ec.rfc8032.Ed448.SIGNATURE_SIZE];
277268
in.readFully(signatureEncoding);

0 commit comments

Comments
 (0)