diff options
author | Jonathan Beck | 2008-08-12 19:55:52 +0200 |
---|---|---|
committer | Jonathan Beck | 2008-08-21 18:42:01 +0200 |
commit | 460c091cd4743905e062e9b24b1d5d101d96b5f8 (patch) | |
tree | 742ca3df816c4c300600eddbf9132f00f419d27d /src | |
parent | aecf8d985ea38eceac682f31bbbc92b605c0ab39 (diff) | |
download | libplist-460c091cd4743905e062e9b24b1d5d101d96b5f8.tar.gz libplist-460c091cd4743905e062e9b24b1d5d101d96b5f8.tar.bz2 |
fixes lockdownd_init so it actually starts SSL session
Diffstat (limited to 'src')
-rw-r--r-- | src/lockdown.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 05ecc49..3969868 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -299,25 +299,29 @@ int lockdownd_init(iPhone *phone, lockdownd_client **control) } host_id = get_host_id(); - if (!host_id) host_id = lockdownd_generate_hostid(); - if (!is_device_known(public_key)){ + if (!is_device_known(public_key)) ret = lockdownd_pair_device(*control, public_key, host_id); - }else{ + else ret = 1; + + if (public_key) { + free(public_key); + public_key = NULL; } - free(public_key); - public_key = NULL; if (ret && host_id && lockdownd_start_SSL_session(*control, host_id)) { ret = 1; - free(host_id); - host_id = NULL; } else { ret = 0; fprintf(stderr, "lockdownd_init: SSL Session opening failed, has libiphone-initconf been run?\n"); } + if (host_id) { + free(host_id); + host_id = NULL; + } + return ret; } |