diff --git a/idevice/Cargo.toml b/idevice/Cargo.toml index ee7f8db..5902779 100644 --- a/idevice/Cargo.toml +++ b/idevice/Cargo.toml @@ -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"] diff --git a/idevice/src/lib.rs b/idevice/src/lib.rs index 749a31f..5d02877 100644 --- a/idevice/src/lib.rs +++ b/idevice/src/lib.rs @@ -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. diff --git a/tools/Cargo.toml b/tools/Cargo.toml index 85a225f..24f4b20 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -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"] }