summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-01-26idevicebackup2: Write /iTunesRestore/RestoreApplications.plist on restoreGravatar Samuel Sadok1-3/+62
This will trigger re-installation of apps that were installed when the backup was created once the device finishes the restore and rebooted.
2018-10-30idevicebackup2: Fix scan_directory() for platforms not having d_type in ↵Gravatar Nikias Bassen2-0/+8
struct dirent
2018-10-29idevicebackup2: Fix rmdir_recursive() not deleting all files/directories ↵Gravatar Nikias Bassen1-20/+55
(esp. on network filesystems)
2018-10-01tools: Remove length check on device UDID arguments to support newer devicesGravatar Nikias Bassen35-97/+95
The 40 characters length check on the device UDID made newer devices unusable with the libimobiledevice tools and was actually redundant since an invalid UDID will always fail to resolve. This commit removes the length check alltogether (but makes sure it is not an empty string "").
2018-09-29lockdown: Pass along usbmux device id when saving pair recordsGravatar Nikias Bassen5-5/+8
2018-09-29idevice: Add usbmux device id (handle/mux id) to internal data structureGravatar Nikias Bassen3-14/+8
2018-09-03idevicebackup2: Make sure iTunesSettings are correctly stored in Info.plist ↵Gravatar Nikias Bassen1-1/+1
(i.e. not freed before writing)
2018-09-03idevicebackup2: Prevent lockdownd timeoutsGravatar Nikias Bassen1-31/+38
2018-07-24idevicepair: Fix possible memleak in option parsingGravatar Bastien Nocera1-0/+2
If some arguments are passed multiple times, don't leak the memory used for the value of the first arguments passed.
2018-07-24ideviceimagemounter: Fix possible memleak in option parsingGravatar Bastien Nocera1-0/+4
If some arguments are passed multiple times, don't leak the memory used for the value of the first arguments passed.
2018-07-24idevicedebugserverproxy: Fix possible use-after-freeGravatar Bastien Nocera1-1/+1
When creating a connection handler thread fails, and we close the server_fd, do not loop back to the start of the loop trying to run socket_accept() on a closed fd, but break out of the loop instead.
2018-07-24idevicebackup2: Fix potential memleakGravatar Bastien Nocera1-1/+3
If either of dstpath or srcpath can be NULL, then make sure they get freed irrespective of the other variable's value in mb2_copy_directory_by_path()
2018-07-24idevicebackup2: Fix fd leak in mb2_copy_file_by_path()Gravatar Bastien Nocera1-0/+1
fd was leak in error path.
2018-04-27build: Fix autogen.sh with srcdir != builddirGravatar Bastien Nocera1-1/+10
2018-04-27userpref: [GnuTLS] Use valid serial for >= 3.6.0Gravatar Bastien Nocera1-3/+3
Another change in 3.6.0 is that a serial of '\0' is not valid anymore. Bump it to one.
2018-04-27userpref: [GnuTLS] Fix 3.6.0 SHA1 compatibilityGravatar Bastien Nocera1-3/+3
Verification will fail if a special flag is not passed. Use gnutls_x509_crt_sign2() instead of gnutls_x509_crt_sign() to make sure that passing this flag works in 3.6.0 and stays working with 3.6.1.
2018-03-21idevicediagnostics: Add ioregentry command to query device IORegistry by entryGravatar Robert Gadbois1-1/+22
Starting with iOS 9.1, querying IORegistry by plane stopped working. This commit will add a new command that allows querying by entry that will allow gathering data for devices with newer iOS versions again (including iOS 11).
2018-03-21idevicediagnostics: Add HDMI to the list of valid options for diagnostics ↵Gravatar Nikias Bassen1-1/+1
command
2018-01-17idevicesyslog: Wait for passcode entry on device when requiredGravatar Nikias Bassen1-2/+33
After device bootup several services cannot be used until the passcode is entered on the device. This commit will detect this state and wait for the passcode to be entered. Before this change you would have to restart idevicesyslog or replug the device after entering the passcode to make the logging work again.
2017-12-08lockdown: Plug small memory leakGravatar Nikias Bassen1-0/+1
Credit to Rudolf Tammekivi (Blefish), see issue #599
2017-12-07mobileactivation: Allow passing activation response headers as required for ↵Gravatar Nikias Bassen2-18/+50
iOS 11.2+ When activating in session mode - which is required for newer iOS versions - we can now pass the activation response headers with the activation command. For iOS 11.2+ this is mandatory or the activation will fail.
2017-12-07mobileactivation: Don't convert activation record if it is already passed as ↵Gravatar Nikias Bassen1-0/+3
PLIST_DATA
2017-08-13lockdown: Don't explicitly validate pairing unless we're dealing with an ↵Gravatar Nikias Bassen3-12/+27
older device On newer iOS version, ValidatePair is not mandatory to gain trusted host status. Starting with iOS 11, the ValidatePair request has been removed from lockdownd and will throw an error. This commit adds a version check so that ValidatePair is only called on devices prior iOS 7.
2017-07-03mobileactivation: Add new functions required for drmHandshake / session mode ↵Gravatar Nikias Bassen2-3/+119
device activation
2017-06-29Add basic mobileactivation service implementationGravatar Nikias Bassen5-0/+387
2017-06-18idevicescreenshot: Detect screenshot image format to determine file extensionGravatar Nikias Bassen1-5/+15
2017-04-28Updated README with some notes about configuration optionsGravatar Nikias Bassen1-4/+14
2017-04-27gnutls: check for interrupted gnutls_handshake()Gravatar Nikos Mavrogiannopoulos1-3/+10
That is, recover if gnutls_handshake() returns with non fatal error codes like GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN.
2017-04-27cython: Fix build error after error constant renameGravatar Nikias Bassen1-2/+2
2017-04-26 #ifdef out code which is a no-op with OpenSSL 1.1.0Gravatar Christophe Fergeau1-0/+6
CRYPTO_set_id_callback CRYPTO_set_locking_callback EVP_cleanup CRYPTO_cleanup_all_ex_data SSL_COMP_free_compression_methods are all no-ops with OpenSSL 1.1.0, so we can #ifdef out the corresponding code. This cleans up some warnings about id_function/locking_function being defined but unused (as the calls to CRYPTO_set_id_callback and CRYPTO_set_locking_callback disappear at preprocessing time). Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-26Don't use ERR_remove_thread_state() with OpenSSL 1.1.0Gravatar Christophe Fergeau1-14/+16
It's deprecated and causes compile-time warnings. We don't want to fallback to ERR_remove_state() either as it's similarly deprecated. This commit adds a helper functions to hide the #ifdef mess between the various openssl versions. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-26Avoid double free with OpenSSL 1.1.0Gravatar Christophe Fergeau1-1/+9
Since commit OpenSSL_1_1_0-pre3~178 https://github.com/openssl/openssl/commit/b184e3ef73200cb3b7914a603b43a5b8a074c85f OpenSSL automatically cleans up some of its internal data when the program exits. This conflicts with some similar clean up libimobiledevice attempts to do, which causes a double-free. SSL_COMP_free_compression_methods() was available in OpenSSL 1.0.2, and is still there in 1.1.0 as a no-op, so we can use that to free the compression methods. This bug can be hit with a simple idevicebackup2 --help ==14299== Invalid read of size 4 ==14299== at 0x547AEBC: OPENSSL_sk_pop_free (stack.c:263) ==14299== by 0x508B848: ssl_library_stop (ssl_init.c:182) ==14299== by 0x5424D11: OPENSSL_cleanup (init.c:402) ==14299== by 0x5DC3134: __cxa_finalize (cxa_finalize.c:56) ==14299== by 0x53332B2: ??? (in /usr/lib64/libcrypto.so.1.1.0e) ==14299== by 0x4011232: _dl_fini (dl-fini.c:235) ==14299== by 0x5DC2DC7: __run_exit_handlers (exit.c:83) ==14299== by 0x5DC2E19: exit (exit.c:105) ==14299== by 0x5DA8604: (below main) (libc-start.c:329) ==14299== Address 0x6585590 is 0 bytes inside a block of size 40 free'd ==14299== at 0x4C2FCC8: free (vg_replace_malloc.c:530) ==14299== by 0x4E43381: sk_SSL_COMP_free (ssl.h:830) ==14299== by 0x4E434E7: internal_idevice_deinit (idevice.c:103) ==14299== by 0x5B79643: __pthread_once_slow (pthread_once.c:116) ==14299== by 0x4E5663A: thread_once (thread.c:104) ==14299== by 0x4E43525: libimobiledevice_deinitialize (idevice.c:140) ==14299== by 0x4011232: _dl_fini (dl-fini.c:235) ==14299== by 0x5DC2DC7: __run_exit_handlers (exit.c:83) ==14299== by 0x5DC2E19: exit (exit.c:105) ==14299== by 0x5DA8604: (below main) (libc-start.c:329) ==14299== Block was alloc'd at ==14299== at 0x4C2EB1B: malloc (vg_replace_malloc.c:299) ==14299== by 0x5428908: CRYPTO_zalloc (mem.c:100) ==14299== by 0x547A9AE: OPENSSL_sk_new (stack.c:108) ==14299== by 0x5087D43: sk_SSL_COMP_new (ssl.h:830) ==14299== by 0x5087D43: do_load_builtin_compressions (ssl_ciph.c:482) ==14299== by 0x5087D43: do_load_builtin_compressions_ossl_ (ssl_ciph.c:476) ==14299== by 0x5B79643: __pthread_once_slow (pthread_once.c:116) ==14299== by 0x547B198: CRYPTO_THREAD_run_once (threads_pthread.c:106) ==14299== by 0x5089F96: load_builtin_compressions (ssl_ciph.c:500) ==14299== by 0x5089F96: SSL_COMP_get_compression_methods (ssl_ciph.c:1845) ==14299== by 0x508B68B: ossl_init_ssl_base (ssl_init.c:125) ==14299== by 0x508B68B: ossl_init_ssl_base_ossl_ (ssl_init.c:25) ==14299== by 0x5B79643: __pthread_once_slow (pthread_once.c:116) ==14299== by 0x547B198: CRYPTO_THREAD_run_once (threads_pthread.c:106) ==14299== by 0x508B90A: OPENSSL_init_ssl (ssl_init.c:227) ==14299== by 0x4E43416: internal_idevice_init (idevice.c:73) = Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-08Fix parameter check of instproxy_check_capabilities_match()Gravatar BALATON Zoltan1-1/+1
The capabilities parameter is a string array not a plist. Also check other parameters when we are at it.
2017-04-08Define htobe16 if not definedGravatar BALATON Zoltan1-0/+4
2017-04-08Added IDEVICE_DEVICE_PAIRED event constant matching the correspondingGravatar BALATON Zoltan1-1/+2
event number in libusbmuxd
2017-04-08Propagate lower level errors to callers instead of returning unknownGravatar BALATON Zoltan4-40/+46
error for most failures
2017-01-18property_list_service: Remove packet length check when receiving plist dataGravatar Antoine Reversat1-46/+43
There are services that would send really large plist data, e.g. when listing provisioning profiles. Instead of forcing the data to be less than 16MB we try to allocate a buffer as large as requested. If the allocation fails the function returns with an error.
2017-01-04ideviceprovision: Silence compiler warning (missing parenthesis)Gravatar Nikias Bassen1-1/+1
2016-12-31Add ax_pthread.m4 for proper pthread cflags/ldflagsGravatar Nikias Bassen3-12/+495
2016-12-22ideviceprovision: Fix ASN1 parsing for large provisioning profilesGravatar Nikias Bassen1-12/+35
2016-12-21cython: Make sure to pass correct CFLAGS for libplistGravatar Nikias Bassen1-1/+1
2016-12-15idevicebackup2: Fix logical bug when checking for success of backup operationGravatar Nikias Bassen1-1/+1
The condition in line 2278 is incorrectly evaluated when mb2_status_check_snapshot_state() isn't able to read the Status.plist file. While `if (-1) { ... }` will be a 'false' condition, `if (1 && -1) { ... }` will be 'true' which in this case would make idevicebackup2 assume the backup was successful while it was not. This commit fixes this issue by changing the default return value of mb2_status_check_snapshot_state() to be 0 (false). Thanks to Xiao Deng for pointing out this issue!
2016-12-15ideviceprovision: Add new remove-all command to remove all installed ↵Gravatar Nikias Bassen1-4/+61
profiles at once
2016-12-01ideviceprovision: Allow copying single profiles instead of allGravatar Nikias Bassen1-6/+32
2016-12-01ideviceprovision: Check output directory parameter for 'copy' command and ↵Gravatar Nikias Bassen1-9/+13
return exit code on error
2016-12-01ideviceprovision: Use newer API to get list of profiles on iOS 9.3+Gravatar Nikias Bassen1-2/+30
2016-12-01misagent: Add new misagent_copy_all() function (introduced in iOS 9.3)Gravatar Nikias Bassen2-1/+63
2016-11-27idevicebackup2: Plug some small memory leaksGravatar Nikias Bassen1-8/+8
2016-11-04userpref: [GnuTLS] Fix pairing record generation and improve error handlingGravatar Nikias Bassen1-40/+45
In newer GnuTLS versions the parameters supplied to gnutls_x509_privkey_import_rsa_raw() are actually checked for somewhat sane values. Since we were passing the same values for all parameters, this check fails and the device certificate is never generated. However due to missing checks the pairing record was saved anyway, with an empty device certificate. This led to TLS errors during communication, leading to the "GnuTLS: Error in pull function" error message appearing and the communication to fail. This commit fixes the issue by passing some sane values, and also improves the overall error handling during generation of the paring record.
2016-11-02idevicebackup2: Fix heap buffer out-of-bounds write caused by wrong buffer sizeGravatar Nikias Bassen1-1/+1