From 6c7b50355cc5de1da1d7677e012f18efbce34237 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 29 Jul 2021 03:36:29 +0200 Subject: lockdown: Get DeviceClass to make sure OS version dependent code is executed correctly The code in lockdownd_client_new_with_handshake would call the function lockdownd_validate_pair based on the OS version being less than 7.0 without taking into account that Watch OS has a different versioning scheme compared to the other device classes. For this and any future version/device specific checks, the code now queries the DeviceClass and stores it in the idevice_private struct. --- src/idevice.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/idevice.h') diff --git a/src/idevice.h b/src/idevice.h index 7a8f4ce..2509e48 100644 --- a/src/idevice.h +++ b/src/idevice.h @@ -52,6 +52,13 @@ #define DEVICE_VERSION(maj, min, patch) (((maj & 0xFF) << 16) | ((min & 0xFF) << 8) | (patch & 0xFF)) +#define DEVICE_CLASS_IPHONE 1 +#define DEVICE_CLASS_IPAD 2 +#define DEVICE_CLASS_IPOD 3 +#define DEVICE_CLASS_APPLETV 4 +#define DEVICE_CLASS_WATCH 5 +#define DEVICE_CLASS_UNKNOWN 255 + struct ssl_data_private { #if defined(HAVE_OPENSSL) SSL *session; @@ -89,6 +96,7 @@ struct idevice_private { enum idevice_connection_type conn_type; void *conn_data; int version; + int device_class; }; #endif -- cgit v1.1-32-gdbae