summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.h3
-rw-r--r--src/idevicerestore.c7
-rw-r--r--src/restore.c2
-rw-r--r--src/tss.c6
-rw-r--r--src/tss.h2
5 files changed, 8 insertions, 12 deletions
diff --git a/src/common.h b/src/common.h
index e52c902..0188cdc 100644
--- a/src/common.h
+++ b/src/common.h
@@ -48,8 +48,6 @@ extern "C" {
#define FLAG_PWN 32
#define FLAG_NOACTION 64
-extern int use_apple_server;
-
struct dfu_client_t;
struct normal_client_t;
struct restore_client_t;
@@ -73,6 +71,7 @@ struct idevicerestore_entry_t {
struct idevicerestore_client_t {
int flags;
plist_t tss;
+ char* tss_url;
plist_t version_data;
uint64_t ecid;
unsigned char* nonce;
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index f33df1d..d38e672 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -45,8 +45,6 @@
#define VERSION_XML "version.xml"
-int use_apple_server;
-
static struct option longopts[] = {
{ "ecid", required_argument, NULL, 'i' },
{ "udid", required_argument, NULL, 'u' },
@@ -164,7 +162,6 @@ int main(int argc, char* argv[]) {
int shsh_only = 0;
int latest = 0;
char* shsh_dir = NULL;
- use_apple_server=1;
int result = 0;
// create an instance of our context
@@ -195,7 +192,7 @@ int main(int argc, char* argv[]) {
break;
case 's':
- use_apple_server=0;
+ client->tss_url = strdup("http://cydia.saurik.com/TSS/controller?action=2");
break;
case 'x':
@@ -1302,7 +1299,7 @@ int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, unsign
return -1;
}
- response = tss_send_request(request);
+ response = tss_send_request(request, client->tss_url);
if (response == NULL) {
info("ERROR: Unable to send TSS request\n");
plist_free(request);
diff --git a/src/restore.c b/src/restore.c
index 11b3a8c..bc9a7d3 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1299,7 +1299,7 @@ int restore_send_baseband_data(restored_client_t restore, struct idevicerestore_
debug_plist(request);
info("Sending Baseband TSS request...\n");
- response = tss_send_request(request);
+ response = tss_send_request(request, client->tss_url);
plist_free(request);
if (response == NULL) {
error("ERROR: Unable to fetch Baseband TSS\n");
diff --git a/src/tss.c b/src/tss.c
index f1b65a4..2928a2e 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -313,7 +313,7 @@ size_t tss_write_callback(char* data, size_t size, size_t nmemb, tss_response* r
return total;
}
-plist_t tss_send_request(plist_t tss_request) {
+plist_t tss_send_request(plist_t tss_request, const char* server_url_string) {
curl_global_init(CURL_GLOBAL_ALL);
char* request = NULL;
@@ -366,8 +366,8 @@ plist_t tss_send_request(plist_t tss_request) {
curl_easy_setopt(handle, CURLOPT_POSTFIELDS, request);
curl_easy_setopt(handle, CURLOPT_USERAGENT, "InetURL/1.0");
curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, strlen(request));
- if (use_apple_server==0) {
- curl_easy_setopt(handle, CURLOPT_URL, "http://cydia.saurik.com/TSS/controller?action=2");
+ if (server_url_string) {
+ curl_easy_setopt(handle, CURLOPT_URL, server_url_string);
} else {
int url_index = (retry - 1) % 6;
curl_easy_setopt(handle, CURLOPT_URL, urls[url_index]);
diff --git a/src/tss.h b/src/tss.h
index 2aa627c..fab16cc 100644
--- a/src/tss.h
+++ b/src/tss.h
@@ -28,7 +28,7 @@ extern "C" {
#include <plist/plist.h>
-plist_t tss_send_request(plist_t request);
+plist_t tss_send_request(plist_t request, const char* server_url_string);
plist_t tss_create_request(plist_t build_identity, uint64_t ecid, unsigned char* nonce, int nonce_size);
plist_t tss_create_baseband_request(plist_t build_identity, uint64_t ecid, uint64_t bb_cert_id, unsigned char* bb_snum, uint64_t bb_snum_size, unsigned char* bb_nonce, int bb_nonce_size);
int tss_get_ticket(plist_t tss, unsigned char** ticket, uint32_t* tlen);