summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-01-16 03:17:43 +0100
committerGravatar Nikias Bassen2019-01-16 03:17:43 +0100
commitfe2afea8aa5988f7c2d7027caa1817dc61da6ec3 (patch)
tree6bd3e1b990c02facd5fbf31bb5cd1e170055e1d0
parentb4af2e2d79d11c0cb6869d111ae7eca02c9e5c0b (diff)
downloadidevicerestore-fe2afea8aa5988f7c2d7027caa1817dc61da6ec3.tar.gz
idevicerestore-fe2afea8aa5988f7c2d7027caa1817dc61da6ec3.tar.bz2
restore: Add support for newer SEP firmware (Chip ID 0x64)
-rw-r--r--src/restore.c2
-rw-r--r--src/tss.c29
2 files changed, 12 insertions, 19 deletions
diff --git a/src/restore.c b/src/restore.c
index 2043324..6d5d808 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1808,7 +1808,7 @@ plist_t restore_get_se_firmware_data(restored_client_t restore, struct idevicere
}
if (chip_id == 0x20211) {
comp_name = "SE,Firmware";
- } else if (chip_id == 0x73) {
+ } else if (chip_id == 0x73 || chip_id == 0x64) {
comp_name = "SE,UpdatePayload";
} else {
error("ERROR: Neither 'SE,Firmware' nor 'SE,UpdatePayload' found in build identity.\n");
diff --git a/src/tss.c b/src/tss.c
index 940cd72..6340382 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -695,8 +695,6 @@ int tss_request_add_se_tags(plist_t request, plist_t parameters, plist_t overrid
return -1;
}
plist_dict_set_item(request, "SE,ChipID", plist_copy(node));
- uint64_t chip_id = 0;
- plist_get_uint_val(node, &chip_id);
node = NULL;
/* add SE,ID */
@@ -726,24 +724,11 @@ int tss_request_add_se_tags(plist_t request, plist_t parameters, plist_t overrid
plist_dict_set_item(request, "SE,RootKeyIdentifier", plist_copy(node));
node = NULL;
- const char *development_key = NULL;
- const char *production_key = NULL;
- if (chip_id == 0x20211) {
- development_key = "DevelopmentCMAC";
- production_key = "ProductionCMAC";
- } else if (chip_id == 0x73) {
- development_key = "DevelopmentUpdatePayloadHash";
- production_key = "ProductionUpdatePayloadHash";
- } else {
- error("WARNING: Unsupported SE,ChipID 0x%lx. Restore will likely fail.\n", (unsigned long)chip_id);
- }
- const char *key_to_remove = development_key;
/* 'IsDev' determines whether we have Production or Development */
+ uint8_t is_dev = 0;
node = plist_dict_get_item(parameters, "SE,IsDev");
if (node && plist_get_node_type(node) == PLIST_BOOLEAN) {
- uint8_t is_dev = 0;
plist_get_bool_val(node, &is_dev);
- key_to_remove = (is_dev) ? production_key : development_key;
}
/* add SE,* components from build manifest to request */
@@ -774,8 +759,16 @@ int tss_request_add_se_tags(plist_t request, plist_t parameters, plist_t overrid
plist_dict_remove_item(tss_entry, "Info");
/* remove Development or Production key/hash node */
- if (key_to_remove && plist_dict_get_item(tss_entry, key_to_remove)) {
- plist_dict_remove_item(tss_entry, key_to_remove);
+ if (is_dev) {
+ if (plist_dict_get_item(tss_entry, "ProductionCMAC"))
+ plist_dict_remove_item(tss_entry, "ProductionCMAC");
+ if (plist_dict_get_item(tss_entry, "ProductionUpdatePayloadHash"))
+ plist_dict_remove_item(tss_entry, "ProductionUpdatePayloadHash");
+ } else {
+ if (plist_dict_get_item(tss_entry, "DevelopmentCMAC"))
+ plist_dict_remove_item(tss_entry, "DevelopmentCMAC");
+ if (plist_dict_get_item(tss_entry, "DevelopmentUpdatePayloadHash"))
+ plist_dict_remove_item(tss_entry, "DevelopmentUpdatePayloadHash");
}
/* add entry to request */