passinglink / passinglink

Open source game controller firmware, with support for PS3, PS4 and Switch
MIT License
168 stars 23 forks source link

DS4 auth passthrough? #4

Open dogtopus opened 3 years ago

dogtopus commented 3 years ago

Since key extraction only works with specific hard-to-find hardware (namely JDM-001), it would be nice to have a passthrough setup instead.

Having the ability to use the A7105 security chip would also be desireable since sometimes there might be cheap (new/used) PS4 licensed controller-esque thingy (e.g. guitar hero dongle, media remote, etc.) for sale. I documented the protocol ages ago: https://gist.github.com/dae307c7773e792150990a06e79583d0

BTW nice firmware. If Zephyr supports teensy I will probably immediately abandon my own in-house fw for my Project Diva controller LOL. (Sadly it doesn't and both pjrc and zephyr don't seem to have the interest of supporting it)

jmgao commented 3 years ago

Yeah, auth passthrough has been on the TODO list for a while and the PS5 being impending moves it up my priority list a bunch. I added Bluetooth support recently for an unrelated project (managing spectator mode in Gundam EXVS for streaming tournaments), and I'm planning on using that for tethered authentication to a smartphone (to either a controller plugged directly in or over the internet).

I've been wanting to make things more general, instead of being only an arcade stick, so another real user would be nice :-) What would it take for you to switch from teensy to other hardware?

dogtopus commented 3 years ago

Not a lot since I did have the plan to switch to STM32 (or at least make it an option) for better availability and higher performance per price ratio.

Also forget about the abandon part since I'm still planning to finish the Arduino library that powers my in-house fw so that the Arduino part of the homebrew controller scene for current-gen-and-going-to-be-the-previous-gen consoles will get covered :P

BTW I'm also looking at DS5 controllers. See my gist for some notes I made about DS5 report format (or just wait for hid-sony maintainer's internal docs). One thing to note is that the auth definitely changed and $**y might adopted ECC. Also there seems to be some weird 64-bit checksum/MAC thingy going on with the USB input report and I have no clue what it is so far (even if it's just custom poly crc64 it would be practically impossible to just brute-force it because 64-bit). I bet that PS5 would check this as a way to "authenticate" the input report.

So for DS5 my suggesstion now is to hold on, wait and see if more clue pops up that might uncover what the trailing 64-bit actually is (or actively try to find such clues). Things like poorly secured 3rd party controllers, hid-sony "accidentally" leak the algorithm or eventual PS5/DS5 firmware dump.

dogtopus commented 3 years ago

After a bit of digging, it seems that Zephyr didn't have built in USB host support and the related issue went stale for almost 2 years. Is this why it ended up on your TODO list for so long?

jmgao commented 3 years ago

Yeah, there are people actively working on it right now though. From yesterday on the zephyr slack: "Host support is WiP, a draft PR will be opened soon (delayed because of a second controller driver issues)."

dogtopus commented 3 years ago

I'll start porting PL to my STM32F407 discovery board as soon as I got some time. I'll also make a simple host-only breakout board for the secondary USB (along with a lot of other boards I wanted to make for this year lol).