#
✕ nick:chadmed
#asahi-re · 2022-07-17 06:19
chadmedyeah there is some sort of negotiation sequence but ofc its encrypted. xnu seems to only load the sep shim driver too
#asahi-re · 2022-07-17 06:10
chadmedlet me look at the logs i dumped
#asahi-re · 2022-07-17 06:10
chadmedyeah
#asahi-re · 2022-07-17 06:10
chadmedyeah it cant i tried poking at the big data packet and it was all nonsense
#asahi-re · 2022-07-17 05:57
chadmedbut idk what it is now im doubting myself constantly :P
#asahi-re · 2022-07-17 05:57
chadmedit does send some silly amount of data over SIO when your finger is on it, which i originally thought might be fingerprint data
#asahi-re · 2022-07-17 05:56
chadmedbut alas no
#asahi-re · 2022-07-17 05:56
chadmedwell my initial plan was to see if we could get fingerprint data out of mesa directly somehow and do it like that until the SEP works
#asahi-re · 2022-07-17 05:55
chadmedif we sort of do the same thing apple does (use the SEP to mediate authentication) then we might not need to, but then touchid support is effectively blocked until we have SEP support
#asahi-re · 2022-07-17 05:54
chadmedyeah so figuring out how mesa interacts with the SEP is going to be almost impossible
#asahi-re · 2022-07-17 05:49
chadmedthe SEP FW is encrypted so we cant really look at it in ghidra can we?
#asahi-re · 2022-07-17 05:49
chadmedto effectively trace mesa i think we need to know a) the endpoint in the SEP the APs use to talk to it about mesa, and b) whatever interface mesa talks to the SEP over which might even just be staight up impossible idk
#asahi-re · 2022-07-17 05:48
chadmedi did try hacking on the tracer sven wrote but it was a goose chase
#asahi-re · 2022-07-17 05:47
chadmedwell yeah but like i said the SEP tracer isnt really useful for this (yet)
#asahi-re · 2022-07-17 05:46
chadmedand these are the only two DMA channels associated with mesa on the SPI bus so it _must_ be talking to the SEP over a private interface
#asahi-re · 2022-07-17 05:46
chadmedit just stops after powering it on then a few seconds later there is encrypted data
#asahi-re · 2022-07-17 05:46
chadmedtheres no apparent negotiation or anything like that
#asahi-re · 2022-07-17 05:45
chadmedand i say that because after the power on pings early in boot, theres no more data sent across the interface for a while then all of a sudden there is just encrypted commands
#asahi-re · 2022-07-17 05:45
chadmedi could probably check without dicking around in m1n1 too but im like ~80% sure that its not the full fat driver
#asahi-re · 2022-07-17 05:43
chadmedBUT, theres also a much much smaller driver which is just a shim for the SEP interface and i think thats the one these machines use
#asahi-re · 2022-07-17 05:43
chadmedtheres a few functions in one of the mesa drivers associated with encrypting and transmitting a command buffer
#asahi-re · 2022-07-17 05:40
chadmedi dont think it is
#asahi-re · 2022-07-17 05:39
chadmedafter that the data is encrypted and changes on every boot (the format/packet size stays the same though which is why i think its an encrypted command buffer)
#asahi-re · 2022-07-17 05:38
chadmedthe only repeatable and intelligible data is a bringup sequence (which seems to just be the APs asking if its awake)
#asahi-re · 2022-07-17 05:37
chadmedno it talks to the APs over the same SIO interface that the kb and touchpad do
#asahi-re · 2022-07-17 04:35
chadmedand to really rub salt in the wound, tracing the SEP is too slow to reliably get anything useful. mesa seems to time out waiting for the SEP to tell it something which invalidates the input data and makes macos refuse to accept it
#asahi-re · 2022-07-17 04:33
chadmedthe only data that is trafficked between it and the APs seems to be an encrypted command buffer of some kind to bring it up and tell it to wait for a fingerprint. everything else goes to the SEP
#asahi-re · 2022-07-17 04:31
chadmedrqou_: i gave up on touchid (mesa) if you wanna have a crack at that. it has a private interface to SEP that i _think_ might be impossible to snoop on from the HV and im not skilled enough to really go beyond what ive already pushed into m1n1 :/
#asahi-re · 2022-06-16 06:15
chadmedin fact the RE policy specifically says this
#asahi-re · 2022-06-16 06:06
chadmedthe legal problem with these is that in most cases, merely having the software at all is the illegal part
#asahi-re · 2022-06-16 06:05
chadmedrule of thumb is apple internal stuff = no no
#asahi-re · 2022-06-16 05:47
chadmedbeing AppleInternal you shouldnt use any reg names that cant be corroborated with publicly available sources
#asahi-re · 2022-06-16 05:45
chadmedhow did you get HomeDiagnostic?
#asahi-re · 2022-06-16 05:32
chadmedimo you should be fine even with ones that arent since theyre just register names and youre not copying any of the actual code that can be considered IP (control flow and algorithms)
#asahi-re · 2022-06-16 05:32
chadmedif theyre in the XNU source then theyre fair game regardless since apple freely publish that
#asahi-re · 2022-06-16 05:20
chadmedhow did you get them? register names arent by themselves copyrightable material afaik so unless youre under NDA to not publish them then you should be okay
#asahi-re · 2022-04-18 08:36
chadmedit's dog slow without filevault in the ignorelist thought ;)
#asahi-re · 2022-04-18 08:36
chadmedSEP tracer still seems to work as intended
#asahi-re · 2022-04-17 11:13
chadmedooh yes the fun continues :D
#asahi-re · 2022-04-17 11:09
chadmedoh well good to know i was (kind of) on the right track but theres probably no point in going any further without the SEP to talk to
#asahi-re · 2022-04-17 11:08
chadmedalso handles power gating, command syncrhonisation, etc
#asahi-re · 2022-04-17 11:08
chadmedthe SEP shim seems to do the actual encryption etc and this bigger one actually sends/receives the data i think
#asahi-re · 2022-04-17 11:08
chadmedits interesting because theres actually two drivers for xnu, one does in fact just look like a shim for the SEP but the other is quite large and kind of does what ive been trying to do in my crappy little tracer and seems to handle the low level operation of the device
#asahi-re · 2022-04-17 11:04
chadmedwell at least i kind of understand the format and the power on sequence but i think decrypting the command buffer and getting any useful data out of it is probably beyond me :(
#asahi-re · 2022-04-17 11:04
chadmedyeah i was just confused as to why there was no discernible pattern in any of the data at all beyond the addresses it accesses and got gaslit into going on a goose chase
#asahi-re · 2022-04-17 10:59
chadmedoh the command buffer for the fingerprint sensor is encrypted in both directions after the power on sequence
#asahi-re · 2022-04-17 04:51
chadmedi still dont know where this 0x2 is coming from and what that endpoint is trying to do with it, but this is progress i guess
#asahi-re · 2022-04-17 04:49
chadmedbut if i try to do that after removing my finger, the pages are unmapped
#asahi-re · 2022-04-17 04:48
chadmedhmm so the sio dart seems to map the memory range with the fingerprint data in it _only_ while youre actively touching the sensor. if i break into the hypervisor while touching, i can add that range to RegMonitor, poll it, and get a huge dump of data
#asahi-re · 2022-04-17 04:30
chadmedi dont _think_ the offsets im reading out of the iova block are wrong since size always returns 0x7200 when you put your finger down

plus ›