Universal Second Factor (U2F) USB Key Device

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
BenLunt
Member
Member
Posts: 1029
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Universal Second Factor (U2F) USB Key Device

Post by BenLunt »

I recently came across QEMU's U2F emulation and decided to give it a try. I haven't seen anything about U2F here in this forum and a quick search doesn't bring anything up either, so I thought I might just point you to a brief article I wrote.

If you already have a working USB HID driver, it actually is quite simple once you know how it works. I started out with the older specification, not knowing there was a newer one, and couldn't figure out why I couldn't get it to work. Once I went through the emulation source code, which didn't match the specification I was reading, I figured there had to be a newer version, and so there was.

It uses the USB HID Interrupt pipe to transfer data using 64-byte frames. Each frame has a 5- or 7-byte header while the Message Command then has another 7-byte header.

It was quite interesting to work with. I have a working driver, but will need to read up on ECDSA to figure out exactly what data is returned.

There is also notes in the specification about "cheap devices". I think I might look for a "cheap device" and see if I can get it to work on physical hardware.

Anyway, just thought I would comment since I didn't see anything about U2F here. (If I am wrong, please point me to the post)

Thanks,
Ben
Post Reply