mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Add ring as optional crypto provider
This commit is contained in:
@@ -13,7 +13,7 @@ keywords = ["lockdownd", "ios"]
|
||||
[dependencies]
|
||||
tokio = { version = "1.43", features = ["io-util"] }
|
||||
tokio-rustls = "0.26"
|
||||
rustls = "0.23"
|
||||
rustls = { version = "0.23", default-features = false }
|
||||
|
||||
plist = { version = "1.7" }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
@@ -56,6 +56,10 @@ tun-rs = { version = "2.0.8", features = ["async_tokio"] }
|
||||
bytes = "1.10.1"
|
||||
|
||||
[features]
|
||||
default = ["aws-lc"]
|
||||
aws-lc = ["rustls/aws-lc-rs"]
|
||||
ring = ["rustls/ring"]
|
||||
|
||||
afc = ["dep:chrono"]
|
||||
amfi = []
|
||||
core_device = ["xpc", "dep:uuid"]
|
||||
|
||||
@@ -390,9 +390,16 @@ impl Idevice {
|
||||
pairing_file: &pairing_file::PairingFile,
|
||||
) -> Result<(), IdeviceError> {
|
||||
if CryptoProvider::get_default().is_none() {
|
||||
if let Err(e) =
|
||||
CryptoProvider::install_default(rustls::crypto::aws_lc_rs::default_provider())
|
||||
{
|
||||
let crypto_provider = if cfg!(feature = "ring") {
|
||||
debug!("Using ring crypto backend");
|
||||
rustls::crypto::ring::default_provider()
|
||||
} else if cfg!(feature = "aws-lc") {
|
||||
debug!("Using aws-lc crypto backend");
|
||||
rustls::crypto::aws_lc_rs::default_provider()
|
||||
} else {
|
||||
panic!("No crypto provider compiled in! Use one of the features for idevice to specify a provider");
|
||||
};
|
||||
if let Err(e) = CryptoProvider::install_default(crypto_provider) {
|
||||
// For whatever reason, getting the default provider will return None on iOS at
|
||||
// random. Installing the default provider a second time will return an error, so
|
||||
// we will log it but not propogate it. An issue should be opened with rustls.
|
||||
|
||||
@@ -93,13 +93,9 @@ path = "src/lockdown.rs"
|
||||
name = "restore_service"
|
||||
path = "src/restore_service.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "ioreg"
|
||||
path = "src/ioreg.rs"
|
||||
|
||||
[dependencies]
|
||||
idevice = { path = "../idevice", features = ["full"] }
|
||||
tokio = { version = "1.43", features = ["io-util", "macros", "time", "full"] }
|
||||
tokio = { version = "1.43", features = ["full"] }
|
||||
log = { version = "0.4" }
|
||||
env_logger = { version = "0.11" }
|
||||
tun-rs = { version = "1.5", features = ["async"] }
|
||||
|
||||
Reference in New Issue
Block a user