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 .TrustPacket ;
14
15
import org .bouncycastle .bcpg .UnknownPacket ;
@@ -148,7 +149,14 @@ public Object nextObject()
148
149
case PacketTags .SYMMETRIC_KEY_ENC :
149
150
case PacketTags .SYM_ENC_INTEGRITY_PRO :
150
151
case PacketTags .AEAD_ENC_DATA :
151
- return new PGPEncryptedDataList (in );
152
+ try
153
+ {
154
+ return new PGPEncryptedDataList (in );
155
+ }
156
+ catch (IllegalArgumentException e )
157
+ {
158
+ throw new MalformedPacketException ("Malformed encrypted data." , e );
159
+ }
152
160
case PacketTags .ONE_PASS_SIGNATURE :
153
161
l = new ArrayList ();
154
162
You can’t perform that action at this time.
0 commit comments