libimobiledevice / libideviceactivation

A library to handle the activation process of iOS devices
https://libimobiledevice.org
GNU Lesser General Public License v2.1
276 stars 129 forks source link

idevice_activation_header_callback function fails to parse well-formed HTTP headers #47

Closed jarosz closed 1 year ago

jarosz commented 3 years ago

Hi.

With ideviceactivation.exe from https://appletech752.com/downloads.html binaries I've got an error "Failed to send request or retrieve response."

Same error with ideviceactivation.exe from https://github.com/libimobiledevice-win32/imobiledevice-net/releases/tag/v1.3.6

I've compiled libimobiledevice myself with https://github.com/libimobiledevice-win32/libimobiledevice-vs to debug this application. I've found out, that Content-Type header wasn't parsed properly.

Steps to reproduce:

  1. Serve an URL with header different from "Content-Type: text/html", for example 'Content-type: text/html; charset=UTF-8'
  2. Run ideviceactivation -s URL -d and stop debugging at activation.c:522

Expected result: response->content_type should be set to IDEVICE_ACTIVATION_CONTENT_TYPE_HTML

Actual result: response->content_type set to IDEVICE_ACTIVATION_E_UNKNOWN_CONTENT_TYPE.

I've created a patch to fix this issue, it works for me, but I tried it only on Windows 64-bit.

nikias commented 1 year ago

Fixed.