From 38dbc33375e02ac8adbe6e178538efa1f1465b46 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Thu, 7 Sep 2023 06:22:33 +0200 Subject: [PATCH] +libfido2 (#953) * +libfido2 * needs zlib * linux needs libudev --- .../libfido2/package.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 projects/developers.yubico.com/libfido2/package.yml diff --git a/projects/developers.yubico.com/libfido2/package.yml b/projects/developers.yubico.com/libfido2/package.yml new file mode 100644 index 00000000..2a068ea0 --- /dev/null +++ b/projects/developers.yubico.com/libfido2/package.yml @@ -0,0 +1,59 @@ +distributable: + url: https://developers.yubico.com/libfido2/Releases/libfido2-{{ version }}.tar.gz + strip-components: 1 + +versions: + github: Yubico/libfido2/tags + +dependencies: + github.com/PJK/libcbor: 0 + openssl.org: 1 + zlib.net: 1 + linux: + systemd.io: '*' # libudev + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + cmake.org: 3 + freedesktop.org/pkg-config: ^0.29 + working-directory: build + script: + - cmake .. $ARGS + - make --jobs {{ hw.concurrency }} + - make install + env: + ARGS: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX="{{prefix}}" + +provides: + - bin/fido2-assert + - bin/fido2-cred + - bin/fido2-token + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: + - mv $FIXTURE test.c + - cc test.c -o test -lfido2 + - ./test + fixture: | + #include + #include + #include + int main(void) { + fido_init(FIDO_DEBUG); + // Attempt to enumerate up to five FIDO/U2F devices. Five is an arbitrary number. + size_t max_devices = 5; + fido_dev_info_t *devlist; + if ((devlist = fido_dev_info_new(max_devices)) == NULL) + return 1; + size_t found_devices = 0; + int error; + if ((error = fido_dev_info_manifest(devlist, max_devices, &found_devices)) == FIDO_OK) + printf("FIDO/U2F devices found: %s\\n", found_devices ? "Some" : "None"); + fido_dev_info_free(&devlist, max_devices); + }