summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-11-18 22:51:28 +0100
committerGravatar Martin Szulecki2013-11-18 22:51:28 +0100
commit78a239bf2c64c9e37c21b2ddabbc0d76ec599afb (patch)
tree46597ee9b86be20f315d6b271fbd79ccdc835594 /src/recovery.c
parent5a6dcf255deb905e23fbedbb6dcd1e3eeabd5825 (diff)
downloadidevicerestore-78a239bf2c64c9e37c21b2ddabbc0d76ec599afb.tar.gz
idevicerestore-78a239bf2c64c9e37c21b2ddabbc0d76ec599afb.tar.bz2
Split nonce retrieval into ApNonce and SepNonce for DFU and Recovery modes
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/recovery.c b/src/recovery.c
index e4575fc..42bb234 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -461,7 +461,7 @@ int recovery_get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid) {
return 0;
}
-int recovery_get_nonce(struct idevicerestore_client_t* client, unsigned char** nonce, int* nonce_size) {
+int recovery_get_ap_nonce(struct idevicerestore_client_t* client, unsigned char** nonce, int* nonce_size) {
irecv_error_t recovery_error = IRECV_E_SUCCESS;
if(client->recovery == NULL) {
@@ -470,7 +470,24 @@ int recovery_get_nonce(struct idevicerestore_client_t* client, unsigned char** n
}
}
- recovery_error = irecv_get_nonce(client->recovery->client, nonce, nonce_size);
+ recovery_error = irecv_get_nonce_with_tag(client->recovery->client, "NONC", nonce, nonce_size);
+ if (recovery_error != IRECV_E_SUCCESS) {
+ return -1;
+ }
+
+ return 0;
+}
+
+int recovery_get_sep_nonce(struct idevicerestore_client_t* client, unsigned char** nonce, int* nonce_size) {
+ irecv_error_t recovery_error = IRECV_E_SUCCESS;
+
+ if(client->recovery == NULL) {
+ if (recovery_client_new(client) < 0) {
+ return -1;
+ }
+ }
+
+ recovery_error = irecv_get_nonce_with_tag(client->recovery->client, "SNON", nonce, nonce_size);
if (recovery_error != IRECV_E_SUCCESS) {
return -1;
}