Nicolás Alvareznicolas17@treehouse.systems
Jul 5, 2024, 2:45 PMThe details about Pallas are complex so I'll probably put that in a separate page.
The details about Pallas are complex so I'll probably put that in a separate page.
I just reverse engineered (with no practical purpose) how the Signature is calculated in Apple's mesu plists. It's so cursed. They have a totally custom way to encode and hash the plist, before feeding it into RSA.
Hashing a string is sha1(string.toUTF8() + "\0"). Hashing an array consists of hash("array") xor hash(a[0]) xor hash(a[1]) ... xor hash(a[n-1]). Hashing integers works differently for the range [-1, 12]. Why?!
The handling of UTF-8 strings is quite broken (they allocate n bytes to hold n UTF-8 characters) but they can't fix it without breaking compatibility. I had to reimplement the brokenness too :blobcatumm: