summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-11-20 14:18:51 +0100
committerGravatar Nikias Bassen2013-11-20 14:18:51 +0100
commit44516697f38fa0f096ec48ee782e3d6f954195b5 (patch)
tree7fd8c4d531fbf89992fb54a321ccfd87218e0a90
parent4e2f579c646a26d1b54ad3f461c36bfdb44195ef (diff)
downloadidevicerestore-44516697f38fa0f096ec48ee782e3d6f954195b5.tar.gz
idevicerestore-44516697f38fa0f096ec48ee782e3d6f954195b5.tar.bz2
restore/tss: do not add an empty BbNonce node to TSS request
-rw-r--r--src/restore.c4
-rw-r--r--src/tss.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/restore.c b/src/restore.c
index b8b3c31..5978568 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1432,7 +1432,9 @@ int restore_send_baseband_data(restored_client_t restore, struct idevicerestore_
/* populate parameters */
plist_t parameters = plist_new_dict();
plist_dict_insert_item(parameters, "ApECID", plist_new_uint(client->ecid));
- plist_dict_insert_item(parameters, "BbNonce", plist_new_data((const char*)bb_nonce, bb_nonce_size));
+ if (bb_nonce) {
+ plist_dict_insert_item(parameters, "BbNonce", plist_new_data((const char*)bb_nonce, bb_nonce_size));
+ }
plist_dict_insert_item(parameters, "BbChipID", plist_new_uint(bb_chip_id));
plist_dict_insert_item(parameters, "BbGoldCertId", plist_new_uint(bb_cert_id));
plist_dict_insert_item(parameters, "BbSNUM", plist_new_data((const char*)bb_snum, bb_snum_size));
diff --git a/src/tss.c b/src/tss.c
index 83acb22..886752a 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -222,12 +222,10 @@ int tss_request_add_baseband_tags(plist_t request, plist_t parameters) {
/* BbNonce */
node = plist_dict_get_item(parameters, "BbNonce");
- if (!node || plist_get_node_type(node) != PLIST_DATA) {
- error("ERROR: Unable to find required BbNonce in parameters\n");
- return -1;
+ if (node) {
+ plist_dict_insert_item(request, "BbNonce", plist_copy(node));
+ node = NULL;
}
- plist_dict_insert_item(request, "BbNonce", plist_copy(node));
- node = NULL;
/* @BBTicket */
plist_dict_insert_item(request, "@BBTicket", plist_new_bool(1));