diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/debugserver.c | 11 | ||||
-rw-r--r-- | src/lockdown.c | 5 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/debugserver.c b/src/debugserver.c index c517017..cc0e73f 100644 --- a/src/debugserver.c +++ b/src/debugserver.c @@ -80,7 +80,10 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_new(idevice_t device debug_info("Creating base service client failed. Error: %i", ret); return ret; } - service_disable_bypass_ssl(parent, 1); + + if (service->identifier && (strcmp(service->identifier, DEBUGSERVER_SECURE_SERVICE_NAME) != 0)) { + service_disable_bypass_ssl(parent, 1); + } debugserver_client_t client_loc = (debugserver_client_t) malloc(sizeof(struct debugserver_client_private)); client_loc->parent = parent; @@ -95,7 +98,11 @@ LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_new(idevice_t device LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label) { debugserver_error_t err = DEBUGSERVER_E_UNKNOWN_ERROR; - service_client_factory_start_service(device, DEBUGSERVER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err); + service_client_factory_start_service(device, DEBUGSERVER_SECURE_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err); + if (err != DEBUGSERVER_E_SUCCESS) { + err = DEBUGSERVER_E_UNKNOWN_ERROR; + service_client_factory_start_service(device, DEBUGSERVER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err); + } return err; } diff --git a/src/lockdown.c b/src/lockdown.c index 79353f2..49f757c 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -1307,6 +1307,7 @@ static lockdownd_error_t lockdownd_do_start_service(lockdownd_client_t client, c *service = (lockdownd_service_descriptor_t)malloc(sizeof(struct lockdownd_service_descriptor)); (*service)->port = 0; (*service)->ssl_enabled = 0; + (*service)->identifier = strdup(identifier); /* read service port number */ plist_t node = plist_dict_get_item(dict, "Port"); @@ -1511,8 +1512,10 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_data_classes_free(char **classe LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service) { - if (service) + if (service) { + free(service->identifier); free(service); + } return LOCKDOWN_E_SUCCESS; } |