Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions common/src/validate/openpgp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! OpenPGP validation
use crate::utils::openpgp::PublicKey;
use crate::validate::ValidationOptions;
use crate::{utils::openpgp::PublicKey, validate::ValidationOptions};
use anyhow::bail;
use sequoia_openpgp::{
Cert, KeyHandle, Packet,
Expand All @@ -15,8 +14,9 @@ use sequoia_openpgp::{
};
use std::fmt::Debug;

struct Helper<'a> {
keys: &'a [PublicKey],
/// A verify helper for `PublicKey`.
pub struct Helper<'a> {
pub keys: &'a [PublicKey],
}

impl VerificationHelper for Helper<'_> {
Expand Down Expand Up @@ -54,8 +54,9 @@ impl VerificationHelper for Helper<'_> {
}
}

/// A wrapper policy, logging the outcome of the package call on debug level.
#[derive(Debug)]
struct LoggingPolicy<'a>(pub StandardPolicy<'a>);
pub struct LoggingPolicy<'a>(pub StandardPolicy<'a>);

impl Policy for LoggingPolicy<'_> {
fn signature(&self, sig: &Signature, sec: HashAlgoSecurity) -> sequoia_openpgp::Result<()> {
Expand Down Expand Up @@ -85,6 +86,7 @@ impl Policy for LoggingPolicy<'_> {
}
}

/// Validate a PGP signature
pub fn validate_signature(
options: &ValidationOptions,
keys: &[PublicKey],
Expand Down