summaryrefslogtreecommitdiffstats
path: root/ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-08-27 14:47:56 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-08-27 14:47:56 +0200
commit96160a194f0b2eacb4b0752040cb4f9032187778 (patch)
tree5e8db863f9f1b7174c74c8f55ea843bee96bb1bb /ffi
parent590732819a0dd1f517f70d7c0c68189078fe1703 (diff)
openpgp: Limit size of non-data packets.
- This introduces a configurable limit for non-data (i.e. non-container) packets. This prevents a trivial DoS on our parser, which previously assumed that all non-data packets can be buffered. - Fixes #242.
Diffstat (limited to 'ffi')
-rw-r--r--ffi/src/error.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/ffi/src/error.rs b/ffi/src/error.rs
index 6b791d97..f68f4c3d 100644
--- a/ffi/src/error.rs
+++ b/ffi/src/error.rs
@@ -32,6 +32,8 @@ impl<'a> FromSequoiaError<'a> for Status {
Status::InvalidOperation,
&openpgp::Error::MalformedPacket(_) =>
Status::MalformedPacket,
+ &openpgp::Error::PacketTooLarge(_, _, _) =>
+ Status::PacketTooLarge,
&openpgp::Error::UnsupportedPacketType(_) =>
Status::UnsupportedPacketType,
&openpgp::Error::UnsupportedHashAlgorithm(_) =>