summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-01-07 14:54:04 +0100
committerJustus Winter <justus@sequoia-pgp.org>2022-01-10 15:13:05 +0100
commit4098dbaa63010f35cf36909eb364938f4faa9d79 (patch)
treef6a1bb85fe9815db8c8127525b0bbea94cdea872
parent0688296ced91ac933a1c81688015d2f02df48b19 (diff)
openpgp: Deduplicate code parsing fingerprints.
-rw-r--r--openpgp/src/parse.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs
index 1fe8899d..3afc077c 100644
--- a/openpgp/src/parse.rs
+++ b/openpgp/src/parse.rs
@@ -1719,12 +1719,7 @@ impl Subpacket {
}
let bytes = php.parse_bytes("issuer fp", len - 1)?;
SubpacketValue::IssuerFingerprint(
- match version {
- 4 => Fingerprint::from_bytes(&bytes),
- // XXX: Fix once we dig V5.
- 5 => Fingerprint::Invalid(bytes.into()),
- _ => Fingerprint::Invalid(bytes.into()),
- })
+ Fingerprint::from_bytes(&bytes))
},
SubpacketTag::PreferredAEADAlgorithms =>
SubpacketValue::PreferredAEADAlgorithms(
@@ -1750,12 +1745,7 @@ impl Subpacket {
}
let bytes = php.parse_bytes("intended rcpt", len - 1)?;
SubpacketValue::IntendedRecipient(
- match version {
- 4 => Fingerprint::from_bytes(&bytes),
- // XXX: Fix once we dig V5.
- 5 => Fingerprint::Invalid(bytes.into()),
- _ => Fingerprint::Invalid(bytes.into()),
- })
+ Fingerprint::from_bytes(&bytes))
},
SubpacketTag::AttestedCertifications => {
// If we don't know the hash algorithm, put all digest