1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-23 03:17:58 +01:00

Do not choke on unknown signature subpackets

Fixes #418
This commit is contained in:
Paul Schaub 2023-11-30 19:36:01 +01:00
parent f39d2c5566
commit 74c7b025a0
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -17,7 +17,7 @@ class SignatureSubpacketsHelper {
fun applyFrom(vector: PGPSignatureSubpacketVector, subpackets: SignatureSubpackets) = fun applyFrom(vector: PGPSignatureSubpacketVector, subpackets: SignatureSubpackets) =
subpackets.apply { subpackets.apply {
for (subpacket in vector.toArray()) { for (subpacket in vector.toArray()) {
val type = SignatureSubpacket.requireFromCode(subpacket.type) val type = SignatureSubpacket.fromCode(subpacket.type)
when (type) { when (type) {
SignatureSubpacket.signatureCreationTime, SignatureSubpacket.signatureCreationTime,
SignatureSubpacket.issuerKeyId, SignatureSubpacket.issuerKeyId,
@ -134,6 +134,7 @@ class SignatureSubpacketsHelper {
SignatureSubpacket.preferredAEADAlgorithms, SignatureSubpacket.preferredAEADAlgorithms,
SignatureSubpacket.attestedCertification -> SignatureSubpacket.attestedCertification ->
subpackets.addResidualSubpacket(subpacket) subpackets.addResidualSubpacket(subpacket)
else -> subpackets.addResidualSubpacket(subpacket)
} }
} }
} }