diff options
author | Nikias Bassen | 2023-10-04 12:19:01 +0200 |
---|---|---|
committer | Nikias Bassen | 2023-10-04 12:19:01 +0200 |
commit | e4e551287d15a7d6fc9a0e9e0610e6921e53c0af (patch) | |
tree | 592efd0ebf9066c7a418412a67301102c20c7002 | |
parent | 064daea982e92d425a574b20088f445d2091d582 (diff) | |
download | idevicerestore-e4e551287d15a7d6fc9a0e9e0610e6921e53c0af.tar.gz idevicerestore-e4e551287d15a7d6fc9a0e9e0610e6921e53c0af.tar.bz2 |
restore/tss: Prefer DeviceGeneratedRequest for Rose TSS request, and add missing tag
-rw-r--r-- | src/restore.c | 14 | ||||
-rw-r--r-- | src/tss.c | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/restore.c b/src/restore.c index 05ff5af..c6e8a32 100644 --- a/src/restore.c +++ b/src/restore.c @@ -2423,7 +2423,7 @@ static plist_t restore_get_yonkers_firmware_data(restored_client_t restore, stru return response; } -static plist_t restore_get_rose_firmware_data(restored_client_t restore, struct idevicerestore_client_t* client, plist_t build_identity, plist_t p_info) +static plist_t restore_get_rose_firmware_data(restored_client_t restore, struct idevicerestore_client_t* client, plist_t build_identity, plist_t p_info, plist_t arguments) { char *comp_name = NULL; char *comp_path = NULL; @@ -2458,8 +2458,14 @@ static plist_t restore_get_rose_firmware_data(restored_client_t restore, struct plist_dict_set_item(parameters, "ApSupportsImg4", plist_new_bool(0)); } - /* add Rap,* tags from info dictionary to parameters */ - plist_dict_merge(¶meters, p_info); + plist_t device_generated_request = plist_dict_get_item(arguments, "DeviceGeneratedRequest"); + if (device_generated_request) { + /* use DeviceGeneratedRequest if present */ + plist_dict_merge(&request, device_generated_request); + } else { + /* add Rap,* tags from info dictionary to parameters */ + plist_dict_merge(¶meters, p_info); + } /* add required tags for Rose TSS request */ tss_request_add_rose_tags(request, parameters, NULL); @@ -3153,7 +3159,7 @@ static int restore_send_firmware_updater_data(restored_client_t restore, struct goto error_out; } } else if (strcmp(s_updater_name, "Rose") == 0) { - fwdict = restore_get_rose_firmware_data(restore, client, build_identity, p_info); + fwdict = restore_get_rose_firmware_data(restore, client, build_identity, p_info, arguments); if (fwdict == NULL) { error("ERROR: %s: Couldn't get Rose firmware data\n", __func__); goto error_out; @@ -1167,6 +1167,7 @@ int tss_request_add_rose_tags(plist_t request, plist_t parameters, plist_t overr _plist_dict_copy_bool(request, parameters, "Rap,ProductionMode", NULL); _plist_dict_copy_uint(request, parameters, "Rap,SecurityDomain", NULL); _plist_dict_copy_bool(request, parameters, "Rap,SecurityMode", NULL); + _plist_dict_copy_data(request, parameters, "Rap,FdrRootCaDigest", NULL); char *comp_name = NULL; plist_dict_iter iter = NULL; |