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

Bump MSRV & update dependencies #152

Merged
merged 5 commits into from
Dec 6, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.65.0" # MSRV
toolchain: "1.71.0" # MSRV
components: clippy

- name: Install cargo-ndk.
Expand Down
105 changes: 30 additions & 75 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ allow = [
"ISC",
"MIT",
"MPL-2.0",
"Unicode-DFS-2016",
"Unicode-3.0",
]
exceptions = [{ allow = ["ISC", "MIT", "OpenSSL"], name = "ring" }]

Expand Down
8 changes: 4 additions & 4 deletions rustls-platform-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["tls", "certificate", "verification", "os", "native"]
repository = "https://github.com/rustls/rustls-platform-verifier"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.64.0"
rust-version = "1.71.0"

[lib]
name = "rustls_platform_verifier"
Expand Down Expand Up @@ -37,7 +37,7 @@ once_cell = "1.9"
paste = { version = "1.0", default-features = false, optional = true } # Only used when `ffi-testing` feature is enabled

[target.'cfg(all(unix, not(target_os = "android"), not(target_vendor = "apple"), not(target_arch = "wasm32")))'.dependencies]
rustls-native-certs = "0.7"
rustls-native-certs = "0.8"
webpki = { package = "rustls-webpki", version = "0.102", default-features = false }

[target.'cfg(target_os = "android")'.dependencies]
Expand All @@ -55,9 +55,9 @@ webpki-root-certs = "0.26"
webpki-root-certs = "0.26"

[target.'cfg(any(target_vendor = "apple"))'.dependencies]
core-foundation = "0.9"
core-foundation = "0.10"
core-foundation-sys = "0.8"
security-framework = { version = "2.10", features = ["OSX_10_14"] }
security-framework = { version = "3", features = ["OSX_10_14"] }
security-framework-sys = { version = "2.10", features = ["OSX_10_14"] }

[target.'cfg(windows)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion rustls-platform-verifier/src/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl CachedClass {
}

/// Gets the cached class reference, loaded on first use
pub(super) fn get<'a: 'b, 'b>(&'a self, cx: &mut Context<'b>) -> Result<&JClass<'b>, Error> {
pub(super) fn get<'a: 'b, 'b>(&'a self, cx: &mut Context<'b>) -> Result<&'a JClass<'b>, Error> {
let class = self.class.get_or_try_init(|| -> Result<_, Error> {
let class = cx.load_class(self.name)?;

Expand Down
43 changes: 18 additions & 25 deletions rustls-platform-verifier/src/verification/others.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,34 +127,27 @@ impl Verifier {
not(target_vendor = "apple"),
not(target_arch = "wasm32"),
))]
match rustls_native_certs::load_native_certs() {
Ok(certs) => {
let (added, ignored) = root_store.add_parsable_certificates(certs);

if ignored != 0 {
log::warn!("Some CA root certificates were ignored due to errors");
}
{
let result = rustls_native_certs::load_native_certs();
let (added, ignored) = root_store.add_parsable_certificates(result.certs);
if ignored != 0 {
log::warn!("Some CA root certificates were ignored due to errors");
}

if root_store.is_empty() {
log::error!("No CA certificates were loaded from the system");
} else {
log::debug!("Loaded {added} CA certificates from the system");
}
for error in result.errors {
log::warn!("Error loading CA root certificate: {error}");
}
Err(err) => {
// This only contains a path to a system directory:
// https://github.com/rustls/rustls-native-certs/blob/bc13b9a6bfc2e1eec881597055ca49accddd972a/src/lib.rs#L91-L94
const MSG: &str = "failed to load system root certificates: ";

// Don't return an error if this fails when other roots have already been loaded via
// `new_with_extra_roots`. It leads to extra failure cases where connections would otherwise still work.
if root_store.is_empty() {
return Err(rustls::Error::General(format!("{MSG}{err}")));
} else {
log::error!("{MSG}{err}");
}

// Don't return an error if this fails when other roots have already been loaded via
// `new_with_extra_roots`. It leads to extra failure cases where connections would otherwise still work.
if root_store.is_empty() {
return Err(rustls::Error::General(
"No CA certificates were loaded from the system".to_owned(),
));
} else {
log::debug!("Loaded {added} CA certificates from the system");
}
};
}

#[cfg(target_arch = "wasm32")]
{
Expand Down