diff options
Diffstat (limited to 'src/lockdown.c')
| -rw-r--r-- | src/lockdown.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index b83b8cf..a02e6a8 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -77,7 +77,6 @@ static void iphone_lckd_stop_session(iphone_lckd_client_t control) | |||
| 77 | if (!control) | 77 | if (!control) |
| 78 | return; //IPHONE_E_INVALID_ARG; | 78 | return; //IPHONE_E_INVALID_ARG; |
| 79 | 79 | ||
| 80 | int bytes = 0, i = 0; | ||
| 81 | iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; | 80 | iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; |
| 82 | 81 | ||
| 83 | plist_t dict = plist_new_dict(); | 82 | plist_t dict = plist_new_dict(); |
| @@ -128,7 +127,6 @@ static void iphone_lckd_stop_session(iphone_lckd_client_t control) | |||
| 128 | return; // ret; | 127 | return; // ret; |
| 129 | } | 128 | } |
| 130 | 129 | ||
| 131 | |||
| 132 | /** | 130 | /** |
| 133 | * Shuts down the SSL session by first calling iphone_lckd_stop_session | 131 | * Shuts down the SSL session by first calling iphone_lckd_stop_session |
| 134 | * to cleanly close the lockdownd communication session, and then | 132 | * to cleanly close the lockdownd communication session, and then |
| @@ -159,7 +157,6 @@ static void iphone_lckd_stop_SSL_session(iphone_lckd_client_t client) | |||
| 159 | return; | 157 | return; |
| 160 | } | 158 | } |
| 161 | 159 | ||
| 162 | |||
| 163 | /** Closes the lockdownd client and does the necessary housekeeping. | 160 | /** Closes the lockdownd client and does the necessary housekeeping. |
| 164 | * | 161 | * |
| 165 | * @param control The lockdown client | 162 | * @param control The lockdown client |
| @@ -471,7 +468,7 @@ iphone_error_t iphone_lckd_new_client(iphone_device_t device, iphone_lckd_client | |||
| 471 | 468 | ||
| 472 | iphone_lckd_client_t client_loc = new_lockdownd_client(device); | 469 | iphone_lckd_client_t client_loc = new_lockdownd_client(device); |
| 473 | if (IPHONE_E_SUCCESS != lockdownd_hello(client_loc)) { | 470 | if (IPHONE_E_SUCCESS != lockdownd_hello(client_loc)) { |
| 474 | fprintf(stderr, "Hello failed in the lockdownd client.\n"); | 471 | log_debug_msg("Hello failed in the lockdownd client.\n"); |
| 475 | ret = IPHONE_E_NOT_ENOUGH_DATA; | 472 | ret = IPHONE_E_NOT_ENOUGH_DATA; |
| 476 | } | 473 | } |
| 477 | 474 | ||
| @@ -479,12 +476,12 @@ iphone_error_t iphone_lckd_new_client(iphone_device_t device, iphone_lckd_client | |||
| 479 | char *uid = NULL; | 476 | char *uid = NULL; |
| 480 | ret = lockdownd_get_device_uid(client_loc, &uid); | 477 | ret = lockdownd_get_device_uid(client_loc, &uid); |
| 481 | if (IPHONE_E_SUCCESS != ret) { | 478 | if (IPHONE_E_SUCCESS != ret) { |
| 482 | fprintf(stderr, "Device refused to send uid.\n"); | 479 | log_debug_msg("Device refused to send uid.\n"); |
| 483 | } | 480 | } |
| 484 | 481 | ||
| 485 | host_id = get_host_id(); | 482 | host_id = get_host_id(); |
| 486 | if (IPHONE_E_SUCCESS == ret && !host_id) { | 483 | if (IPHONE_E_SUCCESS == ret && !host_id) { |
| 487 | fprintf(stderr, "No HostID found, run libiphone-initconf.\n"); | 484 | log_debug_msg("No HostID found, run libiphone-initconf.\n"); |
| 488 | ret = IPHONE_E_INVALID_CONF; | 485 | ret = IPHONE_E_INVALID_CONF; |
| 489 | } | 486 | } |
| 490 | 487 | ||
| @@ -499,7 +496,7 @@ iphone_error_t iphone_lckd_new_client(iphone_device_t device, iphone_lckd_client | |||
| 499 | ret = lockdownd_start_SSL_session(client_loc, host_id); | 496 | ret = lockdownd_start_SSL_session(client_loc, host_id); |
| 500 | if (IPHONE_E_SUCCESS != ret) { | 497 | if (IPHONE_E_SUCCESS != ret) { |
| 501 | ret = IPHONE_E_SSL_ERROR; | 498 | ret = IPHONE_E_SSL_ERROR; |
| 502 | fprintf(stderr, "SSL Session opening failed.\n"); | 499 | log_debug_msg("SSL Session opening failed.\n"); |
| 503 | } | 500 | } |
| 504 | 501 | ||
| 505 | if (host_id) { | 502 | if (host_id) { |
| @@ -532,7 +529,7 @@ iphone_error_t lockdownd_pair_device(iphone_lckd_client_t control, char *uid, ch | |||
| 532 | 529 | ||
| 533 | ret = lockdownd_get_device_public_key(control, &public_key); | 530 | ret = lockdownd_get_device_public_key(control, &public_key); |
| 534 | if (ret != IPHONE_E_SUCCESS) { | 531 | if (ret != IPHONE_E_SUCCESS) { |
| 535 | fprintf(stderr, "Device refused to send public key.\n"); | 532 | log_debug_msg("Device refused to send public key.\n"); |
| 536 | return ret; | 533 | return ret; |
| 537 | } | 534 | } |
| 538 | 535 | ||
| @@ -804,8 +801,7 @@ iphone_error_t lockdownd_gen_pair_cert(gnutls_datum_t public_key, gnutls_datum_t | |||
| 804 | iphone_error_t lockdownd_start_SSL_session(iphone_lckd_client_t control, const char *HostID) | 801 | iphone_error_t lockdownd_start_SSL_session(iphone_lckd_client_t control, const char *HostID) |
| 805 | { | 802 | { |
| 806 | plist_t dict = NULL; | 803 | plist_t dict = NULL; |
| 807 | char *XML_content = NULL; | 804 | uint32_t return_me = 0; |
| 808 | uint32_t length = 0, bytes = 0, return_me = 0; | ||
| 809 | 805 | ||
| 810 | iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; | 806 | iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; |
| 811 | control->session_id[0] = '\0'; | 807 | control->session_id[0] = '\0'; |
