summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-02-14 16:21:44 +0100
committerJustus Winter <justus@sequoia-pgp.org>2023-02-14 16:45:05 +0100
commitb4aa5810aa10a8c319dc62b9b7d4f18d389b9c32 (patch)
tree74bd71031cc82e36d7ba01111c80a07538dd5b6e
parent6536f5e00152b77fb88d7e420334649b41c12ad1 (diff)
openpgp: Don't check subpacket area length when parsing.
- Previously, we checked that the subpacket area fits a v4 signature when parsing. However, the subpacket area size depends on the packet version, and our SubpacketArea is independent of the signature version. - The size will be checked when serializing the signatures. It is not useful to check them when parsing the signatures.
-rw-r--r--openpgp/src/packet/signature/subpacket.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs
index d36755de..e2c8e73a 100644
--- a/openpgp/src/packet/signature/subpacket.rs
+++ b/openpgp/src/packet/signature/subpacket.rs
@@ -673,13 +673,7 @@ impl SubpacketArea {
packets,
parsed: Mutex::new(RefCell::new(None)),
};
- if area.serialized_len() > std::u16::MAX as usize {
- Err(Error::InvalidArgument(
- format!("Subpacket area exceeds maximum size: {}",
- area.serialized_len())).into())
- } else {
- Ok(area)
- }
+ Ok(area)
}
// Initialize `Signature::hashed_area_parsed` from