Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Connection issues because of ~/.config/libimobiledevice

#281

I have an iPhone 3GS, iOS 5.1.1, currently not jailbroken, and a PC running Arch Linux (x86_64) with libimobiledevice 1.1.4 and usbmuxd 1.0.8.

When trying to run ideviceinfo as a normal user, it exited with code 141. When running it through strace I saw some socket communication ending with a SIGPIPE. When running the same command as root, no issue, everything worked fine.

So I ran them both through strace and compared the logs. The only relevant difference is the contents of $HOME/.config/libimobiledevice. In /root, it was something generated with an older version of libimobiledevice (15 July 2010). So I did the following tests:

  • Ran idevicepair unpair, pair, validate as my normal user, no difference.
  • Removed the config dir and redid the idevicepair dance, still no difference.
  • Copied /root/.config/libimobiledevice into my $HOME, chown'ed it, and ideviceinfo worked perfectly.
  • Moved it out, ran idevicepair again, ideviceinfo doesn't work anymore.

In the "correct" libimobiledevice directory, <device id>.pem is 251 bytes: "-----BEGIN RSA PUBLIC KEY-----", etc. In my $HOME, with current version of libimobiledevice, it's a 447 Kbytes binary blob:

$ file <device_id>.pem
<device_id>.pem: Mach-O executable acorn

(and in ideviceinfo DevicePublicKey is indeed a very very long string)

Any idea how to fix this? If you need more info please ask. I can also try git versions or try to git-bisect it.

Reported by Schnouki · August 28th, 2012 @ 03:31 PM

State: resolved
Milestone: 1.2.0 Release
Assigned to: Nikias Bassen Nikias Bassen

Activity

  1. Martin S.
    Martin S.
    • State changed from new to open
    • Tag set to ios 5.1.1, iphone 3gs, certificates, devicepublickey, ideviceinfo, pairing, x86_64
    • Milestone set to 1.2.0 Release
    • Milestone order changed from 190973 to 0

    Thanks for the report. It looks like your device certificate is corrupt (having a binary blob is wrong).

    Is your device protected by a passcode?
    Could you run ideviceinfo when it fails but adding the "-d" argument and attach the output as file?

    A fix might be to simply delete the corrupt <device id>.pem in your ~/.config/libimobiledevice directory.

    August 28th, 2012 @ 05:22 PM

  2. Schnouki
    Schnouki
    • Passcode: tried with and without, doesn't change anything.
    • Remove <device id.pem>: done it, but the one downloaded again by idevicepair is corrupted too.
    • When it fails, ideviceinfo -d has no output. (I can post you the log from usbmuxd if you want)

    One more thing. I ran strings <device_id>.pem, and apparently the blob is the IPSec "racoon" daemon, used in the "Corona" jailbreak. So it's very likely that it's a leftover of a failed jailbreak attempt (Linux versions of jailbreak tools are quite unreliable, and Windows versions don't work very well in VirtualBox...). I'll try to do a full restore with iTunes tomorrow and I'll let you know.

    Thanks for your help!

    August 28th, 2012 @ 06:44 PM

  3. Martin S.
    Martin S.
    • Assigned user set to Nikias Bassen
    • Milestone order changed from 17 to 0

    @Nikias: Possible that Corona breaks pairing here?!

    August 29th, 2012 @ 02:51 PM

  4. Nikias Bassen
    Nikias Bassen

    Hi Schnouki,
    yes this is in fact an artifact of a failed jailbreak attempt... the only way to make your device connect again would be by recovering the original device public key (e.g. from your root folder?)
    Sorry for the inconenience...

    August 30th, 2012 @ 01:09 PM

  5. Schnouki
    Schnouki

    Nikias, thanks a lot. I just did a full restore from iTunes and it fixed the problem, I now have a valid public key in ideviceinfo and when I run idevicepair.

    It's probably a rare issue if I'm the first one to mention it here, but I think it would be nice to at least check if the device certificate looks like a public key when running idevicepair.

    Anyway, it works now. Thanks for your help!

    August 30th, 2012 @ 04:40 PM

  6. Martin S.
    Martin S.
    • State changed from open to resolved

    Looks like the issue is confirmed and caused by a failed jailbreak attempt.

    Thanks for reporting.

    September 5th, 2012 @ 12:19 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.