diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-02-14 16:21:44 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-02-14 16:45:05 +0100 |
commit | b4aa5810aa10a8c319dc62b9b7d4f18d389b9c32 (patch) | |
tree | 74bd71031cc82e36d7ba01111c80a07538dd5b6e | |
parent | 6536f5e00152b77fb88d7e420334649b41c12ad1 (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.rs | 8 |
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 |