From 90105c50559da50d7e601dca6a27040e03e430a1 Mon Sep 17 00:00:00 2001 From: Wiktor Kwapisiewicz Date: Fri, 11 Dec 2020 10:16:40 +0100 Subject: openpgp: Suggest StandardPolicy in NullPolicy docs. - Fixes #473. --- openpgp/src/policy.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs index e980b99e..6aa027cd 100644 --- a/openpgp/src/policy.rs +++ b/openpgp/src/policy.rs @@ -1344,6 +1344,17 @@ impl From for u8 { /// This policy imposes no additional policy, i.e., accepts /// everything. This includes the MD5 hash algorithm, and SED /// packets. +/// +/// The Null policy has a limited set of valid use cases, e.g., packet statistics. +/// For other purposes, it is more advisable to use the [`StandardPolicy`] and +/// adjust it by selectively allowing items considered insecure by default, e.g., +/// via [`StandardPolicy::accept_hash`] function. If this is still too inflexible +/// consider creating a specialized policy based on the [`StandardPolicy`] as +/// [the example for `StandardPolicy`] illustrates. +/// +/// [`StandardPolicy`]: struct.StandardPolicy.html +/// [`StandardPolicy::accept_hash`]: struct.StandardPolicy.html#method.accept_hash +/// [the example for `StandardPolicy`]: struct.StandardPolicy.html#examples #[derive(Debug)] pub struct NullPolicy { } -- cgit v1.2.3