diff options
Diffstat (limited to 'src/mobile_image_mounter.c')
| -rw-r--r-- | src/mobile_image_mounter.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c index 7133b8b..ab32cac 100644 --- a/src/mobile_image_mounter.c +++ b/src/mobile_image_mounter.c | |||
| @@ -141,7 +141,7 @@ leave_unlock: | |||
| 141 | return res; | 141 | return res; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata) | 144 | mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata) |
| 145 | { | 145 | { |
| 146 | if (!client || !image_type || (image_size == 0) || !upload_cb) { | 146 | if (!client || !image_type || (image_size == 0) || !upload_cb) { |
| 147 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 147 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
| @@ -151,6 +151,8 @@ mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_moun | |||
| 151 | 151 | ||
| 152 | plist_t dict = plist_new_dict(); | 152 | plist_t dict = plist_new_dict(); |
| 153 | plist_dict_set_item(dict, "Command", plist_new_string("ReceiveBytes")); | 153 | plist_dict_set_item(dict, "Command", plist_new_string("ReceiveBytes")); |
| 154 | if (signature && signature_size != 0) | ||
| 155 | plist_dict_set_item(dict, "ImageSignature", plist_new_data(signature, signature_size)); | ||
| 154 | plist_dict_set_item(dict, "ImageSize", plist_new_uint(image_size)); | 156 | plist_dict_set_item(dict, "ImageSize", plist_new_uint(image_size)); |
| 155 | plist_dict_set_item(dict, "ImageType", plist_new_string(image_type)); | 157 | plist_dict_set_item(dict, "ImageType", plist_new_string(image_type)); |
| 156 | 158 | ||
| @@ -250,9 +252,9 @@ leave_unlock: | |||
| 250 | 252 | ||
| 251 | } | 253 | } |
| 252 | 254 | ||
| 253 | mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *image_signature, uint16_t signature_length, const char *image_type, plist_t *result) | 255 | mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result) |
| 254 | { | 256 | { |
| 255 | if (!client || !image_path || !image_signature || (signature_length == 0) || !image_type || !result) { | 257 | if (!client || !image_path || !image_type || !result) { |
| 256 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; | 258 | return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG; |
| 257 | } | 259 | } |
| 258 | mobile_image_mounter_lock(client); | 260 | mobile_image_mounter_lock(client); |
| @@ -260,7 +262,8 @@ mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mount | |||
| 260 | plist_t dict = plist_new_dict(); | 262 | plist_t dict = plist_new_dict(); |
| 261 | plist_dict_set_item(dict, "Command", plist_new_string("MountImage")); | 263 | plist_dict_set_item(dict, "Command", plist_new_string("MountImage")); |
| 262 | plist_dict_set_item(dict, "ImagePath", plist_new_string(image_path)); | 264 | plist_dict_set_item(dict, "ImagePath", plist_new_string(image_path)); |
| 263 | plist_dict_set_item(dict, "ImageSignature", plist_new_data(image_signature, signature_length)); | 265 | if (signature && signature_size != 0) |
| 266 | plist_dict_set_item(dict, "ImageSignature", plist_new_data(signature, signature_size)); | ||
| 264 | plist_dict_set_item(dict, "ImageType", plist_new_string(image_type)); | 267 | plist_dict_set_item(dict, "ImageType", plist_new_string(image_type)); |
| 265 | 268 | ||
| 266 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); | 269 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); |
