Add additional debug logs

This commit is contained in:
nab138
2026-02-25 10:14:44 -05:00
parent 6c038871b4
commit 82e0183001
3 changed files with 13 additions and 2 deletions

2
Cargo.lock generated
View File

@@ -1831,7 +1831,7 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "isideload"
version = "0.2.12"
version = "0.2.13"
dependencies = [
"aes 0.9.0-rc.4",
"aes-gcm",

View File

@@ -3,7 +3,7 @@ name = "isideload"
description = "Sideload iOS/iPadOS applications"
license = "MIT"
authors = ["Nicholas Sharp <nab@nabdev.me>"]
version = "0.2.12"
version = "0.2.13"
edition = "2024"
repository = "https://github.com/nab138/isideload"
documentation = "https://docs.rs/isideload"

View File

@@ -573,8 +573,10 @@ impl AppleAccount {
.get_data("et")
.context("Failed to get encrypted token")?;
debug!("Acquired encrypted token for {}", app);
let decrypted_token = Self::decrypt_gcm(encrypted_token, session_key)
.context("Failed to decrypt app token")?;
debug!("Decrypted app token for {}", app);
let token: Dictionary = plist::from_bytes(&decrypted_token)
.context("Failed to parse decrypted app token plist")?;
@@ -653,15 +655,24 @@ impl AppleAccount {
bail!("IV is not the correct length: {} bytes", iv.len());
}
debug!(
"Decrypting GCM data with key of length {} and IV of length {}",
key.len(),
iv.len()
);
let key = aes_gcm::Key::<AesGcm<Aes256, U16>>::try_from(key)?;
debug!("GCM key created successfully");
let cipher = AesGcm::<Aes256, U16>::new(&key);
debug!("GCM cipher initialized successfully");
let nonce = Nonce::<U16>::try_from(iv)?;
debug!("GCM nonce created successfully");
let mut buf = ciphertext_and_tag.to_vec();
cipher
.decrypt_in_place(&nonce, header, &mut buf)
.map_err(|e| report!("Failed to decrypt gcm: {}", e))?;
debug!("GCM decryption successful");
Ok(buf)
}