+libfido2 (#953)

* +libfido2

* needs zlib

* linux needs libudev
This commit is contained in:
Jacob Heider 2023-09-07 06:22:33 +02:00 committed by GitHub
parent 6b7258e008
commit 38dbc33375
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 <stddef.h>
#include <stdio.h>
#include <fido.h>
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);
}