diff options
Diffstat (limited to 'src/lockdown.c')
| -rw-r--r-- | src/lockdown.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 5927192..5e0f579 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -99,7 +99,7 @@ static int lockdown_check_result(plist_t dict, const char *query_match) | |||
| 99 | } else if (!strcmp(result_value, "Failure")) { | 99 | } else if (!strcmp(result_value, "Failure")) { |
| 100 | ret = RESULT_FAILURE; | 100 | ret = RESULT_FAILURE; |
| 101 | } else { | 101 | } else { |
| 102 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: ERROR: unknown result value '%s'\n", __func__, result_value); | 102 | log_debug_msg("%s: ERROR: unknown result value '%s'\n", __func__, result_value); |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| 105 | if (result_value) | 105 | if (result_value) |
| @@ -136,9 +136,9 @@ static ssize_t lockdownd_ssl_write(gnutls_transport_ptr_t transport, char *buffe | |||
| 136 | uint32_t bytes = 0; | 136 | uint32_t bytes = 0; |
| 137 | lockdownd_client_t client; | 137 | lockdownd_client_t client; |
| 138 | client = (lockdownd_client_t) transport; | 138 | client = (lockdownd_client_t) transport; |
| 139 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pre-send length = %zi\n", __func__, length); | 139 | log_debug_msg("%s: pre-send length = %zi\n", __func__, length); |
| 140 | iphone_device_send(property_list_service_get_connection(client->parent), buffer, length, &bytes); | 140 | iphone_device_send(property_list_service_get_connection(client->parent), buffer, length, &bytes); |
| 141 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: post-send sent %i bytes\n", __func__, bytes); | 141 | log_debug_msg("%s: post-send sent %i bytes\n", __func__, bytes); |
| 142 | return bytes; | 142 | return bytes; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| @@ -207,7 +207,7 @@ static lockdownd_error_t lockdownd_ssl_start_session(lockdownd_client_t client) | |||
| 207 | uint32_t return_me = 0; | 207 | uint32_t return_me = 0; |
| 208 | 208 | ||
| 209 | // Set up GnuTLS... | 209 | // Set up GnuTLS... |
| 210 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: enabling SSL mode\n", __func__); | 210 | log_debug_msg("%s: enabling SSL mode\n", __func__); |
| 211 | errno = 0; | 211 | errno = 0; |
| 212 | gnutls_global_init(); | 212 | gnutls_global_init(); |
| 213 | gnutls_certificate_allocate_credentials(&client->ssl_certificate); | 213 | gnutls_certificate_allocate_credentials(&client->ssl_certificate); |
| @@ -228,26 +228,26 @@ static lockdownd_error_t lockdownd_ssl_start_session(lockdownd_client_t client) | |||
| 228 | } | 228 | } |
| 229 | gnutls_credentials_set(client->ssl_session, GNUTLS_CRD_CERTIFICATE, client->ssl_certificate); // this part is killing me. | 229 | gnutls_credentials_set(client->ssl_session, GNUTLS_CRD_CERTIFICATE, client->ssl_certificate); // this part is killing me. |
| 230 | 230 | ||
| 231 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: GnuTLS step 1...\n", __func__); | 231 | log_debug_msg("%s: GnuTLS step 1...\n", __func__); |
| 232 | gnutls_transport_set_ptr(client->ssl_session, (gnutls_transport_ptr_t) client); | 232 | gnutls_transport_set_ptr(client->ssl_session, (gnutls_transport_ptr_t) client); |
| 233 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: GnuTLS step 2...\n", __func__); | 233 | log_debug_msg("%s: GnuTLS step 2...\n", __func__); |
| 234 | gnutls_transport_set_push_function(client->ssl_session, (gnutls_push_func) & lockdownd_ssl_write); | 234 | gnutls_transport_set_push_function(client->ssl_session, (gnutls_push_func) & lockdownd_ssl_write); |
| 235 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: GnuTLS step 3...\n", __func__); | 235 | log_debug_msg("%s: GnuTLS step 3...\n", __func__); |
| 236 | gnutls_transport_set_pull_function(client->ssl_session, (gnutls_pull_func) & lockdownd_ssl_read); | 236 | gnutls_transport_set_pull_function(client->ssl_session, (gnutls_pull_func) & lockdownd_ssl_read); |
| 237 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: GnuTLS step 4 -- now handshaking...\n", __func__); | 237 | log_debug_msg("%s: GnuTLS step 4 -- now handshaking...\n", __func__); |
| 238 | if (errno) | 238 | if (errno) |
| 239 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: WARN: errno says %s before handshake!\n", __func__, strerror(errno)); | 239 | log_debug_msg("%s: WARN: errno says %s before handshake!\n", __func__, strerror(errno)); |
| 240 | return_me = gnutls_handshake(client->ssl_session); | 240 | return_me = gnutls_handshake(client->ssl_session); |
| 241 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: GnuTLS handshake done...\n", __func__); | 241 | log_debug_msg("%s: GnuTLS handshake done...\n", __func__); |
| 242 | 242 | ||
| 243 | if (return_me != GNUTLS_E_SUCCESS) { | 243 | if (return_me != GNUTLS_E_SUCCESS) { |
| 244 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: GnuTLS reported something wrong.\n", __func__); | 244 | log_debug_msg("%s: GnuTLS reported something wrong.\n", __func__); |
| 245 | gnutls_perror(return_me); | 245 | gnutls_perror(return_me); |
| 246 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: oh.. errno says %s\n", __func__, strerror(errno)); | 246 | log_debug_msg("%s: oh.. errno says %s\n", __func__, strerror(errno)); |
| 247 | } else { | 247 | } else { |
| 248 | client->ssl_enabled = 1; | 248 | client->ssl_enabled = 1; |
| 249 | ret = LOCKDOWN_E_SUCCESS; | 249 | ret = LOCKDOWN_E_SUCCESS; |
| 250 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: SSL mode enabled\n", __func__); | 250 | log_debug_msg("%s: SSL mode enabled\n", __func__); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | return ret; | 253 | return ret; |
| @@ -264,13 +264,13 @@ static lockdownd_error_t lockdownd_ssl_start_session(lockdownd_client_t client) | |||
| 264 | static lockdownd_error_t lockdownd_ssl_stop_session(lockdownd_client_t client) | 264 | static lockdownd_error_t lockdownd_ssl_stop_session(lockdownd_client_t client) |
| 265 | { | 265 | { |
| 266 | if (!client) { | 266 | if (!client) { |
| 267 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: invalid argument!\n", __func__); | 267 | log_debug_msg("%s: invalid argument!\n", __func__); |
| 268 | return LOCKDOWN_E_INVALID_ARG; | 268 | return LOCKDOWN_E_INVALID_ARG; |
| 269 | } | 269 | } |
| 270 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; | 270 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; |
| 271 | 271 | ||
| 272 | if (client->ssl_enabled) { | 272 | if (client->ssl_enabled) { |
| 273 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: sending SSL close notify\n", __func__); | 273 | log_debug_msg("%s: sending SSL close notify\n", __func__); |
| 274 | gnutls_bye(client->ssl_session, GNUTLS_SHUT_RDWR); | 274 | gnutls_bye(client->ssl_session, GNUTLS_SHUT_RDWR); |
| 275 | } | 275 | } |
| 276 | if (client->ssl_session) { | 276 | if (client->ssl_session) { |
| @@ -285,7 +285,7 @@ static lockdownd_error_t lockdownd_ssl_stop_session(lockdownd_client_t client) | |||
| 285 | free(client->session_id); | 285 | free(client->session_id); |
| 286 | client->session_id = NULL; | 286 | client->session_id = NULL; |
| 287 | 287 | ||
| 288 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: SSL mode disabled\n", __func__); | 288 | log_debug_msg("%s: SSL mode disabled\n", __func__); |
| 289 | 289 | ||
| 290 | return ret; | 290 | return ret; |
| 291 | } | 291 | } |
| @@ -307,7 +307,7 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char * | |||
| 307 | return LOCKDOWN_E_INVALID_ARG; | 307 | return LOCKDOWN_E_INVALID_ARG; |
| 308 | 308 | ||
| 309 | if (!session_id) { | 309 | if (!session_id) { |
| 310 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: no session_id given, cannot stop session\n", __func__); | 310 | log_debug_msg("%s: no session_id given, cannot stop session\n", __func__); |
| 311 | return LOCKDOWN_E_INVALID_ARG; | 311 | return LOCKDOWN_E_INVALID_ARG; |
| 312 | } | 312 | } |
| 313 | 313 | ||
| @@ -318,7 +318,7 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char * | |||
| 318 | plist_dict_insert_item(dict,"Request", plist_new_string("StopSession")); | 318 | plist_dict_insert_item(dict,"Request", plist_new_string("StopSession")); |
| 319 | plist_dict_insert_item(dict,"SessionID", plist_new_string(session_id)); | 319 | plist_dict_insert_item(dict,"SessionID", plist_new_string(session_id)); |
| 320 | 320 | ||
| 321 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: stopping session %s\n", __func__, session_id); | 321 | log_debug_msg("%s: stopping session %s\n", __func__, session_id); |
| 322 | 322 | ||
| 323 | ret = lockdownd_send(client, dict); | 323 | ret = lockdownd_send(client, dict); |
| 324 | 324 | ||
| @@ -328,13 +328,13 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char * | |||
| 328 | ret = lockdownd_recv(client, &dict); | 328 | ret = lockdownd_recv(client, &dict); |
| 329 | 329 | ||
| 330 | if (!dict) { | 330 | if (!dict) { |
| 331 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: LOCKDOWN_E_PLIST_ERROR\n", __func__); | 331 | log_debug_msg("%s: LOCKDOWN_E_PLIST_ERROR\n", __func__); |
| 332 | return LOCKDOWN_E_PLIST_ERROR; | 332 | return LOCKDOWN_E_PLIST_ERROR; |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | ret = LOCKDOWN_E_UNKNOWN_ERROR; | 335 | ret = LOCKDOWN_E_UNKNOWN_ERROR; |
| 336 | if (lockdown_check_result(dict, "StopSession") == RESULT_SUCCESS) { | 336 | if (lockdown_check_result(dict, "StopSession") == RESULT_SUCCESS) { |
| 337 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 337 | log_debug_msg("%s: success\n", __func__); |
| 338 | ret = LOCKDOWN_E_SUCCESS; | 338 | ret = LOCKDOWN_E_SUCCESS; |
| 339 | } | 339 | } |
| 340 | plist_free(dict); | 340 | plist_free(dict); |
| @@ -480,7 +480,7 @@ lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type) | |||
| 480 | plist_dict_add_label(dict, client->label); | 480 | plist_dict_add_label(dict, client->label); |
| 481 | plist_dict_insert_item(dict,"Request", plist_new_string("QueryType")); | 481 | plist_dict_insert_item(dict,"Request", plist_new_string("QueryType")); |
| 482 | 482 | ||
| 483 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: called\n", __func__); | 483 | log_debug_msg("%s: called\n", __func__); |
| 484 | ret = lockdownd_send(client, dict); | 484 | ret = lockdownd_send(client, dict); |
| 485 | 485 | ||
| 486 | plist_free(dict); | 486 | plist_free(dict); |
| @@ -498,7 +498,7 @@ lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type) | |||
| 498 | plist_t type_node = plist_dict_get_item(dict, "Type"); | 498 | plist_t type_node = plist_dict_get_item(dict, "Type"); |
| 499 | plist_get_string_val(type_node, type); | 499 | plist_get_string_val(type_node, type); |
| 500 | } | 500 | } |
| 501 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success with type %s\n", __func__, *type); | 501 | log_debug_msg("%s: success with type %s\n", __func__, *type); |
| 502 | ret = LOCKDOWN_E_SUCCESS; | 502 | ret = LOCKDOWN_E_SUCCESS; |
| 503 | } | 503 | } |
| 504 | plist_free(dict); | 504 | plist_free(dict); |
| @@ -550,7 +550,7 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom | |||
| 550 | return ret; | 550 | return ret; |
| 551 | 551 | ||
| 552 | if (lockdown_check_result(dict, "GetValue") == RESULT_SUCCESS) { | 552 | if (lockdown_check_result(dict, "GetValue") == RESULT_SUCCESS) { |
| 553 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 553 | log_debug_msg("%s: success\n", __func__); |
| 554 | ret = LOCKDOWN_E_SUCCESS; | 554 | ret = LOCKDOWN_E_SUCCESS; |
| 555 | } | 555 | } |
| 556 | if (ret != LOCKDOWN_E_SUCCESS) { | 556 | if (ret != LOCKDOWN_E_SUCCESS) { |
| @@ -561,7 +561,7 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom | |||
| 561 | plist_t value_node = plist_dict_get_item(dict, "Value"); | 561 | plist_t value_node = plist_dict_get_item(dict, "Value"); |
| 562 | 562 | ||
| 563 | if (value_node) { | 563 | if (value_node) { |
| 564 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: has a value\n", __func__); | 564 | log_debug_msg("%s: has a value\n", __func__); |
| 565 | *value = plist_copy(value_node); | 565 | *value = plist_copy(value_node); |
| 566 | } | 566 | } |
| 567 | 567 | ||
| @@ -613,7 +613,7 @@ lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *dom | |||
| 613 | return ret; | 613 | return ret; |
| 614 | 614 | ||
| 615 | if (lockdown_check_result(dict, "SetValue") == RESULT_SUCCESS) { | 615 | if (lockdown_check_result(dict, "SetValue") == RESULT_SUCCESS) { |
| 616 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 616 | log_debug_msg("%s: success\n", __func__); |
| 617 | ret = LOCKDOWN_E_SUCCESS; | 617 | ret = LOCKDOWN_E_SUCCESS; |
| 618 | } | 618 | } |
| 619 | 619 | ||
| @@ -670,7 +670,7 @@ lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char * | |||
| 670 | return ret; | 670 | return ret; |
| 671 | 671 | ||
| 672 | if (lockdown_check_result(dict, "RemoveValue") == RESULT_SUCCESS) { | 672 | if (lockdown_check_result(dict, "RemoveValue") == RESULT_SUCCESS) { |
| 673 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 673 | log_debug_msg("%s: success\n", __func__); |
| 674 | ret = LOCKDOWN_E_SUCCESS; | 674 | ret = LOCKDOWN_E_SUCCESS; |
| 675 | } | 675 | } |
| 676 | 676 | ||
| @@ -944,7 +944,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, char *host | |||
| 944 | 944 | ||
| 945 | /* if pairing succeeded */ | 945 | /* if pairing succeeded */ |
| 946 | if (ret == LOCKDOWN_E_SUCCESS) { | 946 | if (ret == LOCKDOWN_E_SUCCESS) { |
| 947 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: %s success\n", __func__, verb); | 947 | log_debug_msg("%s: %s success\n", __func__, verb); |
| 948 | if (!strcmp("Unpair", verb)) { | 948 | if (!strcmp("Unpair", verb)) { |
| 949 | /* remove public key from config */ | 949 | /* remove public key from config */ |
| 950 | userpref_remove_device_public_key(client->uuid); | 950 | userpref_remove_device_public_key(client->uuid); |
| @@ -953,7 +953,7 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, char *host | |||
| 953 | userpref_set_device_public_key(client->uuid, public_key); | 953 | userpref_set_device_public_key(client->uuid, public_key); |
| 954 | } | 954 | } |
| 955 | } else { | 955 | } else { |
| 956 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: %s failure\n", __func__, verb); | 956 | log_debug_msg("%s: %s failure\n", __func__, verb); |
| 957 | plist_t error_node = NULL; | 957 | plist_t error_node = NULL; |
| 958 | /* verify error condition */ | 958 | /* verify error condition */ |
| 959 | error_node = plist_dict_get_item(dict, "Error"); | 959 | error_node = plist_dict_get_item(dict, "Error"); |
| @@ -1041,7 +1041,7 @@ lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client) | |||
| 1041 | plist_dict_add_label(dict, client->label); | 1041 | plist_dict_add_label(dict, client->label); |
| 1042 | plist_dict_insert_item(dict,"Request", plist_new_string("EnterRecovery")); | 1042 | plist_dict_insert_item(dict,"Request", plist_new_string("EnterRecovery")); |
| 1043 | 1043 | ||
| 1044 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: telling device to enter recovery mode\n", __func__); | 1044 | log_debug_msg("%s: telling device to enter recovery mode\n", __func__); |
| 1045 | 1045 | ||
| 1046 | ret = lockdownd_send(client, dict); | 1046 | ret = lockdownd_send(client, dict); |
| 1047 | plist_free(dict); | 1047 | plist_free(dict); |
| @@ -1050,7 +1050,7 @@ lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client) | |||
| 1050 | ret = lockdownd_recv(client, &dict); | 1050 | ret = lockdownd_recv(client, &dict); |
| 1051 | 1051 | ||
| 1052 | if (lockdown_check_result(dict, "EnterRecovery") == RESULT_SUCCESS) { | 1052 | if (lockdown_check_result(dict, "EnterRecovery") == RESULT_SUCCESS) { |
| 1053 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 1053 | log_debug_msg("%s: success\n", __func__); |
| 1054 | ret = LOCKDOWN_E_SUCCESS; | 1054 | ret = LOCKDOWN_E_SUCCESS; |
| 1055 | } | 1055 | } |
| 1056 | plist_free(dict); | 1056 | plist_free(dict); |
| @@ -1077,7 +1077,7 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client) | |||
| 1077 | plist_dict_add_label(dict, client->label); | 1077 | plist_dict_add_label(dict, client->label); |
| 1078 | plist_dict_insert_item(dict,"Request", plist_new_string("Goodbye")); | 1078 | plist_dict_insert_item(dict,"Request", plist_new_string("Goodbye")); |
| 1079 | 1079 | ||
| 1080 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: called\n", __func__); | 1080 | log_debug_msg("%s: called\n", __func__); |
| 1081 | 1081 | ||
| 1082 | ret = lockdownd_send(client, dict); | 1082 | ret = lockdownd_send(client, dict); |
| 1083 | plist_free(dict); | 1083 | plist_free(dict); |
| @@ -1085,12 +1085,12 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client) | |||
| 1085 | 1085 | ||
| 1086 | ret = lockdownd_recv(client, &dict); | 1086 | ret = lockdownd_recv(client, &dict); |
| 1087 | if (!dict) { | 1087 | if (!dict) { |
| 1088 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: did not get goodbye response back\n", __func__); | 1088 | log_debug_msg("%s: did not get goodbye response back\n", __func__); |
| 1089 | return LOCKDOWN_E_PLIST_ERROR; | 1089 | return LOCKDOWN_E_PLIST_ERROR; |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | if (lockdown_check_result(dict, "Goodbye") == RESULT_SUCCESS) { | 1092 | if (lockdown_check_result(dict, "Goodbye") == RESULT_SUCCESS) { |
| 1093 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 1093 | log_debug_msg("%s: success\n", __func__); |
| 1094 | ret = LOCKDOWN_E_SUCCESS; | 1094 | ret = LOCKDOWN_E_SUCCESS; |
| 1095 | } | 1095 | } |
| 1096 | plist_free(dict); | 1096 | plist_free(dict); |
| @@ -1294,7 +1294,7 @@ lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char | |||
| 1294 | if (enable_ssl && (plist_get_node_type(enable_ssl) == PLIST_BOOLEAN)) { | 1294 | if (enable_ssl && (plist_get_node_type(enable_ssl) == PLIST_BOOLEAN)) { |
| 1295 | plist_get_bool_val(enable_ssl, &use_ssl); | 1295 | plist_get_bool_val(enable_ssl, &use_ssl); |
| 1296 | } | 1296 | } |
| 1297 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: Session startup OK\n", __func__); | 1297 | log_debug_msg("%s: Session startup OK\n", __func__); |
| 1298 | 1298 | ||
| 1299 | if (ssl_enabled != NULL) | 1299 | if (ssl_enabled != NULL) |
| 1300 | *ssl_enabled = use_ssl; | 1300 | *ssl_enabled = use_ssl; |
| @@ -1305,13 +1305,13 @@ lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char | |||
| 1305 | plist_get_string_val(session_node, &client->session_id); | 1305 | plist_get_string_val(session_node, &client->session_id); |
| 1306 | } | 1306 | } |
| 1307 | if (client->session_id) { | 1307 | if (client->session_id) { |
| 1308 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: SessionID: %s\n", __func__, client->session_id); | 1308 | log_debug_msg("%s: SessionID: %s\n", __func__, client->session_id); |
| 1309 | if (session_id != NULL) | 1309 | if (session_id != NULL) |
| 1310 | *session_id = strdup(client->session_id); | 1310 | *session_id = strdup(client->session_id); |
| 1311 | } else { | 1311 | } else { |
| 1312 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: Failed to get SessionID!\n", __func__); | 1312 | log_debug_msg("%s: Failed to get SessionID!\n", __func__); |
| 1313 | } | 1313 | } |
| 1314 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: Enable SSL Session: %s\n", __func__, (use_ssl?"true":"false")); | 1314 | log_debug_msg("%s: Enable SSL Session: %s\n", __func__, (use_ssl?"true":"false")); |
| 1315 | if (use_ssl) { | 1315 | if (use_ssl) { |
| 1316 | ret = lockdownd_ssl_start_session(client); | 1316 | ret = lockdownd_ssl_start_session(client); |
| 1317 | } else { | 1317 | } else { |
| @@ -1434,13 +1434,13 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati | |||
| 1434 | 1434 | ||
| 1435 | ret = lockdownd_recv(client, &dict); | 1435 | ret = lockdownd_recv(client, &dict); |
| 1436 | if (!dict) { | 1436 | if (!dict) { |
| 1437 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: LOCKDOWN_E_PLIST_ERROR\n", __func__); | 1437 | log_debug_msg("%s: LOCKDOWN_E_PLIST_ERROR\n", __func__); |
| 1438 | return LOCKDOWN_E_PLIST_ERROR; | 1438 | return LOCKDOWN_E_PLIST_ERROR; |
| 1439 | } | 1439 | } |
| 1440 | 1440 | ||
| 1441 | ret = LOCKDOWN_E_ACTIVATION_FAILED; | 1441 | ret = LOCKDOWN_E_ACTIVATION_FAILED; |
| 1442 | if (lockdown_check_result(dict, "Activate") == RESULT_SUCCESS) { | 1442 | if (lockdown_check_result(dict, "Activate") == RESULT_SUCCESS) { |
| 1443 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 1443 | log_debug_msg("%s: success\n", __func__); |
| 1444 | ret = LOCKDOWN_E_SUCCESS; | 1444 | ret = LOCKDOWN_E_SUCCESS; |
| 1445 | } | 1445 | } |
| 1446 | plist_free(dict); | 1446 | plist_free(dict); |
| @@ -1477,13 +1477,13 @@ lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) | |||
| 1477 | 1477 | ||
| 1478 | ret = lockdownd_recv(client, &dict); | 1478 | ret = lockdownd_recv(client, &dict); |
| 1479 | if (!dict) { | 1479 | if (!dict) { |
| 1480 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: LOCKDOWN_E_PLIST_ERROR\n", __func__); | 1480 | log_debug_msg("%s: LOCKDOWN_E_PLIST_ERROR\n", __func__); |
| 1481 | return LOCKDOWN_E_PLIST_ERROR; | 1481 | return LOCKDOWN_E_PLIST_ERROR; |
| 1482 | } | 1482 | } |
| 1483 | 1483 | ||
| 1484 | ret = LOCKDOWN_E_UNKNOWN_ERROR; | 1484 | ret = LOCKDOWN_E_UNKNOWN_ERROR; |
| 1485 | if (lockdown_check_result(dict, "Deactivate") == RESULT_SUCCESS) { | 1485 | if (lockdown_check_result(dict, "Deactivate") == RESULT_SUCCESS) { |
| 1486 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: success\n", __func__); | 1486 | log_debug_msg("%s: success\n", __func__); |
| 1487 | ret = LOCKDOWN_E_SUCCESS; | 1487 | ret = LOCKDOWN_E_SUCCESS; |
| 1488 | } | 1488 | } |
| 1489 | plist_free(dict); | 1489 | plist_free(dict); |
