summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-03-21 20:03:58 +0100
committerGravatar Martin Szulecki2014-03-21 20:03:58 +0100
commit4bb1fd768ccf6dc6eda4a7af5638abca553bc673 (patch)
tree14a202192770c8df30b4d5d373cfa09db357dec3
parentdbede29466197702c58b806f356f1fa26223d68a (diff)
downloadlibimobiledevice-4bb1fd768ccf6dc6eda4a7af5638abca553bc673.tar.gz
libimobiledevice-4bb1fd768ccf6dc6eda4a7af5638abca553bc673.tar.bz2
lockdown: Read HostID again after pairing to fix first pair workflow
-rw-r--r--src/lockdown.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index 0efe30e..ab99ae2 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -762,6 +762,7 @@ lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdown
}
plist_free(pair_record);
+ pair_record = NULL;
/* in any case, we need to validate pairing to receive trusted host status */
ret = lockdownd_validate_pair(client_loc, NULL);
@@ -778,6 +779,12 @@ lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdown
}
if (LOCKDOWN_E_SUCCESS == ret) {
+ if (!host_id) {
+ userpref_read_pair_record(client_loc->udid, &pair_record);
+ pair_record_get_host_id(pair_record, &host_id);
+ plist_free(pair_record);
+ }
+
ret = lockdownd_start_session(client_loc, host_id, NULL, NULL);
if (LOCKDOWN_E_SUCCESS != ret) {
debug_info("Session opening failed.");