diff --git a/Cargo.lock b/Cargo.lock index 831074b..c076358 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/isideload/Cargo.toml b/isideload/Cargo.toml index 5cf8804..f0bd654 100644 --- a/isideload/Cargo.toml +++ b/isideload/Cargo.toml @@ -3,7 +3,7 @@ name = "isideload" description = "Sideload iOS/iPadOS applications" license = "MIT" authors = ["Nicholas Sharp "] -version = "0.2.12" +version = "0.2.13" edition = "2024" repository = "https://github.com/nab138/isideload" documentation = "https://docs.rs/isideload" diff --git a/isideload/src/auth/apple_account.rs b/isideload/src/auth/apple_account.rs index afabf8d..8aaf252 100644 --- a/isideload/src/auth/apple_account.rs +++ b/isideload/src/auth/apple_account.rs @@ -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::>::try_from(key)?; + debug!("GCM key created successfully"); let cipher = AesGcm::::new(&key); + debug!("GCM cipher initialized successfully"); let nonce = Nonce::::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) }