Skip to content

Commit 60997ae

Browse files
committed
Rethrow IllegalArgumentException for invalid unhashed IssuerKeyID subpacket as MalformedPacketException
1 parent 6ea921a commit 60997ae

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
@@ -214,7 +214,14 @@ else if (p instanceof SignatureCreationTime)
214214
SignatureSubpacket p = (SignatureSubpacket)vec.elementAt(i);
215215
if (p instanceof IssuerKeyID)
216216
{
217-
keyID = ((IssuerKeyID)p).getKeyID();
217+
try
218+
{
219+
keyID = ((IssuerKeyID) p).getKeyID();
220+
}
221+
catch (IllegalArgumentException e)
222+
{
223+
throw new MalformedPacketException("Malformed IssuerKeyID subpacket.", e);
224+
}
218225
}
219226

220227
unhashedData[i] = p;

0 commit comments

Comments
 (0)