summaryrefslogtreecommitdiffstats
path: root/tools/ideviceprovision.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-02-26 03:20:56 +0100
committerGravatar Martin Szulecki2013-02-26 03:20:56 +0100
commitfcc1bb855efb6860417ed827d3b50feba24a9a8b (patch)
tree47d3c7d6a985dc647f7962329014c8116d657cc9 /tools/ideviceprovision.c
parent3b54aac30447bc02fafd721a63a752968628e7e0 (diff)
downloadlibimobiledevice-fcc1bb855efb6860417ed827d3b50feba24a9a8b.tar.gz
libimobiledevice-fcc1bb855efb6860417ed827d3b50feba24a9a8b.tar.bz2
Refactor port number use into service descriptor to enable SSL for services
This is a major change which breaks API but is required in order to support SSL communication for services as used by network connections.
Diffstat (limited to 'tools/ideviceprovision.c')
-rw-r--r--tools/ideviceprovision.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/ideviceprovision.c b/tools/ideviceprovision.c
index 1c6866d..13fd239 100644
--- a/tools/ideviceprovision.c
+++ b/tools/ideviceprovision.c
@@ -193,6 +193,7 @@ static plist_t profile_get_embedded_plist(plist_t profile)
int main(int argc, char *argv[])
{
lockdownd_client_t client = NULL;
+ lockdownd_service_descriptor_t service = NULL;
idevice_t device = NULL;
idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
int i;
@@ -278,8 +279,7 @@ int main(int argc, char *argv[])
return -1;
}
- uint16_t port = 0;
- if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.misagent", &port)) {
+ if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.misagent", &service)) {
fprintf(stderr, "Could not start service \"com.apple.misagent\"\n");
lockdownd_client_free(client);
idevice_free(device);
@@ -289,13 +289,18 @@ int main(int argc, char *argv[])
client = NULL;
misagent_client_t mis = NULL;
- if (misagent_client_new(device, port, &mis) != MISAGENT_E_SUCCESS) {
+ if (misagent_client_new(device, service, &mis) != MISAGENT_E_SUCCESS) {
fprintf(stderr, "Could not connect to \"com.apple.misagent\" on device\n");
+ if (service)
+ lockdownd_service_descriptor_free(service);
lockdownd_client_free(client);
idevice_free(device);
return -1;
}
+ if (service)
+ lockdownd_service_descriptor_free(service);
+
switch (op) {
case OP_INSTALL:
{