summaryrefslogtreecommitdiffstats
path: root/src/lockdown.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-24 23:51:53 +0200
committerGravatar Martin Szulecki2009-07-24 23:51:53 +0200
commit19a28b0ed18c8ca2f855e7d129ddcdb8c939a707 (patch)
treea8c3dbfd38705bbe73af53193d4c8cfa224ebee2 /src/lockdown.c
parent83529098fbf4b39b2643a7c0bf39828247d11f9a (diff)
downloadlibimobiledevice-19a28b0ed18c8ca2f855e7d129ddcdb8c939a707.tar.gz
libimobiledevice-19a28b0ed18c8ca2f855e7d129ddcdb8c939a707.tar.bz2
Use iphone_device_get_uuid() not lockdown, for less overhead where possible
Diffstat (limited to 'src/lockdown.c')
-rw-r--r--src/lockdown.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index bfb44d0..3d2b04c 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -673,24 +673,24 @@ iphone_error_t lockdownd_new_client(iphone_device_t device, lockdownd_client_t *
673 ret = IPHONE_E_NOT_ENOUGH_DATA; 673 ret = IPHONE_E_NOT_ENOUGH_DATA;
674 } 674 }
675 675
676 char *uid = NULL; 676 char *uuid = NULL;
677 ret = lockdownd_get_device_uid(client_loc, &uid); 677 ret = iphone_device_get_uuid(device, &uuid);
678 if (IPHONE_E_SUCCESS != ret) { 678 if (IPHONE_E_SUCCESS != ret) {
679 log_debug_msg("%s: failed to get device uuid.\n", __func__); 679 log_debug_msg("%s: failed to get device uuid.\n", __func__);
680 } 680 }
681 log_debug_msg("%s: device uuid: %s\n", __func__, uid); 681 log_debug_msg("%s: device uuid: %s\n", __func__, uuid);
682 682
683 host_id = get_host_id(); 683 host_id = get_host_id();
684 if (IPHONE_E_SUCCESS == ret && !host_id) { 684 if (IPHONE_E_SUCCESS == ret && !host_id) {
685 ret = IPHONE_E_INVALID_CONF; 685 ret = IPHONE_E_INVALID_CONF;
686 } 686 }
687 687
688 if (IPHONE_E_SUCCESS == ret && !is_device_known(uid)) 688 if (IPHONE_E_SUCCESS == ret && !is_device_known(uuid))
689 ret = lockdownd_pair(client_loc, uid, host_id); 689 ret = lockdownd_pair(client_loc, uuid, host_id);
690 690
691 if (uid) { 691 if (uuid) {
692 free(uid); 692 free(uuid);
693 uid = NULL; 693 uuid = NULL;
694 } 694 }
695 695
696 if (IPHONE_E_SUCCESS == ret) { 696 if (IPHONE_E_SUCCESS == ret) {
@@ -779,9 +779,8 @@ iphone_error_t lockdownd_pair(lockdownd_client_t client, char *uid, char *host_i
779 779
780 /* store public key in config if pairing succeeded */ 780 /* store public key in config if pairing succeeded */
781 if (ret == IPHONE_E_SUCCESS) { 781 if (ret == IPHONE_E_SUCCESS) {
782 log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair success\n", __func__); 782 log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair success\n", __func__);
783 store_device_public_key(uid, public_key); 783 store_device_public_key(uuid, public_key);
784 ret = IPHONE_E_SUCCESS;
785 } else { 784 } else {
786 log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair failure\n", __func__); 785 log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair failure\n", __func__);
787 ret = IPHONE_E_PAIRING_FAILED; 786 ret = IPHONE_E_PAIRING_FAILED;