diff options
| author | 2009-01-08 23:27:28 +0100 | |
|---|---|---|
| committer | 2009-01-08 23:27:28 +0100 | |
| commit | 8f239549c124d11eb8899aec6c048d6a496e3911 (patch) | |
| tree | 340b439d5ca46b06c088b6c59d2b58451d050302 /src/lockdown.c | |
| parent | f53b61c82be8aa6223ab6a524c2287d892f9864c (diff) | |
| download | libimobiledevice-8f239549c124d11eb8899aec6c048d6a496e3911.tar.gz libimobiledevice-8f239549c124d11eb8899aec6c048d6a496e3911.tar.bz2 | |
Implement skeleton of MobileSync protocol (handshake and goodbye).
Diffstat (limited to 'src/lockdown.c')
| -rw-r--r-- | src/lockdown.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 872b7b0..56a6f4e 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -845,6 +845,8 @@ iphone_error_t lockdownd_start_SSL_session(iphone_lckd_client_t control, const c | |||
| 845 | ret = iphone_lckd_recv(control, &XML_content, &bytes); | 845 | ret = iphone_lckd_recv(control, &XML_content, &bytes); |
| 846 | log_debug_msg("Receive msg :\nsize : %i\nxml : %s", bytes, XML_content); | 846 | log_debug_msg("Receive msg :\nsize : %i\nxml : %s", bytes, XML_content); |
| 847 | plist_from_xml(XML_content, bytes, &dict); | 847 | plist_from_xml(XML_content, bytes, &dict); |
| 848 | free(XML_content); | ||
| 849 | XML_content = NULL; | ||
| 848 | if (!dict) | 850 | if (!dict) |
| 849 | return IPHONE_E_PLIST_ERROR; | 851 | return IPHONE_E_PLIST_ERROR; |
| 850 | 852 | ||
| @@ -862,10 +864,6 @@ iphone_error_t lockdownd_start_SSL_session(iphone_lckd_client_t control, const c | |||
| 862 | plist_get_type_and_value(result_key_node, &result_key_type, (void *) (&result_key), &key_length); | 864 | plist_get_type_and_value(result_key_node, &result_key_type, (void *) (&result_key), &key_length); |
| 863 | plist_get_type_and_value(result_value_node, &result_value_type, (void *) (&result_value), &val_length); | 865 | plist_get_type_and_value(result_value_node, &result_value_type, (void *) (&result_value), &val_length); |
| 864 | 866 | ||
| 865 | free(XML_content); | ||
| 866 | XML_content = NULL; | ||
| 867 | plist_free(dict); | ||
| 868 | dict = NULL; | ||
| 869 | ret = IPHONE_E_SSL_ERROR; | 867 | ret = IPHONE_E_SSL_ERROR; |
| 870 | if (result_key_type == PLIST_KEY && | 868 | if (result_key_type == PLIST_KEY && |
| 871 | result_value_type == PLIST_STRING && !strcmp(result_key, "Result") && !strcmp(result_value, "Success")) { | 869 | result_value_type == PLIST_STRING && !strcmp(result_key, "Result") && !strcmp(result_value, "Success")) { |
| @@ -934,14 +932,14 @@ iphone_error_t lockdownd_start_SSL_session(iphone_lckd_client_t control, const c | |||
| 934 | // we need to store the session ID for StopSession | 932 | // we need to store the session ID for StopSession |
| 935 | strcpy(control->session_id, session_id); | 933 | strcpy(control->session_id, session_id); |
| 936 | log_debug_msg("SessionID: %s\n", control->session_id); | 934 | log_debug_msg("SessionID: %s\n", control->session_id); |
| 937 | return ret; | ||
| 938 | } | 935 | } |
| 939 | } | 936 | } else |
| 940 | |||
| 941 | if (ret == IPHONE_E_SUCCESS) { | ||
| 942 | log_debug_msg("Failed to get SessionID!\n"); | 937 | log_debug_msg("Failed to get SessionID!\n"); |
| 938 | plist_free(dict); | ||
| 939 | dict = NULL; | ||
| 940 | |||
| 941 | if (ret == IPHONE_E_SUCCESS) | ||
| 943 | return ret; | 942 | return ret; |
| 944 | } | ||
| 945 | 943 | ||
| 946 | log_debug_msg("Apparently failed negotiating with lockdownd.\n"); | 944 | log_debug_msg("Apparently failed negotiating with lockdownd.\n"); |
| 947 | return IPHONE_E_SSL_ERROR; | 945 | return IPHONE_E_SSL_ERROR; |
