From a184cda744006d4a597ff5a23b67b635dd28c222 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Sat, 22 May 2010 14:48:13 -0400 Subject: Started implementation of img3 file and tss_stitcher --- src/tss.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/tss.c') diff --git a/src/tss.c b/src/tss.c index bd098e4..2b2991d 100644 --- a/src/tss.c +++ b/src/tss.c @@ -26,10 +26,16 @@ #include #include "tss.h" +#include "img3.h" #include "idevicerestore.h" #define ECID_STRSIZE 0x20 +typedef struct { + int length; + char* content; +} tss_response; + plist_t tss_create_request(plist_t buildmanifest, uint64_t ecid) { // Fetch build information from BuildManifest plist_t build_identities_array = plist_dict_get_item(buildmanifest, "BuildIdentities"); @@ -127,13 +133,14 @@ plist_t tss_create_request(plist_t buildmanifest, uint64_t ecid) { plist_t tss_entry = plist_copy(manifest_entry); plist_dict_insert_item(tss_request, key, tss_entry); + free(key); } - /* - int sz = 0; - char* xml = NULL; - plist_to_xml(tss_request, &xml, &sz); - printf("%s", xml); - */ + + int sz = 0; + char* xml = NULL; + plist_to_xml(tss_request, &xml, &sz); + printf("%s", xml); + return tss_request; } @@ -182,6 +189,7 @@ plist_t tss_send_request(plist_t tss_request) { curl_easy_perform(handle); curl_slist_free_all(header); curl_easy_cleanup(handle); + free(request); } curl_global_cleanup(); @@ -204,11 +212,17 @@ plist_t tss_send_request(plist_t tss_request) { plist_t tss_response = NULL; tss_size = response->length - (tss_data - response->content); plist_from_xml(tss_data, tss_size, &tss_response); -/* + free(response->content); + free(response); + int sz = 0; char* xml = NULL; plist_to_xml(tss_response, &xml, &sz); printf("%s", xml); -*/ + return tss_response; } + +void tss_stitch_img3(img3_file* file, plist_t signature) { + +} -- cgit v1.1-32-gdbae