summaryrefslogtreecommitdiffstats
path: root/src/idevicerestore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r--src/idevicerestore.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index f27c357..8de9186 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -38,18 +38,12 @@
#include <curl/curl.h>
-#ifdef HAVE_OPENSSL
-#include <openssl/sha.h>
-#else
-#include "sha512.h"
-#define SHA384 sha384
-#endif
-
+#include <libimobiledevice-glue/sha.h>
#include <libimobiledevice-glue/utils.h>
+#include <libtatsu/tss.h>
#include "ace3.h"
#include "dfu.h"
-#include "tss.h"
#include "img3.h"
#include "img4.h"
#include "ipsw.h"
@@ -359,6 +353,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
idevice_set_debug_level(1);
irecv_set_debug_level(1);
}
+ tss_set_debug_level(client->debug_level);
}
idevicerestore_progress(client, RESTORE_STEP_DETECT, 0.0);
@@ -1494,7 +1489,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
// device is finally in restore mode, let's do this
if (client->mode == MODE_RESTORE) {
if ((client->flags & FLAG_NO_RESTORE) != 0) {
- info("Device is now in restore mode. Exiting as requested.");
+ info("Device is now in restore mode. Exiting as requested.\n");
return 0;
}
client->ignore_device_add_events = 1;
@@ -1519,10 +1514,11 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
}
}
- info("DONE\n");
-
if (result == 0) {
+ info("DONE\n");
idevicerestore_progress(client, RESTORE_NUM_STEPS-1, 1.0);
+ } else {
+ info("RESTORE FAILED\n");
}
if (build_identity_needs_free)
@@ -2169,7 +2165,7 @@ int get_preboard_manifest(struct idevicerestore_client_t* client, plist_t build_
return -1;
}
- plist_dict_set_item(parameters, "_OnlyFWOrTrustedComponents", plist_new_bool(1));
+ plist_dict_set_item(parameters, "_OnlyFWComponents", plist_new_bool(1));
/* add tags from manifest */
if (tss_request_add_ap_tags(request, parameters, NULL) < 0) {
@@ -2494,7 +2490,7 @@ int get_recovery_os_local_policy_tss_response(
// Add Ap,LocalPolicy
uint8_t digest[SHA384_DIGEST_LENGTH];
- SHA384(lpol_file, lpol_file_length, digest);
+ sha384(lpol_file, lpol_file_length, digest);
plist_t lpol = plist_new_dict();
plist_dict_set_item(lpol, "Digest", plist_new_data((char*)digest, SHA384_DIGEST_LENGTH));
plist_dict_set_item(lpol, "Trusted", plist_new_bool(1));
@@ -2589,7 +2585,7 @@ int get_local_policy_tss_response(struct idevicerestore_client_t* client, plist_
// Add Ap,LocalPolicy
uint8_t digest[SHA384_DIGEST_LENGTH];
- SHA384(lpol_file, lpol_file_length, digest);
+ sha384(lpol_file, lpol_file_length, digest);
plist_t lpol = plist_new_dict();
plist_dict_set_item(lpol, "Digest", plist_new_data((char*)digest, SHA384_DIGEST_LENGTH));
plist_dict_set_item(lpol, "Trusted", plist_new_bool(1));
@@ -2602,7 +2598,7 @@ int get_local_policy_tss_response(struct idevicerestore_client_t* client, plist_
tss_response_get_ap_img4_ticket(client->tss, &ticket, &ticket_length);
// Hash it and add it as Ap,NextStageIM4MHash
uint8_t hash[SHA384_DIGEST_LENGTH];
- SHA384(ticket, ticket_length, hash);
+ sha384(ticket, ticket_length, hash);
plist_dict_set_item(parameters, "Ap,NextStageIM4MHash", plist_new_data((char*)hash, SHA384_DIGEST_LENGTH));
/* create basic request */