summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2026-11-03 12:13:17 +0100
committerGravatar Nikias Bassen2026-11-03 12:13:17 +0100
commit8f209f9635e20b84b6eb41ce2e4ed5c0e59b38f9 (patch)
tree8386d1216d21d55e09d5bb7222391bcc71666ca3 /src
parent0313795a84ac15248bc109850b5e2ea660609a23 (diff)
downloadidevicerestore-8f209f9635e20b84b6eb41ce2e4ed5c0e59b38f9.tar.gz
idevicerestore-8f209f9635e20b84b6eb41ce2e4ed5c0e59b38f9.tar.bz2
Only add vinyl TSS tags if device reports EUICCChipID
If the device does not report an EUICCChipID in its firmware preflight info, plist_dict_copy_uint() leaves the eUICC,ChipID value from the BuildManifest in place. The subsequent ">= 5" check would then still pass and tss_request_add_vinyl_tags() was called without the required eUICC,EID, eUICC,RootKeyIdentifier and Gold/Main nonce values, causing the TSS server to respond with STATUS=168. Only copy the eUICC parameters and add the vinyl tags if the device actually provided an EUICCChipID. Fixes #812
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 11d7ec4..82691d7 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -2499,15 +2499,19 @@ int get_tss_response(struct idevicerestore_client_t* client, plist_t build_ident
/* add baseband parameters */
tss_request_add_baseband_tags(request, parameters, NULL);
- plist_dict_copy_uint(parameters, pinfo, "eUICC,ChipID", "EUICCChipID");
- if (plist_dict_get_uint(parameters, "eUICC,ChipID") >= 5) {
- plist_dict_copy_data(parameters, pinfo, "eUICC,EID", "EUICCCSN");
- plist_dict_copy_data(parameters, pinfo, "eUICC,RootKeyIdentifier", "EUICCCertIdentifier");
- plist_dict_copy_data(parameters, pinfo, "EUICCGoldNonce", NULL);
- plist_dict_copy_data(parameters, pinfo, "EUICCMainNonce", NULL);
-
- /* add vinyl parameters */
- tss_request_add_vinyl_tags(request, parameters, NULL);
+ /* only add vinyl tags if the device actually reports an eUICC chip ID;
+ * otherwise parameters would keep the (possibly >= 5) value from the BuildManifest */
+ if (plist_dict_get_item(pinfo, "EUICCChipID")) {
+ plist_dict_copy_uint(parameters, pinfo, "eUICC,ChipID", "EUICCChipID");
+ if (plist_dict_get_uint(parameters, "eUICC,ChipID") >= 5) {
+ plist_dict_copy_data(parameters, pinfo, "eUICC,EID", "EUICCCSN");
+ plist_dict_copy_data(parameters, pinfo, "eUICC,RootKeyIdentifier", "EUICCCertIdentifier");
+ plist_dict_copy_data(parameters, pinfo, "EUICCGoldNonce", NULL);
+ plist_dict_copy_data(parameters, pinfo, "EUICCMainNonce", NULL);
+
+ /* add vinyl parameters */
+ tss_request_add_vinyl_tags(request, parameters, NULL);
+ }
}
}
}