diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lockdown.c | 14 | ||||
| -rw-r--r-- | src/lockdown.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 76d063c..6616e72 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -1078,7 +1078,7 @@ lockdownd_error_t lockdownd_gen_pair_cert(gnutls_datum_t public_key, gnutls_datu | |||
| 1078 | * | 1078 | * |
| 1079 | * @return an error code (LOCKDOWN_E_SUCCESS on success) | 1079 | * @return an error code (LOCKDOWN_E_SUCCESS on success) |
| 1080 | */ | 1080 | */ |
| 1081 | lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const char *HostID) | 1081 | lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const char *host_id) |
| 1082 | { | 1082 | { |
| 1083 | plist_t dict = NULL; | 1083 | plist_t dict = NULL; |
| 1084 | uint32_t return_me = 0; | 1084 | uint32_t return_me = 0; |
| @@ -1092,7 +1092,7 @@ lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const c | |||
| 1092 | /* Setup DevicePublicKey request plist */ | 1092 | /* Setup DevicePublicKey request plist */ |
| 1093 | dict = plist_new_dict(); | 1093 | dict = plist_new_dict(); |
| 1094 | plist_dict_add_label(dict, client->label); | 1094 | plist_dict_add_label(dict, client->label); |
| 1095 | plist_dict_insert_item(dict,"HostID", plist_new_string(HostID)); | 1095 | plist_dict_insert_item(dict,"HostID", plist_new_string(host_id)); |
| 1096 | plist_dict_insert_item(dict,"Request", plist_new_string("StartSession")); | 1096 | plist_dict_insert_item(dict,"Request", plist_new_string("StartSession")); |
| 1097 | 1097 | ||
| 1098 | ret = lockdownd_send(client, dict); | 1098 | ret = lockdownd_send(client, dict); |
| @@ -1115,15 +1115,15 @@ lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const c | |||
| 1115 | 1115 | ||
| 1116 | if (!strcmp(error, "InvalidHostID")) { | 1116 | if (!strcmp(error, "InvalidHostID")) { |
| 1117 | /* hostid is unknown. Pair and try again */ | 1117 | /* hostid is unknown. Pair and try again */ |
| 1118 | char *host_id = NULL; | 1118 | char *host_id_new = NULL; |
| 1119 | userpref_get_host_id(&host_id); | 1119 | userpref_get_host_id(&host_id_new); |
| 1120 | 1120 | ||
| 1121 | if (LOCKDOWN_E_SUCCESS == lockdownd_pair(client, host_id) ) { | 1121 | if (LOCKDOWN_E_SUCCESS == lockdownd_pair(client, host_id_new) ) { |
| 1122 | /* start session again */ | 1122 | /* start session again */ |
| 1123 | plist_free(dict); | 1123 | plist_free(dict); |
| 1124 | dict = plist_new_dict(); | 1124 | dict = plist_new_dict(); |
| 1125 | plist_dict_add_label(dict, client->label); | 1125 | plist_dict_add_label(dict, client->label); |
| 1126 | plist_dict_insert_item(dict,"HostID", plist_new_string(HostID)); | 1126 | plist_dict_insert_item(dict,"HostID", plist_new_string(host_id_new)); |
| 1127 | plist_dict_insert_item(dict,"Request", plist_new_string("StartSession")); | 1127 | plist_dict_insert_item(dict,"Request", plist_new_string("StartSession")); |
| 1128 | 1128 | ||
| 1129 | ret = lockdownd_send(client, dict); | 1129 | ret = lockdownd_send(client, dict); |
| @@ -1132,7 +1132,7 @@ lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const c | |||
| 1132 | 1132 | ||
| 1133 | ret = lockdownd_recv(client, &dict); | 1133 | ret = lockdownd_recv(client, &dict); |
| 1134 | } | 1134 | } |
| 1135 | free(host_id); | 1135 | free(host_id_new); |
| 1136 | } | 1136 | } |
| 1137 | free(error); | 1137 | free(error); |
| 1138 | } | 1138 | } |
diff --git a/src/lockdown.h b/src/lockdown.h index 6dac391..6e1b843 100644 --- a/src/lockdown.h +++ b/src/lockdown.h | |||
| @@ -42,7 +42,7 @@ lockdownd_error_t lockdownd_gen_pair_cert(gnutls_datum_t public_key, gnutls_datu | |||
| 42 | gnutls_datum_t * host_cert, gnutls_datum_t * root_cert); | 42 | gnutls_datum_t * host_cert, gnutls_datum_t * root_cert); |
| 43 | 43 | ||
| 44 | /* SSL functions */ | 44 | /* SSL functions */ |
| 45 | lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const char *HostID); | 45 | lockdownd_error_t lockdownd_start_ssl_session(lockdownd_client_t client, const char *host_id); |
| 46 | ssize_t lockdownd_securead(gnutls_transport_ptr_t transport, char *buffer, size_t length); | 46 | ssize_t lockdownd_securead(gnutls_transport_ptr_t transport, char *buffer, size_t length); |
| 47 | ssize_t lockdownd_secuwrite(gnutls_transport_ptr_t transport, char *buffer, size_t length); | 47 | ssize_t lockdownd_secuwrite(gnutls_transport_ptr_t transport, char *buffer, size_t length); |
| 48 | 48 | ||
