Close

Initial progress

A project log for ST-Link V2 clone Security Key

Cheap and DIY alternative to commercial security keys such as Yubikey using ST-Link V2 clone dongle

Matias N.Matias N. 04/02/2019 at 20:540 Comments

The last few days I've starting the porting process of the SoloKey firmware to NuttX RTOS. The first step was to actually add a raw HID USB driver to NuttX, which is the underlying transport for CTAP, the FIDO2 standard protocol. This is currently working (with nothing fancy) so I guess I can tick that item off.

The next step (currently working on this) is the porting of the actual logic of the SoloKey firmware to a NuttX application. Luckily, the guys from SoloKey did things right and defined a very simple interface which should be implemented by the target platform. Thus, I need to provide implementation for this interface while at the same time write my own main function. At the moment I managed to build everything without exceeding FLASH size limit (currently at around 81K of the 128K) and there's still room for reduction by disabling unrequired NuttX features. However, I'm currently struggling with the required stack size. For this I had to reduce some internal buffers used by the SoloKey firmware.

Currently I need to finish the implementation of the interface, which mostly involves dealing with the on-board flash as storage for the secret keys and other non-volatile data. There's also the crypto implementation which will be purely done in software. I will simply re-use everything provided with solo and later see what I can take from NuttX instead.

Regarding the hardware side, I already have available a pair of ST-Link dongles (one for programming, the other will be the victim) and the 128x32 OLED, which I must say is the perfect size for this. I'm also trying to see how this would fit along two buttons inside a case, which I think is perfectly doable.

Discussions