1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-16 01:12:05 +01:00
Do not choke on unknown signature subpackets
Fixes #418
This commit is contained in:
Paul Schaub 2023-11-30 20:09:02 +01:00
parent 4f85a29e0c
commit 38db67df80
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -35,7 +35,13 @@ public class SignatureSubpacketsHelper {
public static SignatureSubpackets applyFrom(PGPSignatureSubpacketVector vector, SignatureSubpackets subpackets) { public static SignatureSubpackets applyFrom(PGPSignatureSubpacketVector vector, SignatureSubpackets subpackets) {
for (SignatureSubpacket subpacket : vector.toArray()) { for (SignatureSubpacket subpacket : vector.toArray()) {
org.pgpainless.algorithm.SignatureSubpacket type = org.pgpainless.algorithm.SignatureSubpacket.requireFromCode(subpacket.getType()); org.pgpainless.algorithm.SignatureSubpacket type = org.pgpainless.algorithm.SignatureSubpacket.fromCode(subpacket.getType());
if (type == null) {
// Unknown subpacket, ignore and just add to the residuals
subpackets.addResidualSubpacket(subpacket);
continue;
}
switch (type) { switch (type) {
case signatureCreationTime: case signatureCreationTime:
case issuerKeyId: case issuerKeyId: