summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/recovery.c17
-rw-r--r--src/recovery.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/recovery.c b/src/recovery.c
index dd544c1..51d2d1a 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -383,6 +383,23 @@ 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) {
+ 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(client->recovery->client, nonce, nonce_size);
+ if (recovery_error != IRECV_E_SUCCESS) {
+ return -1;
+ }
+
+ return 0;
+}
+
int recovery_get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid) {
irecv_error_t recovery_error = IRECV_E_SUCCESS;
diff --git a/src/recovery.h b/src/recovery.h
index 118ed4f..9018351 100644
--- a/src/recovery.h
+++ b/src/recovery.h
@@ -51,6 +51,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_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);
int recovery_get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid);