summaryrefslogtreecommitdiffstats
path: root/openpgp/tests/data/messages
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2018-04-14 17:20:04 +0200
committerNeal H. Walfield <neal@pep.foundation>2018-04-14 17:26:29 +0200
commit5efdde2474615a1551cc6bcf868429472fe44fbb (patch)
tree4af6ba8ac3833d1e459e71c3cf47b6068dd9d1c3 /openpgp/tests/data/messages
parentf340cfb86c805bd29ca48a8017a9827c0093e980 (diff)
openpgp: Add support for OnePassSig packets.
- Handling OnePassSig packets in an unbuffered manner introduces a layering violation: when we encounter a OnePassSig packet, we want to push a HashedReader on the BufferedReader stack, but that is popped when the readers associated with the OnePassSig are popped! Thus, we need to introduce a bit of ugliness (OnePassSig::parse needs to pop its readers and then push the HashedReader at the high level). This is unfortunate, but it appears to be necessary. - Hashing literal data packets is ugly! Only the content of a literal data packet is hashed; neither the packet's headers, the packet's meta-data nor the length information is included in the hash. This, in particular, adds some ugliness to the BufferedReaderPartialBodyFilter implementation: it needs to disable hashing when decoding a literal data packet. - This implementation has several limitations: - We only handle a single level of Signature nesting. That is, we don't support things like having two OnePassSig packets, both of which have their 'last' bit set (meaning that the outer signature is over the inner Signature and the content, not just the content). If the parser encounters such a message, it silently ignores the nesting. In practice, this functionality is rarely used: GnuPG neither produces such messages nor does it correctly handle them. - Each OnePassSig packet pushes another HashedReader on the BufferedReader stack. This can cause a stack overflow if there are too many OnePassSig packets. Instead, there should only be a single HashedReader per level of nesting, and the amount of nesting must be limited. - If there are multiple OnePassSig packets at a nesting level using the same hash algorithm, we don't reuse hashes, because Nettle doesn't currently support cloning hashes.
Diffstat (limited to 'openpgp/tests/data/messages')
-rw-r--r--openpgp/tests/data/messages/signed-1.gpgbin0 -> 5519 bytes
-rw-r--r--openpgp/tests/data/messages/signed-2-partial-body.gpgbin0 -> 5493 bytes
-rw-r--r--openpgp/tests/data/messages/signed-3-partial-body-multiple-sigs.gpgbin0 -> 2868 bytes
3 files changed, 0 insertions, 0 deletions
diff --git a/openpgp/tests/data/messages/signed-1.gpg b/openpgp/tests/data/messages/signed-1.gpg
new file mode 100644
index 00000000..9728be18
--- /dev/null
+++ b/openpgp/tests/data/messages/signed-1.gpg
Binary files differ
diff --git a/openpgp/tests/data/messages/signed-2-partial-body.gpg b/openpgp/tests/data/messages/signed-2-partial-body.gpg
new file mode 100644
index 00000000..06aa84be
--- /dev/null
+++ b/openpgp/tests/data/messages/signed-2-partial-body.gpg
Binary files differ
diff --git a/openpgp/tests/data/messages/signed-3-partial-body-multiple-sigs.gpg b/openpgp/tests/data/messages/signed-3-partial-body-multiple-sigs.gpg
new file mode 100644
index 00000000..e3df57f8
--- /dev/null
+++ b/openpgp/tests/data/messages/signed-3-partial-body-multiple-sigs.gpg
Binary files differ