There have been some API changes to the fido2 library, i.e., this project will currently not compile. Please see candy-stick-nrf for a working example.
CTAP2 firmware
src/
|-ctaphid/
| |-response.zig (for generating CTAPHID response packets)
| |-misc.zig (helper functions and constants)
| |-commands.zig (CTAPHID commands)
|-zigusb.zig (entry point and USB callbacks)
To build the project you must have installed the Zig compiler on your system.
You also need the arm-none-eabi
build tools.
sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib
sudo apt install gcc-arm-none-eabi
NOTE: Without
*-newlib
(Arch) you'll get the `fatal error: stdint.h: No such file or directory
Also make sure that you've git
installed. Then just run ./build
from the root directory.
To flash the firmware install edbg and then just run ./flash
from the
root directory.
Note: This project targets the SAM E51 Curiosity Nano, i.e. the ATSAME51J20A (ARM Cortex-M4F) chip.
To use the tools you need to install libfido2
.
sudo pacman -S libfido2
$ sudo apt install libfido2-1 libfido2-dev libfido2-doc fido2-tools
git clone https://github.com/Yubico/libfido2.git
cd libfido2
cmake -B build
make -C build
sudo make -C build install
- The
ztap
library doesn't sort keys automatically (due to a bug when calling the Zig sort function - program hangs). One must make sure that the returned CBOR is in CTAP canonical CBOR encoding form, e.g. the keys have to be sorted in a specific way. Otherwise libraries like libfido2 will complain.