Firmware for the Pico / Pico 2 that acts as a USB FIDO2 authenticator: CTAP2 and U2F, passkeys, BOOTSEL as the touch button, and clientPIN with PIN/UV auth protocols 1 and 2. A host simulator runs the same core so the python-fido2 test suite exercises it without hardware. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
498 B
C
24 lines
498 B
C
// Simulator: speaks CTAPHID over stdin/stdout, one 64-byte packet at a time.
|
|
#include "ctaphid.h"
|
|
#include "host.h"
|
|
#include "pin.h"
|
|
#include "platform.h"
|
|
#include "presence.h"
|
|
#include "storage.h"
|
|
|
|
#define TICK_MS 50
|
|
|
|
int main(void) {
|
|
uint8_t packet[HID_PACKET_SIZE];
|
|
|
|
platform_init();
|
|
storage_init();
|
|
pin_init();
|
|
ctaphid_init();
|
|
for (;;) {
|
|
if (host_receive(packet, TICK_MS)) ctaphid_handle_packet(packet);
|
|
ctaphid_tick();
|
|
presence_tick();
|
|
}
|
|
}
|