xref: /freebsd-src/contrib/libfido2/README.adoc (revision 60a517b66a69b8c011b04063ef63a938738719bd)
10afa8e06SEd Maste== libfido2
20afa8e06SEd Maste
30afa8e06SEd Masteimage:https://github.com/yubico/libfido2/workflows/linux/badge.svg["Linux Build Status (github actions)", link="https://github.com/Yubico/libfido2/actions"]
40afa8e06SEd Masteimage:https://github.com/yubico/libfido2/workflows/macos/badge.svg["macOS Build Status (github actions)", link="https://github.com/Yubico/libfido2/actions"]
50afa8e06SEd Masteimage:https://github.com/yubico/libfido2/workflows/windows/badge.svg["Windows Build Status (github actions)", link="https://github.com/Yubico/libfido2/actions"]
60afa8e06SEd Masteimage:https://github.com/yubico/libfido2/workflows/fuzzer/badge.svg["Fuzz Status (github actions)", link="https://github.com/Yubico/libfido2/actions"]
70afa8e06SEd Masteimage:https://oss-fuzz-build-logs.storage.googleapis.com/badges/libfido2.svg["Fuzz Status (oss-fuzz)", link="https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libfido2"]
80afa8e06SEd Maste
90afa8e06SEd Maste*libfido2* provides library functionality and command-line tools to
102ccfa855SEd Mastecommunicate with a FIDO device over USB or NFC, and to verify attestation and
110afa8e06SEd Masteassertion signatures.
120afa8e06SEd Maste
133e696dfbSEd Maste*libfido2* supports the FIDO U2F (CTAP 1) and FIDO2 (CTAP 2) protocols.
140afa8e06SEd Maste
150afa8e06SEd MasteFor usage, see the `examples/` directory.
160afa8e06SEd Maste
170afa8e06SEd Maste=== License
180afa8e06SEd Maste
190afa8e06SEd Maste*libfido2* is licensed under the BSD 2-clause license. See the LICENSE
200afa8e06SEd Mastefile for the full license text.
210afa8e06SEd Maste
220afa8e06SEd Maste=== Supported Platforms
230afa8e06SEd Maste
240afa8e06SEd Maste*libfido2* is known to work on Linux, macOS, Windows, OpenBSD, and FreeBSD.
250afa8e06SEd Maste
260afa8e06SEd Maste=== Documentation
270afa8e06SEd Maste
280afa8e06SEd MasteDocumentation is available in troff and HTML formats. An
290afa8e06SEd Mastehttps://developers.yubico.com/libfido2/Manuals/[online mirror of *libfido2*'s documentation]
300afa8e06SEd Masteis also available.
310afa8e06SEd Maste
320afa8e06SEd Maste=== Bindings
330afa8e06SEd Maste
340afa8e06SEd Maste* .NET: https://github.com/borrrden/Fido2Net[Fido2Net]
350afa8e06SEd Maste* Go: https://github.com/keys-pub/go-libfido2[go-libfido2]
360afa8e06SEd Maste* Perl: https://github.com/jacquesg/p5-FIDO-Raw[p5-FIDO-Raw]
370afa8e06SEd Maste* Rust: https://github.com/PvdBerg1998/libfido2[libfido2]
380afa8e06SEd Maste
392ccfa855SEd Maste=== Releases
402ccfa855SEd Maste
41*60a517b6SEd MasteThe current release of *libfido2* is 1.14.0. Signed release tarballs are
422ccfa855SEd Masteavailable at Yubico's
432ccfa855SEd Mastehttps://developers.yubico.com/libfido2/Releases[release page].
442ccfa855SEd Maste
452ccfa855SEd Maste=== Dependencies
462ccfa855SEd Maste
472ccfa855SEd Maste*libfido2* depends on https://github.com/pjk/libcbor[libcbor],
482ccfa855SEd Mastehttps://www.openssl.org[OpenSSL] 1.1 or newer, and https://zlib.net[zlib].
492ccfa855SEd MasteOn Linux, libudev
502ccfa855SEd Maste(part of https://www.freedesktop.org/wiki/Software/systemd[systemd]) is also
512ccfa855SEd Masterequired.
522ccfa855SEd Maste
530afa8e06SEd Maste=== Installation
540afa8e06SEd Maste
552ccfa855SEd Maste==== Fedora 35 and 34
560afa8e06SEd Maste
572ccfa855SEd Maste  $ sudo dnf install libfido2 libfido2-devel fido2-tools
580afa8e06SEd Maste
592ccfa855SEd Maste==== Ubuntu 22.04 (Jammy) and 20.04 (Focal)
600afa8e06SEd Maste
612ccfa855SEd Maste  $ sudo apt install libfido2-1 libfido2-dev libfido2-doc fido2-tools
620afa8e06SEd Maste
630afa8e06SEd MasteAlternatively, newer versions of *libfido2* are available in Yubico's PPA.
640afa8e06SEd MasteFollow the instructions for Ubuntu 18.04 (Bionic) below.
650afa8e06SEd Maste
660afa8e06SEd Maste==== Ubuntu 18.04 (Bionic)
670afa8e06SEd Maste
680afa8e06SEd Maste  $ sudo apt install software-properties-common
690afa8e06SEd Maste  $ sudo apt-add-repository ppa:yubico/stable
700afa8e06SEd Maste  $ sudo apt update
712ccfa855SEd Maste  $ sudo apt install libfido2-1 libfido2-dev libfido2-doc fido2-tools
720afa8e06SEd Maste
732ccfa855SEd MasteOn Linux, you may need to add a udev rule to be able to access the FIDO
742ccfa855SEd Mastedevice. For example, the udev rule may contain the following:
750afa8e06SEd Maste
760afa8e06SEd Maste----
770afa8e06SEd Maste#udev rule for allowing HID access to Yubico devices for FIDO support.
780afa8e06SEd Maste
790afa8e06SEd MasteKERNEL=="hidraw*", SUBSYSTEM=="hidraw", \
800afa8e06SEd Maste  MODE="0664", GROUP="plugdev", ATTRS{idVendor}=="1050"
810afa8e06SEd Maste----
822ccfa855SEd Maste
832ccfa855SEd Maste==== macOS
842ccfa855SEd Maste
852ccfa855SEd Maste  $ brew install libfido2
862ccfa855SEd Maste
872ccfa855SEd Maste==== Windows
882ccfa855SEd Maste
892ccfa855SEd MastePlease consult Yubico's
902ccfa855SEd Mastehttps://developers.yubico.com/libfido2/Releases[release page] for ARM, ARM64,
912ccfa855SEd MasteWin32, and Win64 artefacts.
922ccfa855SEd Maste
932ccfa855SEd Maste=== Building from source
942ccfa855SEd Maste
952ccfa855SEd MasteOn UNIX-like systems:
962ccfa855SEd Maste
972ccfa855SEd Maste  $ cmake -B build
982ccfa855SEd Maste  $ make -C build
992ccfa855SEd Maste  $ sudo make -C build install
1002ccfa855SEd Maste
1012ccfa855SEd MasteDepending on the platform,
1022ccfa855SEd Mastehttps://www.freedesktop.org/wiki/Software/pkg-config/[pkg-config] may need to
1032ccfa855SEd Mastebe installed, or the PKG_CONFIG_PATH environment variable set. For complete,
1042ccfa855SEd MasteOS-specific build instructions, please refer to the `.actions/`
1052ccfa855SEd Maste(Linux, macOS, BSD) and `windows/` directories.
1062ccfa855SEd Maste
1072ccfa855SEd Maste=== Build-time Customisation
1082ccfa855SEd Maste
1092ccfa855SEd Maste*libfido2* supports a number of CMake options. Some of the options require
1102ccfa855SEd Masteadditional dependencies. Options that are disabled by default are not
1112ccfa855SEd Masteofficially supported.
1122ccfa855SEd Maste
1132ccfa855SEd Maste[%autowidth.stretch]
1142ccfa855SEd Maste|===
1152ccfa855SEd Maste|*Option*           |*Description*                            |*Default*
1162ccfa855SEd Maste| BUILD_EXAMPLES    | Build example programs                  | ON
1172ccfa855SEd Maste| BUILD_MANPAGES    | Build man pages                         | ON
1182ccfa855SEd Maste| BUILD_SHARED_LIBS | Build a shared library                  | ON
1192ccfa855SEd Maste| BUILD_STATIC_LIBS | Build a static library                  | ON
1202ccfa855SEd Maste| BUILD_TOOLS       | Build auxiliary tools                   | ON
1212ccfa855SEd Maste| FUZZ              | Enable fuzzing instrumentation          | OFF
1222ccfa855SEd Maste| NFC_LINUX         | Enable netlink NFC support on Linux     | ON
1232ccfa855SEd Maste| USE_HIDAPI        | Use hidapi as the HID backend           | OFF
1242ccfa855SEd Maste| USE_PCSC          | Enable experimental PCSC support        | OFF
1252ccfa855SEd Maste| USE_WINHELLO      | Abstract Windows Hello as a FIDO device | ON
1262ccfa855SEd Maste|===
1272ccfa855SEd Maste
1282ccfa855SEd MasteThe USE_HIDAPI option requires https://github.com/libusb/hidapi[hidapi]. The
1292ccfa855SEd MasteUSE_PCSC option requires https://github.com/LudovicRousseau/PCSC[pcsc-lite] on
1302ccfa855SEd MasteLinux.
1312ccfa855SEd Maste
1322ccfa855SEd Maste=== Development
1332ccfa855SEd Maste
1342ccfa855SEd MastePlease use https://github.com/Yubico/libfido2/discussions[GitHub Discussions]
1352ccfa855SEd Masteto ask questions and suggest features, and
1362ccfa855SEd Mastehttps://github.com/Yubico/libfido2/pulls[GitHub pull-requests] for code
1372ccfa855SEd Mastecontributions.
1382ccfa855SEd Maste
1392ccfa855SEd Maste=== Reporting bugs
1402ccfa855SEd Maste
1412ccfa855SEd MastePlease use https://github.com/Yubico/libfido2/issues[GitHub Issues] to report
1422ccfa855SEd Mastebugs. To report security issues, please contact security@yubico.com. A PGP
1432ccfa855SEd Mastepublic key can be found at
1442ccfa855SEd Mastehttps://www.yubico.com/support/security-advisories/issue-rating-system/.
145