summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-02 20:17:37 +0100
committerGravatar Nikias Bassen2012-02-02 20:17:37 +0100
commit482268c18b1f45364ea505a687704586f4f1017b (patch)
tree24b8755efc82098927ada069ef4ac0c2f5309c24 /src
parenta2ee90f60d1efa1e642b8e44882607c620f75414 (diff)
downloadidevicerestore-482268c18b1f45364ea505a687704586f4f1017b.tar.gz
idevicerestore-482268c18b1f45364ea505a687704586f4f1017b.tar.bz2
recovery: add recovery_get_nonce() function
Diffstat (limited to 'src')
-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);