summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-04-21 15:25:40 +0200
committerJustus Winter <justus@sequoia-pgp.org>2021-04-26 13:14:42 +0200
commit1d06cec55ad133584c13d11f78297c7582e9acda (patch)
tree95faccd45bb813416268fa1f8f1e7166ab37ae28
parent710f2c60a9a00a5a4c3199f25d387fe82aa21aa0 (diff)
openpgp: New constant SubpacketAreas::MAX_SIZE.
-rw-r--r--openpgp/NEWS1
-rw-r--r--openpgp/src/packet/signature/subpacket.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/openpgp/NEWS b/openpgp/NEWS
index a505818e..2fb5b65f 100644
--- a/openpgp/NEWS
+++ b/openpgp/NEWS
@@ -8,6 +8,7 @@
- Signature::verify_userid_attestation
- SignatureBuilder::set_attested_certifications
- SignatureType::AttestationKey
+ - SubpacketAreas::MAX_SIZE
- SubpacketAreas::attested_certifications
- SubpacketTag::AttestedCertifications
- SubpacketValue::AttestedCertifications
diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs
index 2f9570ef..23dc1546 100644
--- a/openpgp/src/packet/signature/subpacket.rs
+++ b/openpgp/src/packet/signature/subpacket.rs
@@ -591,6 +591,9 @@ impl<'a> IntoIterator for &'a SubpacketArea {
}
impl SubpacketArea {
+ /// The maximum size of a subpacket area.
+ pub const MAX_SIZE: usize = (1 << 16) - 1;
+
/// Returns a new subpacket area containing the given `packets`.
pub fn new(packets: Vec<Subpacket>) -> Result<SubpacketArea> {
let area = SubpacketArea {