summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
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;
}