Skip to content

Commit ed5fed1

Browse files
committed
Rethrow IllegalArgumentException for invalid unhashed IssuerKeyID subpacket as MalformedPacketException
1 parent 20b5879 commit ed5fed1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,14 @@ else if (p instanceof SignatureCreationTime)
213213
SignatureSubpacket p = (SignatureSubpacket)vec.elementAt(i);
214214
if (p instanceof IssuerKeyID)
215215
{
216-
keyID = ((IssuerKeyID)p).getKeyID();
216+
try
217+
{
218+
keyID = ((IssuerKeyID) p).getKeyID();
219+
}
220+
catch (IllegalArgumentException e)
221+
{
222+
throw new MalformedPacketException("Malformed IssuerKeyID subpacket.", e);
223+
}
217224
}
218225

219226
unhashedData[i] = p;

0 commit comments

Comments
 (0)