mirror of
https://github.com/nab138/isideload.git
synced 2026-03-02 14:36:16 +01:00
Better error handling in get_app_token
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1831,7 +1831,7 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "isideload"
|
name = "isideload"
|
||||||
version = "0.2.9"
|
version = "0.2.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes 0.9.0-rc.4",
|
"aes 0.9.0-rc.4",
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name = "isideload"
|
|||||||
description = "Sideload iOS/iPadOS applications"
|
description = "Sideload iOS/iPadOS applications"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Nicholas Sharp <nab@nabdev.me>"]
|
authors = ["Nicholas Sharp <nab@nabdev.me>"]
|
||||||
version = "0.2.9"
|
version = "0.2.10"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
repository = "https://github.com/nab138/isideload"
|
repository = "https://github.com/nab138/isideload"
|
||||||
documentation = "https://docs.rs/isideload"
|
documentation = "https://docs.rs/isideload"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use crate::{
|
|||||||
builder::AppleAccountBuilder,
|
builder::AppleAccountBuilder,
|
||||||
grandslam::{GrandSlam, GrandSlamErrorChecker},
|
grandslam::{GrandSlam, GrandSlamErrorChecker},
|
||||||
},
|
},
|
||||||
util::plist::PlistDataExtract,
|
util::plist::{PlistDataExtract, SensitivePlistAttachment},
|
||||||
};
|
};
|
||||||
use aes::{
|
use aes::{
|
||||||
Aes256,
|
Aes256,
|
||||||
@@ -440,7 +440,7 @@ impl AppleAccount {
|
|||||||
|
|
||||||
let verifier = srp_client
|
let verifier = srp_client
|
||||||
.process_reply(&a, self.email.as_bytes(), &password_buf, salt, b_pub)
|
.process_reply(&a, self.email.as_bytes(), &password_buf, salt, b_pub)
|
||||||
.unwrap();
|
.context("Failed to compute SRP proof")?;
|
||||||
|
|
||||||
let req2 = plist!(dict {
|
let req2 = plist!(dict {
|
||||||
"Header": {
|
"Header": {
|
||||||
@@ -534,7 +534,8 @@ impl AppleAccount {
|
|||||||
let c = spd.get_data("c").context("Failed to get app token")?;
|
let c = spd.get_data("c").context("Failed to get app token")?;
|
||||||
|
|
||||||
let checksum = Hmac::<Sha256>::new_from_slice(session_key)
|
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("apptokens".as_bytes())
|
||||||
.chain_update(dsid.as_bytes())
|
.chain_update(dsid.as_bytes())
|
||||||
.chain_update(app.as_bytes())
|
.chain_update(app.as_bytes())
|
||||||
@@ -604,6 +605,8 @@ impl AppleAccount {
|
|||||||
.context("Failed to get app token expiry")? as u64,
|
.context("Failed to get app token expiry")? as u64,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
info!("Successfully retrieved app token for {}", app);
|
||||||
|
|
||||||
Ok(app_token)
|
Ok(app_token)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user