Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev-dependencies #70

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ rustls-pemfile = "1"
[dev-dependencies]
ring = "0.16.5"
rustls = "0.21.0"
rustls-webpki = "0.100"
rustls-webpki = "0.101"
serial_test = "2"
untrusted = "0.7.0" # stick to the version ring depends on for now
webpki-roots = "0.23"
webpki-roots = "0.25"
x509-parser = "0.15"

[target.'cfg(windows)'.dependencies]
Expand Down
19 changes: 5 additions & 14 deletions tests/compare_mozilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,13 @@ fn stringify_x500name(subject: &[u8]) -> String {
parts.join(", ")
}

fn to_map<'a>(
anchors: &'a [webpki::TrustAnchor<'a>],
) -> HashMap<Vec<u8>, &'a webpki::TrustAnchor<'a>> {
let mut r = HashMap::new();

for anchor in anchors {
r.insert(anchor.spki.to_vec(), anchor);
}

r
}

#[test]
fn test_does_not_have_many_roots_unknown_by_mozilla() {
let native = rustls_native_certs::load_native_certs().unwrap();
let mozilla = to_map(webpki_roots::TLS_SERVER_ROOTS.0);
let mozilla = webpki_roots::TLS_SERVER_ROOTS
.iter()
.map(|ta| (ta.spki, ta))
.collect::<HashMap<_, _>>();

let mut missing_in_moz_roots = 0;

Expand Down Expand Up @@ -113,7 +104,7 @@ fn test_contains_most_roots_known_by_mozilla() {
}

let mut missing_in_native_roots = 0;
let mozilla = webpki_roots::TLS_SERVER_ROOTS.0;
let mozilla = webpki_roots::TLS_SERVER_ROOTS;
for cert in mozilla {
if native_map.get(cert.spki).is_none() {
println!(
Expand Down