Skip to content

Commit

Permalink
tvOS support
Browse files Browse the repository at this point in the history
Updated security-framework to 2.10
Added cfg target os for tvOS
  • Loading branch information
ErikEverson committed Apr 9, 2024
1 parent 50e2b02 commit c43f2cf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions rustls-platform-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ base64 = { version = "0.21", optional = true } # Only used when the `cert-loggin
jni = { version = "0.19", default-features = false, optional = true } # Only used during doc generation
once_cell = "1.9"

[target.'cfg(all(unix, not(target_os = "android"), not(target_os = "macos"), not(target_os = "ios")))'.dependencies]
[target.'cfg(all(unix, not(target_os = "android"), not(target_os = "macos"), not(target_os = "ios"), not(target_os = "tvos")))'.dependencies]
rustls-native-certs = "0.7"
webpki = { package = "rustls-webpki", version = "0.102", features = ["ring", "alloc", "std"] }

Expand All @@ -52,11 +52,11 @@ webpki-roots = "0.26"
[target.'cfg(target_os = "freebsd")'.dev-dependencies]
webpki-roots = "0.26"

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))'.dependencies]
core-foundation = "0.9"
core-foundation-sys = "0.8"
security-framework = { version = "2.6", features = ["OSX_10_14"] }
security-framework-sys = { version = "2.4", features = ["OSX_10_14"] }
security-framework = { version = "2.10", features = ["OSX_10_14"] }
security-framework-sys = { version = "2.10", features = ["OSX_10_14"] }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["wincrypt", "winerror"] }
Expand Down
6 changes: 5 additions & 1 deletion rustls-platform-verifier/src/tests/verification_mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
//! any parts of the system outside of these tests. See the `#![cfg(...)]`
//! immediately below to see which platforms run these tests.
#![cfg(all(any(windows, unix, target_os = "android"), not(target_os = "ios")))]
#![cfg(all(
any(windows, unix, target_os = "android"),
not(target_os = "ios"),
not(target_os = "tvos")
))]

use super::TestCase;
use crate::tests::{assert_cert_error_eq, ensure_global_state, verification_time};
Expand Down
12 changes: 7 additions & 5 deletions rustls-platform-verifier/src/verification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
any(unix, target_arch = "wasm32"),
not(target_os = "android"),
not(target_os = "macos"),
not(target_os = "ios")
not(target_os = "ios"),
not(target_os = "tvos")
))]
mod others;

#[cfg(all(
any(unix, target_arch = "wasm32"),
not(target_os = "android"),
not(target_os = "macos"),
not(target_os = "ios")
not(target_os = "ios"),
not(target_os = "tvos")
))]
pub use others::Verifier;

#[cfg(any(target_os = "macos", target_os = "ios"))]
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
mod apple;

#[cfg(any(target_os = "macos", target_os = "ios"))]
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
pub use apple::Verifier;

#[cfg(target_os = "android")]
Expand Down Expand Up @@ -61,7 +63,7 @@ fn log_server_cert(_end_entity: &rustls::pki_types::CertificateDer<'_>) {

// Unknown certificate error shorthand. Used when we need to construct an "Other" certificate
// error with a platform specific error message.
#[cfg(any(windows, target_os = "macos", target_os = "ios"))]
#[cfg(any(windows, target_os = "macos", target_os = "ios", target_os = "tvos"))]
fn invalid_certificate(reason: impl Into<String>) -> rustls::Error {
rustls::Error::InvalidCertificate(rustls::CertificateError::Other(rustls::OtherError(
std::sync::Arc::from(Box::from(reason.into())),
Expand Down

0 comments on commit c43f2cf

Please sign in to comment.