File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
pg/src/main/java/org/bouncycastle/openpgp Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 9
9
import java .util .NoSuchElementException ;
10
10
11
11
import org .bouncycastle .bcpg .BCPGInputStream ;
12
+ import org .bouncycastle .bcpg .MalformedPacketException ;
12
13
import org .bouncycastle .bcpg .PacketTags ;
13
14
import org .bouncycastle .bcpg .UnknownPacket ;
14
15
import org .bouncycastle .bcpg .UnsupportedPacketVersionException ;
@@ -146,7 +147,14 @@ public Object nextObject()
146
147
case PacketTags .SYMMETRIC_KEY_ENC :
147
148
case PacketTags .SYM_ENC_INTEGRITY_PRO :
148
149
case PacketTags .AEAD_ENC_DATA :
149
- return new PGPEncryptedDataList (in );
150
+ try
151
+ {
152
+ return new PGPEncryptedDataList (in );
153
+ }
154
+ catch (IllegalArgumentException e )
155
+ {
156
+ throw new MalformedPacketException ("Malformed encrypted data." , e );
157
+ }
150
158
case PacketTags .ONE_PASS_SIGNATURE :
151
159
l = new ArrayList ();
152
160
You can’t perform that action at this time.
0 commit comments