Skip to content

Commit

Permalink
conformance: validated verify subcommand
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Leightcap <[email protected]>
  • Loading branch information
jleightcap committed Jul 28, 2023
1 parent e6402df commit e4a1816
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/conformance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "Apache-2.0"

[dependencies]
anyhow = { version = "1.0", features = ["backtrace"] }
base64 = "0.21.0"
clap = { version = "4.0.8", features = ["derive"] }
sigstore = { path = "../../" }
tokio = { version = "1.17.0", features = ["rt"] }
Expand Down
3 changes: 3 additions & 0 deletions tests/conformance/conformance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// https://github.com/sigstore/sigstore-conformance/blob/main/docs/cli_protocol.md

extern crate tracing_subscriber;
use base64::{engine::general_purpose::STANDARD as BASE64_STD_ENGINE, Engine as _};
use clap::{Parser, Subcommand};
use std::fs;
use tracing_subscriber::prelude::*;
Expand Down Expand Up @@ -144,7 +145,9 @@ pub async fn main() -> anyhow::Result<()> {
artifact,
}) => {
let certificate = fs::read_to_string(certificate)?;
let certificate = BASE64_STD_ENGINE.encode(certificate);
let signature = fs::read_to_string(signature)?;
let signature = signature.trim(); // https://github.com/sigstore/sigstore-rs/issues/288
let artifact = fs::read(artifact)?;

Client::verify_blob(&certificate, &signature, &artifact)?;
Expand Down

0 comments on commit e4a1816

Please sign in to comment.