diff options
Diffstat (limited to 'src/lockdown.c')
| -rw-r--r-- | src/lockdown.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 108b558..13f3d48 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * lockdown.c | 2 | * lockdown.c |
| 3 | * libiphone built-in lockdownd client | 3 | * libimobiledevice built-in lockdownd client |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2008 Zach C. All Rights Reserved. | 5 | * Copyright (c) 2008 Zach C. All Rights Reserved. |
| 6 | * | 6 | * |
| @@ -30,7 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | #include "property_list_service.h" | 31 | #include "property_list_service.h" |
| 32 | #include "lockdown.h" | 32 | #include "lockdown.h" |
| 33 | #include "iphone.h" | 33 | #include "idevice.h" |
| 34 | #include "debug.h" | 34 | #include "debug.h" |
| 35 | #include "userpref.h" | 35 | #include "userpref.h" |
| 36 | 36 | ||
| @@ -229,7 +229,7 @@ void lockdownd_client_set_label(lockdownd_client_t client, const char *label) | |||
| 229 | } | 229 | } |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | /** Polls the iPhone for lockdownd data. | 232 | /** Polls the device for lockdownd data. |
| 233 | * | 233 | * |
| 234 | * @param control The lockdownd client | 234 | * @param control The lockdownd client |
| 235 | * @param plist The plist to store the received data | 235 | * @param plist The plist to store the received data |
| @@ -254,7 +254,7 @@ lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist) | |||
| 254 | return ret; | 254 | return ret; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | /** Sends lockdownd data to the iPhone | 257 | /** Sends lockdownd data to the device |
| 258 | * | 258 | * |
| 259 | * @note This function is low-level and should only be used if you need to send | 259 | * @note This function is low-level and should only be used if you need to send |
| 260 | * a new type of message. | 260 | * a new type of message. |
| @@ -270,7 +270,7 @@ lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist) | |||
| 270 | return LOCKDOWN_E_INVALID_ARG; | 270 | return LOCKDOWN_E_INVALID_ARG; |
| 271 | 271 | ||
| 272 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; | 272 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; |
| 273 | iphone_error_t err; | 273 | idevice_error_t err; |
| 274 | 274 | ||
| 275 | err = property_list_service_send_xml_plist(client->parent, plist); | 275 | err = property_list_service_send_xml_plist(client->parent, plist); |
| 276 | if (err != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 276 | if (err != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| @@ -578,7 +578,7 @@ lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **de | |||
| 578 | * | 578 | * |
| 579 | * @return an error code (LOCKDOWN_E_SUCCESS on success) | 579 | * @return an error code (LOCKDOWN_E_SUCCESS on success) |
| 580 | */ | 580 | */ |
| 581 | lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client, const char *label) | 581 | lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, const char *label) |
| 582 | { | 582 | { |
| 583 | if (!client) | 583 | if (!client) |
| 584 | return LOCKDOWN_E_INVALID_ARG; | 584 | return LOCKDOWN_E_INVALID_ARG; |
| @@ -619,7 +619,7 @@ lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_ | |||
| 619 | * | 619 | * |
| 620 | * @return an error code (LOCKDOWN_E_SUCCESS on success) | 620 | * @return an error code (LOCKDOWN_E_SUCCESS on success) |
| 621 | */ | 621 | */ |
| 622 | lockdownd_error_t lockdownd_client_new_with_handshake(iphone_device_t device, lockdownd_client_t *client, const char *label) | 622 | lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, const char *label) |
| 623 | { | 623 | { |
| 624 | if (!client) | 624 | if (!client) |
| 625 | return LOCKDOWN_E_INVALID_ARG; | 625 | return LOCKDOWN_E_INVALID_ARG; |
| @@ -644,7 +644,7 @@ lockdownd_error_t lockdownd_client_new_with_handshake(iphone_device_t device, lo | |||
| 644 | free(type); | 644 | free(type); |
| 645 | } | 645 | } |
| 646 | 646 | ||
| 647 | ret = iphone_device_get_uuid(device, &client_loc->uuid); | 647 | ret = idevice_get_uuid(device, &client_loc->uuid); |
| 648 | if (LOCKDOWN_E_SUCCESS != ret) { | 648 | if (LOCKDOWN_E_SUCCESS != ret) { |
| 649 | debug_info("failed to get device uuid."); | 649 | debug_info("failed to get device uuid."); |
| 650 | } | 650 | } |
| @@ -759,7 +759,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
| 759 | plist_t dict = NULL; | 759 | plist_t dict = NULL; |
| 760 | plist_t dict_record = NULL; | 760 | plist_t dict_record = NULL; |
| 761 | gnutls_datum_t public_key = { NULL, 0 }; | 761 | gnutls_datum_t public_key = { NULL, 0 }; |
| 762 | int pairing_mode = 0; /* 0 = libiphone, 1 = external */ | 762 | int pairing_mode = 0; /* 0 = libimobiledevice, 1 = external */ |
| 763 | 763 | ||
| 764 | if (pair_record && pair_record->host_id) { | 764 | if (pair_record && pair_record->host_id) { |
| 765 | /* valid pair_record passed? */ | 765 | /* valid pair_record passed? */ |
| @@ -780,7 +780,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
| 780 | return ret; | 780 | return ret; |
| 781 | } | 781 | } |
| 782 | debug_info("device public key follows:\n%s", public_key.data); | 782 | debug_info("device public key follows:\n%s", public_key.data); |
| 783 | /* get libiphone pair_record */ | 783 | /* get libimobiledevice pair_record */ |
| 784 | ret = generate_pair_record_plist(public_key, NULL, &dict_record); | 784 | ret = generate_pair_record_plist(public_key, NULL, &dict_record); |
| 785 | if (ret != LOCKDOWN_E_SUCCESS) { | 785 | if (ret != LOCKDOWN_E_SUCCESS) { |
| 786 | if (dict_record) | 786 | if (dict_record) |
| @@ -795,7 +795,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
| 795 | plist_dict_insert_item(dict,"PairRecord", dict_record); | 795 | plist_dict_insert_item(dict,"PairRecord", dict_record); |
| 796 | plist_dict_insert_item(dict, "Request", plist_new_string(verb)); | 796 | plist_dict_insert_item(dict, "Request", plist_new_string(verb)); |
| 797 | 797 | ||
| 798 | /* send to iPhone */ | 798 | /* send to device */ |
| 799 | ret = lockdownd_send(client, dict); | 799 | ret = lockdownd_send(client, dict); |
| 800 | plist_free(dict); | 800 | plist_free(dict); |
| 801 | dict = NULL; | 801 | dict = NULL; |
| @@ -803,7 +803,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
| 803 | if (ret != LOCKDOWN_E_SUCCESS) | 803 | if (ret != LOCKDOWN_E_SUCCESS) |
| 804 | return ret; | 804 | return ret; |
| 805 | 805 | ||
| 806 | /* Now get iPhone's answer */ | 806 | /* Now get device's answer */ |
| 807 | ret = lockdownd_receive(client, &dict); | 807 | ret = lockdownd_receive(client, &dict); |
| 808 | 808 | ||
| 809 | if (ret != LOCKDOWN_E_SUCCESS) | 809 | if (ret != LOCKDOWN_E_SUCCESS) |
| @@ -1116,7 +1116,7 @@ lockdownd_error_t lockdownd_gen_pair_cert(gnutls_datum_t public_key, gnutls_datu | |||
| 1116 | return ret; | 1116 | return ret; |
| 1117 | } | 1117 | } |
| 1118 | 1118 | ||
| 1119 | /** Starts communication with lockdownd after the iPhone has been paired, | 1119 | /** Starts communication with lockdownd after the device has been paired, |
| 1120 | * and if the device requires it, switches to SSL mode. | 1120 | * and if the device requires it, switches to SSL mode. |
| 1121 | * | 1121 | * |
| 1122 | * @param client The lockdownd client | 1122 | * @param client The lockdownd client |
| @@ -1244,7 +1244,7 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char | |||
| 1244 | plist_dict_insert_item(dict,"Request", plist_new_string("StartService")); | 1244 | plist_dict_insert_item(dict,"Request", plist_new_string("StartService")); |
| 1245 | plist_dict_insert_item(dict,"Service", plist_new_string(service)); | 1245 | plist_dict_insert_item(dict,"Service", plist_new_string(service)); |
| 1246 | 1246 | ||
| 1247 | /* send to iPhone */ | 1247 | /* send to device */ |
| 1248 | ret = lockdownd_send(client, dict); | 1248 | ret = lockdownd_send(client, dict); |
| 1249 | plist_free(dict); | 1249 | plist_free(dict); |
| 1250 | dict = NULL; | 1250 | dict = NULL; |
