Skip to content

Commit

Permalink
tuf: add CTFE to ManualRepository
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Pan <andrew.pan@trailofbits.com>
  • Loading branch information
tnytown committed Feb 14, 2024
1 parent 152003e commit 3a714c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tuf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub trait Repository {
pub struct ManualRepository<'a> {
pub fulcio_certs: Option<Vec<CertificateDer<'a>>>,
pub rekor_key: Option<Vec<u8>>,
pub ctfe_keys: Option<Vec<Vec<u8>>>,
}

impl Repository for ManualRepository<'_> {
Expand All @@ -82,7 +83,10 @@ impl Repository for ManualRepository<'_> {
}

fn ctfe_keys(&self) -> Result<Vec<&[u8]>> {
todo!()
Ok(match &self.ctfe_keys {
Some(keys) => keys.iter().map(|v| &v[..]).collect(),
None => Vec::new(),
})
}
}

Expand Down

0 comments on commit 3a714c2

Please sign in to comment.