summaryrefslogtreecommitdiffstats
path: root/src/dfu.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-11-19 21:37:42 +0100
committerGravatar Nikias Bassen2013-11-19 21:37:42 +0100
commitaee53bef0385841109432948dbf814907a7d2dca (patch)
tree456df2f3f4ca8dda60ca93e36eeb75a7dfa8a658 /src/dfu.c
parent38e6975e2131b526d402c6f95cf4ba4acfbd997c (diff)
downloadidevicerestore-aee53bef0385841109432948dbf814907a7d2dca.tar.gz
idevicerestore-aee53bef0385841109432948dbf814907a7d2dca.tar.bz2
removed unused get_cpid/get_bdid and adapted for latest libirecovery changes
Diffstat (limited to 'src/dfu.c')
-rw-r--r--src/dfu.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/dfu.c b/src/dfu.c
index 5cea9ad..df9379e 100644
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -231,11 +231,13 @@ int dfu_get_cpid(struct idevicerestore_client_t* client, unsigned int* cpid) {
}
}
- dfu_error = irecv_get_cpid(client->dfu->client, cpid);
- if (dfu_error != IRECV_E_SUCCESS) {
+ const struct irecv_device_info *device_info = irecv_get_device_info(client->dfu->client);
+ if (!device_info) {
return -1;
}
+ *cpid = device_info->cpid;
+
return 0;
}
@@ -248,11 +250,21 @@ int dfu_get_ap_nonce(struct idevicerestore_client_t* client, unsigned char** non
}
}
- dfu_error = irecv_get_nonce_with_tag(client->dfu->client, "NONC", nonce, nonce_size);
- if (dfu_error != IRECV_E_SUCCESS) {
+
+ const struct irecv_device_info *device_info = irecv_get_device_info(client->dfu->client);
+ if (!device_info) {
return -1;
}
+ if (device_info->ap_nonce && device_info->ap_nonce_size > 0) {
+ *nonce = (unsigned char*)malloc(device_info->ap_nonce_size);
+ if (!*nonce) {
+ return -1;
+ }
+ *nonce_size = device_info->ap_nonce_size;
+ memcpy(*nonce, device_info->ap_nonce, *nonce_size);
+ }
+
return 0;
}
@@ -265,11 +277,20 @@ int dfu_get_sep_nonce(struct idevicerestore_client_t* client, unsigned char** no
}
}
- dfu_error = irecv_get_nonce_with_tag(client->dfu->client, "SNON", nonce, nonce_size);
- if (dfu_error != IRECV_E_SUCCESS) {
+ const struct irecv_device_info *device_info = irecv_get_device_info(client->dfu->client);
+ if (!device_info) {
return -1;
}
+ if (device_info->sep_nonce && device_info->sep_nonce_size > 0) {
+ *nonce = (unsigned char*)malloc(device_info->sep_nonce_size);
+ if (!*nonce) {
+ return -1;
+ }
+ *nonce_size = device_info->sep_nonce_size;
+ memcpy(*nonce, device_info->sep_nonce, *nonce_size);
+ }
+
return 0;
}