summaryrefslogtreecommitdiffstats
path: root/src/idevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idevice.c')
-rw-r--r--src/idevice.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/idevice.c b/src/idevice.c
index e9c909f..1cdfef2 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -946,6 +946,20 @@ idevice_error_t idevice_get_udid(idevice_t device, char **udid)
946 return IDEVICE_E_SUCCESS; 946 return IDEVICE_E_SUCCESS;
947} 947}
948 948
949unsigned int idevice_get_device_version(idevice_t device)
950{
951 if (!device) {
952 return 0;
953 }
954 if (!device->version) {
955 lockdownd_client_t lockdown = NULL;
956 lockdownd_client_new(device, &lockdown, NULL);
957 // we don't handle any errors here. We should have the product version cached now.
958 lockdownd_client_free(lockdown);
959 }
960 return device->version;
961}
962
949#if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS) 963#if defined(HAVE_OPENSSL) || defined(HAVE_GNUTLS)
950typedef ssize_t ssl_cb_ret_type_t; 964typedef ssize_t ssl_cb_ret_type_t;
951#elif defined(HAVE_MBEDTLS) 965#elif defined(HAVE_MBEDTLS)
@@ -1229,7 +1243,7 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
1229#if OPENSSL_VERSION_NUMBER < 0x10100002L || \ 1243#if OPENSSL_VERSION_NUMBER < 0x10100002L || \
1230 (defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x2060000fL)) 1244 (defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x2060000fL))
1231 /* force use of TLSv1 for older devices */ 1245 /* force use of TLSv1 for older devices */
1232 if (connection->device->version < DEVICE_VERSION(10,0,0)) { 1246 if (connection->device->version < IDEVICE_DEVICE_VERSION(10,0,0)) {
1233#ifdef SSL_OP_NO_TLSv1_1 1247#ifdef SSL_OP_NO_TLSv1_1
1234 SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_1); 1248 SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_1);
1235#endif 1249#endif