summaryrefslogtreecommitdiffstats
path: root/openpgp/src/policy.rs
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-03-13 14:13:05 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-03-13 14:19:47 +0100
commit9279d898e30abe61e68cabcd7911ae2d9e9ab222 (patch)
treea8282c4f5fa7fec0f6680c8db9601bfaff384a39 /openpgp/src/policy.rs
parent1b6683e5ac362ebed79ad8d42018728b0db7a16e (diff)
openpgp: Add a Null Policy.
- Add a new Null Policy, which accepts everything.
Diffstat (limited to 'openpgp/src/policy.rs')
-rw-r--r--openpgp/src/policy.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs
index 3262619c..1c66ffb8 100644
--- a/openpgp/src/policy.rs
+++ b/openpgp/src/policy.rs
@@ -935,6 +935,27 @@ impl From<AsymmetricAlgorithm> for u8 {
}
}
+/// The Null Policy.
+///
+/// Danger, here be dragons.
+///
+/// This policy imposes no additional policy, i.e., accepts
+/// everything. This includes the MD5 hash algorithm, and SED
+/// packets.
+#[derive(Debug)]
+pub struct NullPolicy {
+}
+
+impl NullPolicy {
+ /// Instantiates a new `NullPolicy`.
+ pub const fn new() -> Self {
+ NullPolicy {}
+ }
+}
+
+impl Policy for NullPolicy {
+}
+
#[cfg(test)]
mod test {
use std::io::Read;