GuardianFirewall / foreman

A simple nodejs server that acts as a keystore for Grandmaster.
BSD 3-Clause "New" or "Revised" License
20 stars 6 forks source link

Firmware keys printed twice in json output #5

Closed matteyeux closed 4 years ago

matteyeux commented 4 years ago

Hey, when I curl on api/find/combo/iPod9,1/17A860, after iosvers keys are printed again. This time the key is not images but the path to iBSS :

» curl https://foreman-public.sudosecuritygroup.com/api/find/combo/iPod9,1/17A860 | jq .  
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1384    0  1384    0     0   2239      0 --:--:-- --:--:-- --:--:--  2239
{
  "build": "17A860",
  "device": "iPod9,1",
  "download": "http://updates-http.cdn-apple.com/2019FallFCS/fullrestores/061-22555/3741992C-E18B-11E9-8A3F-B66496A9EC6E/iPodtouch_7_13.1.2_17A860_Restore.ipsw",
  "images": {
    "Firmware/dfu/iBSS_n112_RELEASE_im4p": "ebdff89b592a72fad7f6960d1a46ee81dda4ab3c84b0befa2107f4c1d5b3fd4b748e732e76b894b2a7adcda821bbaec0",
    "Firmware/dfu/iBEC_n112_RELEASE_im4p": "4cb3284b620bb4da58f76e543ea4693585710488f4c565d161746a75d709186e0e92e103089ea9ec46ac68526c4b12ce",
    "Firmware/all_flash/iBoot_n112_RELEASE_im4p": "a936dc24d4eed3d112c84b7722f5af20a7bdb4aa3767e6ff1ca9c32006357a6a1b3371aa4fac51c5e60874a6d670c31c",
    "Firmware/all_flash/LLB_n112_RELEASE_im4p": "b638866ac9a838ab6609f61a210d019b4ab658ceb6a39ae7951b41dfdac4408f7a80a0bdc9d179fe4a5fc17db1a1ef7f"
  },
  "iosver": "13.1.2",
  "Firmware/dfu/iBSS.n112.RELEASE.im4p": { <---- path to file instead of "images"
    "Firmware/all_flash/LLB.n112.RELEASE.im4p": "b638866ac9a838ab6609f61a210d019b4ab658ceb6a39ae7951b41dfdac4408f7a80a0bdc9d179fe4a5fc17db1a1ef7f",
    "Firmware/all_flash/iBoot.n112.RELEASE.im4p": "a936dc24d4eed3d112c84b7722f5af20a7bdb4aa3767e6ff1ca9c32006357a6a1b3371aa4fac51c5e60874a6d670c31c",
    "Firmware/dfu/iBEC.n112.RELEASE.im4p": "4cb3284b620bb4da58f76e543ea4693585710488f4c565d161746a75d709186e0e92e103089ea9ec46ac68526c4b12ce",
    "Firmware/dfu/iBSS.n112.RELEASE.im4p": "ebdff89b592a72fad7f6960d1a46ee81dda4ab3c84b0befa2107f4c1d5b3fd4b748e732e76b894b2a7adcda821bbaec0"
  }
}

It also happens on other endpoints like https://foreman-public.sudosecuritygroup.com/api/find/device/iPod9,1 and https://foreman-public.sudosecuritygroup.com/api/find/build/17A860.

Haifisch commented 4 years ago

Hey, thanks for the report! I believe it's a issue with this function, I'll revise and push to a new development branch soon.

Haifisch commented 4 years ago

Okie doke, just pushed to development. Just simplified the method, not too sure why I opted to add the additional reformatting and what I had there was a bit wild/over-baked in hindsight.

Feel free to pull from that branch until I decide to merge in the future with some more stuff fixed up.

matteyeux commented 4 years ago

Hi, thank you for you commit !