Skip to content

Commit 53284a3

Browse files
committed
Rm test which is no longer testing desired behavior
1 parent 46beafd commit 53284a3

1 file changed

Lines changed: 0 additions & 72 deletions

File tree

crates/attested-tls/src/lib.rs

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,78 +1714,6 @@ mod tests {
17141714
.unwrap();
17151715
}
17161716

1717-
#[tokio::test(flavor = "multi_thread")]
1718-
async fn sync_verifier_cache_miss_fails_then_succeeds_after_background_fetch() {
1719-
let provider: Arc<CryptoProvider> = aws_lc_rs::default_provider().into();
1720-
let key_pair = KeyPair::generate_for(&PKCS_ECDSA_P256_SHA256).unwrap();
1721-
let resolver = AttestedCertificateResolver::build(
1722-
"foo",
1723-
AttestationGenerator::new(AttestationType::DcapTdx, None).unwrap(),
1724-
)
1725-
.with_crypto_provider(provider.clone())
1726-
.with_key_pair(&key_pair)
1727-
.with_certificate_validity(Duration::from_secs(4))
1728-
.finish()
1729-
.unwrap();
1730-
let cert = resolver.state.certificate.read().unwrap().first().unwrap().clone();
1731-
1732-
// Mock PCS is set up to not list the FMSPCs, meaning the pre-warm
1733-
// wont fetch anything
1734-
let mock_pcs = spawn_mock_pcs_server(MockPcsConfig {
1735-
include_fmspcs_listing: false,
1736-
..MockPcsConfig::default()
1737-
})
1738-
.await
1739-
.unwrap();
1740-
1741-
let verifier = AttestedCertificateVerifier::build(AttestationVerifier::mock_with_pccs(
1742-
mock_pcs.base_url.clone(),
1743-
))
1744-
.with_crypto_provider(provider)
1745-
.finish()
1746-
.unwrap();
1747-
1748-
let first_result = verify_server_cert_direct(
1749-
&verifier,
1750-
&cert,
1751-
&ServerName::try_from("foo").unwrap(),
1752-
UnixTime::now(),
1753-
);
1754-
1755-
// Initially verification fails because the PCCS doesn't have the
1756-
// collateral associated with the quote
1757-
assert_eq!(
1758-
first_result.unwrap_err(),
1759-
Error::InvalidCertificate(CertificateError::ApplicationVerificationFailure)
1760-
);
1761-
1762-
// Now we wait a moment for the PCCS to fetch it in the background
1763-
for _ in 0..50 {
1764-
if verify_server_cert_direct(
1765-
&verifier,
1766-
&cert,
1767-
&ServerName::try_from("foo").unwrap(),
1768-
UnixTime::now(),
1769-
)
1770-
.is_ok()
1771-
{
1772-
break;
1773-
}
1774-
tokio::time::sleep(Duration::from_millis(20)).await;
1775-
}
1776-
1777-
// Now verification succeeds
1778-
verify_server_cert_direct(
1779-
&verifier,
1780-
&cert,
1781-
&ServerName::try_from("foo").unwrap(),
1782-
UnixTime::now(),
1783-
)
1784-
.unwrap();
1785-
assert_eq!(mock_pcs.tcb_call_count(), 1);
1786-
assert_eq!(mock_pcs.qe_call_count(), 1);
1787-
}
1788-
17891717
/// Helper to create a private certificate authority
17901718
fn test_ca() -> CaCert {
17911719
let key = KeyPair::generate_for(&PKCS_ECDSA_P256_SHA256).unwrap();

0 commit comments

Comments
 (0)