libmicrofido2

Minimal FIDO2 library for microcontrollers

https://github.com/all-your-locks-are-belong-to-us/libmicrofido2

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.4%) to scientific vocabulary

Keywords

avr c ctap2 esp32 fido2 microcontroller relying-party
Last synced: 6 months ago · JSON representation ·

Repository

Minimal FIDO2 library for microcontrollers

Basic Info
  • Host: GitHub
  • Owner: All-Your-Locks-Are-Belong-To-Us
  • License: other
  • Language: C
  • Default Branch: main
  • Homepage:
  • Size: 320 KB
Statistics
  • Stars: 19
  • Watchers: 2
  • Forks: 6
  • Open Issues: 7
  • Releases: 0
Topics
avr c ctap2 esp32 fido2 microcontroller relying-party
Created over 3 years ago · Last pushed over 3 years ago
Metadata Files
Readme License Citation

README.md

libmicrofido2 - Minimal FIDO2 Library for Microcontrollers

libmicrofido2 is a minimal FIDO2 library that is designed to be used in microcontrollers. It is heavily inspired by the libfido2 and aims to have a similar API.

Features

  • No heap allocations: All structures are allocated on the stack.
  • Physical layer agnostic: The transport layer is left mostly to the user, so regardless of whether you want to use USB, NFC, or any other technology you can use this library. While we implemented the base layer for NFC, this can be easily implemented for other physical layers as well.
  • Fully customizable cryptographic algorithms: All of the cryptographic algorithms (Ed25519, AES GCM, SHA256, SHA512) can be replaced by the user entirely to enable hardware acceleration (see examples/nrf52/hwcrypto/hwcrypto.c).

Limitations

  • We chose the cryptographic library implementations that papers say were the fastest, as that was what mattered to us the most. However, we have not evaluated their security regarding attacks such as side-channel attacks.
  • Random Number Generation is currently not implemented. (#42)
  • The large blob currently cannot be written. (#43)
  • Only a minimal subset of the CTAP 2.1 commands are supported (authenticatorGetInfo, authenticatorLargeBlobs, authenticatorGetAssertion).
  • Only a minimal subset of cryptographic algorithms specified in the FIDO2 standard supported. For signature verification, only Ed25519 is supported.
  • Variable length fields and fields with arbitrary values (like the extension field in authenticatorGetInfo) are not supported. Instead, these fields are parsed into statically allocatable structures (see info.h and info.c for examples of this).

Building

The build system is based on cmake >= 3.10.

Desktops

You can build the library for desktops (we tested Linux and macOS):

bash mkdir -p build && cd build cmake .. -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=Debug # Or Release make -j

Using Toolchains (AVR-only)

Currently, we only provide a toolchain file for the ATmega (see #37). With that, you can easily build the library as a static library as follows:

```bash mkdir -p build && cd build

for AVR8 Debug builds

cmake .. -DCMAKEVERBOSEMAKEFILE=1 -DCMAKETOOLCHAINFILE=../avr.toolchain -DCMAKEBUILDTYPE=Debug

for AVR8 Release builds

cmake .. -DCMAKEVERBOSEMAKEFILE=1 -DCMAKETOOLCHAINFILE=../avr.toolchain -DCMAKEBUILDTYPE=Release make -j ```

Other Systems

Building the library for other systems depends on the framework you use for your microcontroller. We provide examples for the ESP-32 using ESP-IDF and the nRF52 using Zephyr.

Usage

We provide fairly extensive examples of using this library in the examples directory. Most of the time, you'll only need to #include <fido.h> as that file includes most of the others. In case you want to overwrite the implementation of the cryptographic algorithms, also checkout the crypto.h and random.h files.

Development

We are happy to receive any PRs that further improve this library. In case you want to modify the library for your needs, checkout DEVELOPMENT.md.

Acknowledgements

This library references code from:

Owner

  • Name: All Your Locks Are Belong To Us
  • Login: All-Your-Locks-Are-Belong-To-Us
  • Kind: organization
  • Location: Germany

Using FIDO for Electronic Locking Systems

Citation (CITATION.cff)

cff-version: 1.2.0
title: >-
  A Minimal FIDO2 Library for Microcontrollers
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
date-released: 2022-08-31
authors:
  - given-names: Felix
    family-names: Gohla
    email: felix.gohla@student.hpi.de
  - given-names: Konrad
    family-names: Hanff
    email: konrad.hanff@student.hpi.de
  - given-names: Tobias
    family-names: Kantusch
    email: tobias.kantusch@student.hpi.de
  - given-names: Quentin
    family-names: Kuth
    email: quentin.kuth@student.hpi.de
  - given-names: Felix
    family-names: Roth
    email: felix.roth@student.hpi.de

GitHub Events

Total
  • Watch event: 3
  • Fork event: 1
Last Year
  • Watch event: 3
  • Fork event: 1

Dependencies

examples/nrf52/Dockerfile docker
  • debian bullseye-slim build