1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +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) =
subpackets.apply {
for (subpacket in vector.toArray()) {
val type = SignatureSubpacket.requireFromCode(subpacket.type)
val type = SignatureSubpacket.fromCode(subpacket.type)
when (type) {
SignatureSubpacket.signatureCreationTime,
SignatureSubpacket.issuerKeyId,
@ -134,6 +134,7 @@ class SignatureSubpacketsHelper {
SignatureSubpacket.preferredAEADAlgorithms,
SignatureSubpacket.attestedCertification ->
subpackets.addResidualSubpacket(subpacket)
else -> subpackets.addResidualSubpacket(subpacket)
}
}
}