From fcc1bb855efb6860417ed827d3b50feba24a9a8b Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 26 Feb 2013 03:20:56 +0100 Subject: 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. --- dev/filerelaytest.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'dev/filerelaytest.c') diff --git a/dev/filerelaytest.c b/dev/filerelaytest.c index 8c9514b..9094130 100644 --- a/dev/filerelaytest.c +++ b/dev/filerelaytest.c @@ -27,6 +27,7 @@ int main(int argc, char **argv) { idevice_t dev = NULL; lockdownd_client_t client = NULL; + lockdownd_service_descriptor_t service = NULL; file_relay_client_t frc = NULL; if (idevice_new(&dev, NULL) != IDEVICE_E_SUCCESS) { @@ -40,8 +41,7 @@ int main(int argc, char **argv) goto leave_cleanup; } - uint16_t port = 0; - if (lockdownd_start_service(client, "com.apple.mobile.file_relay", &port) != LOCKDOWN_E_SUCCESS) { + if (lockdownd_start_service(client, "com.apple.mobile.file_relay", &service) != LOCKDOWN_E_SUCCESS) { printf("could not start file_relay service!\n"); goto leave_cleanup; } @@ -51,11 +51,16 @@ int main(int argc, char **argv) client = NULL; } - if (file_relay_client_new(dev, port, &frc) != FILE_RELAY_E_SUCCESS) { + if (file_relay_client_new(dev, service, &frc) != FILE_RELAY_E_SUCCESS) { printf("could not connect to file_relay service!\n"); goto leave_cleanup; } + if (service) { + lockdownd_service_descriptor_free(service); + service = NULL; + } + idevice_connection_t dump = NULL; const char *sources[] = {"AppleSupport", "Network", "VPN", "WiFi", "UserDatabases", "CrashReporter", "tmp", "SystemConfiguration", NULL}; -- cgit v1.1-32-gdbae