diff options
Diffstat (limited to 'src/lockdown-cu.c')
-rw-r--r-- | src/lockdown-cu.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lockdown-cu.c b/src/lockdown-cu.c index cdaf02c..1afc2c5 100644 --- a/src/lockdown-cu.c +++ b/src/lockdown-cu.c @@ -62,6 +62,7 @@ #include <sys/sysctl.h> #include <SystemConfiguration/SystemConfiguration.h> #include <CoreFoundation/CoreFoundation.h> +#include <TargetConditionals.h> #endif #include "property_list_service.h" @@ -293,7 +294,7 @@ poly1305_update_with_pad16(poly1305_state *poly1305, static void chacha20_poly1305_encrypt_96(unsigned char* key, unsigned char* nonce, unsigned char* ad, size_t ad_len, unsigned char* in, size_t in_len, unsigned char* out, size_t* out_len) { #if defined(HAVE_OPENSSL) -#if defined(LIBRESSL_VERSION_NUMBER) +#if defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x3050000fL) #if (LIBRESSL_VERSION_NUMBER >= 0x2040000fL) const EVP_AEAD *aead = EVP_aead_chacha20_poly1305(); EVP_AEAD_CTX ctx; @@ -377,7 +378,7 @@ static void chacha20_poly1305_encrypt_64(unsigned char* key, unsigned char* nonc static void chacha20_poly1305_decrypt_96(unsigned char* key, unsigned char* nonce, unsigned char* ad, size_t ad_len, unsigned char* in, size_t in_len, unsigned char* out, size_t* out_len) { #if defined(HAVE_OPENSSL) -#if defined(LIBRESSL_VERSION_NUMBER) +#if defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x3050000fL) #if (LIBRESSL_VERSION_NUMBER >= 0x2040000fL) const EVP_AEAD *aead = EVP_aead_chacha20_poly1305(); EVP_AEAD_CTX ctx; @@ -489,7 +490,7 @@ static void chacha20_poly1305_decrypt_64(unsigned char* key, unsigned char* nonc #endif /* HAVE_WIRELESS_PAIRING */ -LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_pairing_create(lockdownd_client_t client, lockdownd_cu_pairing_cb_t pairing_callback, void* cb_user_data, plist_t host_info, plist_t acl) +lockdownd_error_t lockdownd_cu_pairing_create(lockdownd_client_t client, lockdownd_cu_pairing_cb_t pairing_callback, void* cb_user_data, plist_t host_info, plist_t acl) { #ifdef HAVE_WIRELESS_PAIRING if (!client || !pairing_callback || (host_info && plist_get_node_type(host_info) != PLIST_DICT) || (acl && plist_get_node_type(acl) != PLIST_DICT)) @@ -647,7 +648,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_pairing_create(lockdownd_cli /* HOST INFORMATION */ char hostname[256]; -#ifdef __APPLE__ +#if defined(__APPLE__) && !defined(TARGET_OS_IPHONE) CFStringRef cname = SCDynamicStoreCopyComputerName(NULL, NULL); CFStringGetCString(cname, hostname, sizeof(hostname), kCFStringEncodingUTF8); CFRelease(cname); @@ -931,7 +932,7 @@ debug_buffer(data, data_len); #endif } -LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_send_request_and_get_reply(lockdownd_client_t client, const char* request, plist_t request_payload, plist_t* reply) +lockdownd_error_t lockdownd_cu_send_request_and_get_reply(lockdownd_client_t client, const char* request, plist_t request_payload, plist_t* reply) { #ifdef HAVE_WIRELESS_PAIRING if (!client || !request) @@ -1031,7 +1032,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_send_request_and_get_reply(l plist_free(dict); dict = NULL; - plist_from_memory((const char*)decrypted, decrypted_len, &dict); + plist_from_memory((const char*)decrypted, decrypted_len, &dict, NULL); if (!dict) { ret = LOCKDOWN_E_PLIST_ERROR; debug_info("Failed to parse PLIST from decrypted payload:"); @@ -1056,7 +1057,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_cu_send_request_and_get_reply(l #endif } -LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value_cu(lockdownd_client_t client, const char* domain, const char* key, plist_t* value) +lockdownd_error_t lockdownd_get_value_cu(lockdownd_client_t client, const char* domain, const char* key, plist_t* value) { #ifdef HAVE_WIRELESS_PAIRING if (!client) @@ -1096,7 +1097,7 @@ LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value_cu(lockdownd_client_t #endif } -LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_pair_cu(lockdownd_client_t client) +lockdownd_error_t lockdownd_pair_cu(lockdownd_client_t client) { #ifdef HAVE_WIRELESS_PAIRING if (!client) |