Use sequoia-policy-config to configure the StandardPolicy.

- This allows users to tweak the StandardPolicy used by Sequoia to
    evaluate cryptographic artifacts.  For example, on Fedora it will
    adhere to the system-wide cryptographic policy for Sequoia.

  - Fixes #128.
This commit is contained in:
Justus Winter 2023-11-20 18:31:11 +01:00
parent e9aa4a624e
commit 55eca2c87e
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386
3 changed files with 6 additions and 2 deletions

1
Cargo.lock generated
View File

@ -2977,6 +2977,7 @@ dependencies = [
"sequoia-cert-store",
"sequoia-net",
"sequoia-openpgp",
"sequoia-policy-config",
"sequoia-wot",
"serde",
"serde_json",

View File

@ -35,6 +35,7 @@ dot-writer = "0.1.3"
sequoia-openpgp = { version = "1.13", default-features = false, features = ["compression-deflate"] }
sequoia-autocrypt = { version = "0.25", default-features = false, optional = true }
sequoia-net = { version = "0.27", default-features = false }
sequoia-policy-config = "0.6"
anyhow = "1.0.18"
chrono = "0.4.10"
# For an MSRV of 1.63: 4.0.32.

View File

@ -1002,7 +1002,9 @@ fn main() -> Result<()> {
.into()
};
let policy = &mut P::at(time);
let mut policy = sequoia_policy_config::ConfiguredStandardPolicy::new();
policy.parse_default_config()?;
let mut policy = policy.build();
let known_notations = c.known_notation
.iter()
@ -1022,7 +1024,7 @@ fn main() -> Result<()> {
force,
output_format,
output_version,
policy: policy.clone(),
policy,
time,
no_rw_cert_store: c.no_cert_store,
cert_store_path: c.cert_store.clone(),