Skip to content

Commit

Permalink
Embolden tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
partim committed Jun 11, 2024
1 parent 175e449 commit 8cabb02
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/repository/crl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ mod signer_test {

#[test]
fn build_ta_cert() {
// CRL with two CrlEntries.
let signer = OpenSslSigner::new();
let key = signer.create_key(PublicKeyFormat::Rsa).unwrap();
let pubkey = signer.get_key_info(&key).unwrap();
Expand All @@ -828,13 +829,21 @@ mod signer_test {
pubkey.to_subject_name(),
Time::now(),
Time::tomorrow(),
vec![CrlEntry::new(12u64.into(), Time::now())],
vec![
CrlEntry::new(12u64.into(), Time::now()),
CrlEntry::new(42u64.into(), Time::now())
],
pubkey.key_identifier(),
12u64.into()
);
let crl = crl.into_crl(&signer, &key).unwrap().to_captured();
let _crl = Crl::decode(crl.as_slice()).unwrap();
let crl = Crl::decode(crl.as_slice()).unwrap();
assert_eq!(
crl.revoked_certs().iter().collect::<Vec<_>>().len(),
2
);

// CRL with no CrlEntries.
let crl = TbsCertList::new(
Default::default(),
pubkey.to_subject_name(),
Expand All @@ -845,7 +854,8 @@ mod signer_test {
12u64.into()
);
let crl = crl.into_crl(&signer, &key).unwrap().to_captured();
let _crl = Crl::decode(crl.as_slice()).unwrap();
let crl = Crl::decode(crl.as_slice()).unwrap();
assert!(crl.revoked_certs().iter().next().is_none());
}
}

0 comments on commit 8cabb02

Please sign in to comment.