Better error handling in get_app_token

This commit is contained in:
nab138
2026-02-18 17:22:06 -05:00
parent 386492d7ad
commit 2728965279
3 changed files with 8 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -1831,7 +1831,7 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "isideload"
version = "0.2.9"
version = "0.2.10"
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.9"
version = "0.2.10"
edition = "2024"
repository = "https://github.com/nab138/isideload"
documentation = "https://docs.rs/isideload"

View File

@@ -6,7 +6,7 @@ use crate::{
builder::AppleAccountBuilder,
grandslam::{GrandSlam, GrandSlamErrorChecker},
},
util::plist::PlistDataExtract,
util::plist::{PlistDataExtract, SensitivePlistAttachment},
};
use aes::{
Aes256,
@@ -440,7 +440,7 @@ impl AppleAccount {
let verifier = srp_client
.process_reply(&a, self.email.as_bytes(), &password_buf, salt, b_pub)
.unwrap();
.context("Failed to compute SRP proof")?;
let req2 = plist!(dict {
"Header": {
@@ -534,7 +534,8 @@ impl AppleAccount {
let c = spd.get_data("c").context("Failed to get app token")?;
let checksum = Hmac::<Sha256>::new_from_slice(session_key)
.unwrap()
.context("Failed to create HMAC for app token checksum")
.attach_with(|| SensitivePlistAttachment::new(spd.clone()))?
.chain_update("apptokens".as_bytes())
.chain_update(dsid.as_bytes())
.chain_update(app.as_bytes())
@@ -604,6 +605,8 @@ impl AppleAccount {
.context("Failed to get app token expiry")? as u64,
};
info!("Successfully retrieved app token for {}", app);
Ok(app_token)
}