diff options
-rw-r--r-- | include/libiphone/lockdown.h | 1 | ||||
-rw-r--r-- | src/lockdown.c | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index 08431aa..e134f5f 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -46,6 +46,7 @@ extern "C" { #define LOCKDOWN_E_MUX_ERROR -12 #define LOCKDOWN_E_ACTIVATION_FAILED -13 #define LOCKDOWN_E_PASSWORD_PROTECTED -14 +#define LOCKDOWN_E_NO_RUNNING_SESSION -15 #define LOCKDOWN_E_UNKNOWN_ERROR -256 diff --git a/src/lockdown.c b/src/lockdown.c index 69ccf34..11b4fe6 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -1341,8 +1341,8 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char userpref_get_host_id(&host_id); if (!host_id) return LOCKDOWN_E_INVALID_CONF; - if (!client->ssl_enabled && !lockdownd_start_ssl_session(client, host_id)) - return LOCKDOWN_E_SSL_ERROR; + if (!client->session_id) + return LOCKDOWN_E_NO_RUNNING_SESSION; plist_t dict = NULL; uint32_t port_loc = 0; @@ -1413,6 +1413,9 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati if (!client) return LOCKDOWN_E_INVALID_ARG; + if (!client->session_id) + return LOCKDOWN_E_NO_RUNNING_SESSION; + if (!activation_record) return LOCKDOWN_E_INVALID_ARG; @@ -1457,6 +1460,9 @@ lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) if (!client) return LOCKDOWN_E_INVALID_ARG; + if (!client->session_id) + return LOCKDOWN_E_NO_RUNNING_SESSION; + lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; plist_t dict = plist_new_dict(); |