summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-02-16 12:11:23 +0100
committerJustus Winter <justus@sequoia-pgp.org>2022-02-16 12:31:19 +0100
commit72c829e39f3628f6bc8400b67045230f4449e8dc (patch)
treec11c78e0254b85c294bb62e8a9fef27fa8fdddbd /openpgp/src/parse.rs
parent579113cd358d873f75b61a5688e86e934d04baa5 (diff)
openpgp: Fix verifying cleartext signed messages with multiple sigs.
- We implement the cleartext signature framework by transforming the message on the fly to a signed message, then using our parsing framework as usual. However, we need to tweak the behavior slightly. - Notably, our CSF transformation yields just one OPS packet per encountered 'Hash' algorithm header, and it cannot know how many signatures are in fact following. Therefore, the message will not be well-formed according to the grammar. But, since we created the message structure during the transformation, we know it is good, even if it is a little out of spec. - This patch tweaks the streaming verifier's behavior to accommodate this.
Diffstat (limited to 'openpgp/src/parse.rs')
-rw-r--r--openpgp/src/parse.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs
index 3e5eead6..eaa10d29 100644
--- a/openpgp/src/parse.rs
+++ b/openpgp/src/parse.rs
@@ -4922,6 +4922,12 @@ impl <'a> PacketParser<'a> {
pub fn take_map(&mut self) -> Option<map::Map> {
self.map.take()
}
+
+ /// Checks if we are processing a signed message using the
+ /// Cleartext Signature Framework.
+ pub(crate) fn processing_csf_message(&self) -> bool {
+ Cookie::processing_csf_message(&self.reader)
+ }
}
/// This interface allows a caller to read the content of a