Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Commit 5d820a7

Browse files
committed
fix: graceful handling of Sigstore init failures
Do not crash when Sigstore initialization fails. Fixes #1300 Signed-off-by: Flavio Castelli <fcastelli@suse.com>
1 parent 28152ae commit 5d820a7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,12 @@ async fn create_sigstore_trustroot(config: &Config) -> Result<Arc<ManualTrustRoo
330330

331331
let fulcio_certs: Vec<rustls_pki_types::CertificateDer> = repo
332332
.fulcio_certs()
333-
.expect("Cannot fetch Fulcio certificates from TUF repository")
333+
.map_err(|e| {
334+
anyhow!(
335+
"Cannot fetch Fulcio certificates from TUF repository: {}",
336+
e
337+
)
338+
})?
334339
.into_iter()
335340
.map(|c| c.into_owned())
336341
.collect();
@@ -339,7 +344,7 @@ async fn create_sigstore_trustroot(config: &Config) -> Result<Arc<ManualTrustRoo
339344
fulcio_certs,
340345
rekor_keys: repo
341346
.rekor_keys()
342-
.expect("Cannot fetch Rekor keys from TUF repository")
347+
.map_err(|e| anyhow!("Cannot fetch Rekor keys from TUF repository: {}", e))?
343348
.iter()
344349
.map(|k| k.to_vec())
345350
.collect(),

0 commit comments

Comments
 (0)