path: root/common
diff options
authorGravatar Nikias Bassen2018-09-29 22:59:25 +0200
committerGravatar Nikias Bassen2018-09-29 22:59:25 +0200
commitf1ee0fd8b2b1dd65c64f5a67e208efc708295caa (patch)
treea12c295d65fd88e5452aeff813daba83a493241b /common
parent05fefa6aeff45fc84665e8427444295d8414df98 (diff)
lockdown: Pass along usbmux device id when saving pair records
Diffstat (limited to 'common')
2 files changed, 4 insertions, 3 deletions
diff --git a/common/userpref.c b/common/userpref.c
index be745cb..0fa5b96 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -273,19 +273,20 @@ userpref_error_t userpref_get_paired_udids(char ***list, unsigned int *count)
* Save a pair record for a device.
* @param udid The device UDID as given by the device
+ * @param device_id The usbmux device id (handle) of the connected device, or 0
* @param pair_record The pair record to save
* @return 1 on success and 0 if no device record is given or if it has already
* been saved previously.
-userpref_error_t userpref_save_pair_record(const char *udid, plist_t pair_record)
+userpref_error_t userpref_save_pair_record(const char *udid, uint32_t device_id, plist_t pair_record)
char* record_data = NULL;
uint32_t record_size = 0;
plist_to_bin(pair_record, &record_data, &record_size);
- int res = usbmuxd_save_pair_record(udid, record_data, record_size);
+ int res = usbmuxd_save_pair_record_with_device_id(udid, device_id, record_data, record_size);
diff --git a/common/userpref.h b/common/userpref.h
index 84fea53..4ea630f 100644
--- a/common/userpref.h
+++ b/common/userpref.h
@@ -64,7 +64,7 @@ typedef enum {
const char *userpref_get_config_dir(void);
int userpref_read_system_buid(char **system_buid);
userpref_error_t userpref_read_pair_record(const char *udid, plist_t *pair_record);
-userpref_error_t userpref_save_pair_record(const char *udid, plist_t pair_record);
+userpref_error_t userpref_save_pair_record(const char *udid, uint32_t device_id, plist_t pair_record);
userpref_error_t userpref_delete_pair_record(const char *udid);
userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_data_t public_key);