Skip to content

Commit 151a8d9

Browse files
ErikEversoncpu
authored andcommitted
tvOS support
Updated security-framework to 2.10 Added cfg target os for tvOS
1 parent e2c0224 commit 151a8d9

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rustls-platform-verifier/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ base64 = { version = "0.21", optional = true } # Only used when the `cert-loggin
3535
jni = { version = "0.19", default-features = false, optional = true } # Only used during doc generation
3636
once_cell = "1.9"
3737

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

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

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

6161
[target.'cfg(windows)'.dependencies]
6262
winapi = { version = "0.3", features = ["wincrypt", "winerror"] }

rustls-platform-verifier/src/tests/verification_mock/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
//! any parts of the system outside of these tests. See the `#![cfg(...)]`
1414
//! immediately below to see which platforms run these tests.
1515
16-
#![cfg(all(any(windows, unix, target_os = "android"), not(target_os = "ios")))]
16+
#![cfg(all(
17+
any(windows, unix, target_os = "android"),
18+
not(target_os = "ios"),
19+
not(target_os = "tvos")
20+
))]
1721

1822
use super::TestCase;
1923
use crate::tests::{assert_cert_error_eq, ensure_global_state, verification_time};

rustls-platform-verifier/src/verification/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@ use std::sync::Arc;
55
any(unix, target_arch = "wasm32"),
66
not(target_os = "android"),
77
not(target_os = "macos"),
8-
not(target_os = "ios")
8+
not(target_os = "ios"),
9+
not(target_os = "tvos")
910
))]
1011
mod others;
1112

1213
#[cfg(all(
1314
any(unix, target_arch = "wasm32"),
1415
not(target_os = "android"),
1516
not(target_os = "macos"),
16-
not(target_os = "ios")
17+
not(target_os = "ios"),
18+
not(target_os = "tvos")
1719
))]
1820
pub use others::Verifier;
1921

20-
#[cfg(any(target_os = "macos", target_os = "ios"))]
22+
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
2123
mod apple;
2224

23-
#[cfg(any(target_os = "macos", target_os = "ios"))]
25+
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
2426
pub use apple::Verifier;
2527

2628
#[cfg(target_os = "android")]
@@ -64,7 +66,7 @@ fn log_server_cert(_end_entity: &rustls::pki_types::CertificateDer<'_>) {
6466

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

0 commit comments

Comments
 (0)