~timmie/libimobiledevice/libimobiledevice-github

« back to all changes in this revision

Viewing changes to tools/idevicepair.c

  • Committer: Nikias Bassen
  • Date: 2019-02-08 08:00:36 UTC
  • Revision ID: git-v1:8ef9e51d8514a441dc9b7d035954691d880a543e
idevicepair: Fix 'validate' command which was broken since iOS 11

Apple removed the lockdownd command 'ValidatePair'. Validating a pairing
can just be done by trying to use the present pairing record to try to
start a lockdownd session: if it succeeds, the pairing is valid, otherwise
obviously not. So this is what we do now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * idevicepair.c
3
3
 * Manage pairings with devices and this host
4
4
 *
5
 
 * Copyright (c) 2014 Martin Szulecki All Rights Reserved.
6
 
 * Copyright (c) 2010 Nikias Bassen All Rights Reserved.
 
5
 * Copyright (c) 2010-2019 Nikias Bassen, All Rights Reserved.
 
6
 * Copyright (c) 2014 Martin Szulecki, All Rights Reserved.
7
7
 *
8
8
 * This library is free software; you can redistribute it and/or
9
9
 * modify it under the terms of the GNU Lesser General Public
266
266
                break;
267
267
 
268
268
                case OP_VALIDATE:
269
 
                lerr = lockdownd_validate_pair(client, NULL);
 
269
                lockdownd_client_free(client);
 
270
                client = NULL;
 
271
                lerr = lockdownd_client_new_with_handshake(device, &client, "idevicepair");
270
272
                if (lerr == LOCKDOWN_E_SUCCESS) {
271
273
                        printf("SUCCESS: Validated pairing with device %s\n", udid);
272
274
                } else {