summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-09-20 22:06:13 +0200
committerGravatar Martin Szulecki2012-11-07 22:21:24 +0100
commit85a62da6ab6f0181d746ea6d83cbd07aec3a7937 (patch)
tree2a4a8effdc98d907ea33662edcea46061bad9ae8 /src
parent9770d4cd4a50e030b46610073ad9731d09eb2635 (diff)
downloadidevicerestore-85a62da6ab6f0181d746ea6d83cbd07aec3a7937.tar.gz
idevicerestore-85a62da6ab6f0181d746ea6d83cbd07aec3a7937.tar.bz2
idevicerestore: Send ApTicket if applicable before iBEC
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c7
-rw-r--r--src/recovery.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 3ed0f7e..0749fe0 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -741,6 +741,13 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
if (client->mode->index == MODE_DFU) {
client->mode = &idevicerestore_modes[MODE_RECOVERY];
} else {
+ if ((client->build_major > 8) && !(client->flags & FLAG_CUSTOM)) {
+ /* send ApTicket */
+ if (recovery_send_ticket(client) < 0) {
+ error("WARNING: Unable to send APTicket\n");
+ }
+ }
+
/* now we load the iBEC */
if (recovery_send_ibec(client, build_identity) < 0) {
error("ERROR: Unable to send iBEC\n");
diff --git a/src/recovery.h b/src/recovery.h
index ed6432f..0adc335 100644
--- a/src/recovery.h
+++ b/src/recovery.h
@@ -48,6 +48,7 @@ int recovery_send_devicetree(struct idevicerestore_client_t* client, plist_t bui
int recovery_send_ramdisk(struct idevicerestore_client_t* client, plist_t build_identity);
int recovery_send_kernelcache(struct idevicerestore_client_t* client, plist_t build_identity);
int recovery_send_reset(struct idevicerestore_client_t* client);
+int recovery_send_ticket(struct idevicerestore_client_t* client);
int recovery_get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid);
int recovery_get_nonce(struct idevicerestore_client_t* client, unsigned char** nonce, int* nonce_size);
int recovery_get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid);