summaryrefslogtreecommitdiffstats
path: root/src/tss.h
blob: 7a8c21a407837d21623e0105eee3b9edfd9ab87e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * tss.h
 * Definitions for communicating with Apple's TSS server.
 *
 * Copyright (c) 2013 Martin Szulecki. All Rights Reserved.
 * Copyright (c) 2012 Nikias Bassen. All Rights Reserved.
 * Copyright (c) 2010 Joshua Hill. All Rights Reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef IDEVICERESTORE_TSS_H
#define IDEVICERESTORE_TSS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <plist/plist.h>

/* parameters */
int tss_parameters_add_from_manifest(plist_t parameters, plist_t build_identity);

/* request */
plist_t tss_request_new(plist_t overrides);

int tss_request_add_common_tags(plist_t request, plist_t parameters, plist_t overrides);
int tss_request_add_ap_tags(plist_t request, plist_t parameters, plist_t overrides);
int tss_request_add_baseband_tags(plist_t request, plist_t parameters, plist_t overrides);
int tss_request_add_se_tags(plist_t request, plist_t parameters, plist_t overrides);
int tss_request_add_savage_tags(plist_t request, plist_t parameters, plist_t overrides, char **component_name);
int tss_request_add_yonkers_tags(plist_t request, plist_t parameters, plist_t overrides, char **component_name);

int tss_request_add_ap_img4_tags(plist_t request, plist_t parameters);
int tss_request_add_ap_img3_tags(plist_t request, plist_t parameters);

/* i/o */
plist_t tss_request_send(plist_t request, const char* server_url_string);

/* response */
int tss_response_get_ap_img4_ticket(plist_t response, unsigned char** ticket, unsigned int* length);
int tss_response_get_ap_ticket(plist_t response, unsigned char** ticket, unsigned int* length);
int tss_response_get_baseband_ticket(plist_t response, unsigned char** ticket, unsigned int* length);
int tss_response_get_path_by_entry(plist_t response, const char* entry, char** path);
int tss_response_get_blob_by_path(plist_t response, const char* path, unsigned char** blob);
int tss_response_get_blob_by_entry(plist_t response, const char* entry, unsigned char** blob);

/* helpers */
char* ecid_to_string(uint64_t ecid);

#ifdef __cplusplus
}
#endif

#endif