Module Name: src Committed By: christos Date: Thu Jun 17 01:15:46 UTC 2021
Modified Files: src/external/bsd/libfido2: Makefile.inc src/external/bsd/libfido2/bin/fido2-assert: Makefile src/external/bsd/libfido2/bin/fido2-cred: Makefile src/external/bsd/libfido2/bin/fido2-token: Makefile src/external/bsd/libfido2/dist/src: hid_netbsd.c src/external/bsd/libfido2/dist/tools: util.c src/external/bsd/libfido2/lib: Makefile fido2.map Removed Files: src/external/bsd/libfido2/dist: .travis.yml x xx src/external/bsd/libfido2/dist/.github/workflows: scan.yml windows.yml src/external/bsd/libfido2/dist/.travis: build-linux-clang build-linux-gcc build-linux-mingw build-osx-clang fuzz-linux-asan fuzz-linux-msan src/external/bsd/libfido2/dist/debian: changelog compat control copyright fido2-tools.install fido2-tools.manpages libfido2-1.install libfido2-1.symbols libfido2-dev.install libfido2-dev.links libfido2-dev.manpages libfido2-udev.install rules src/external/bsd/libfido2/dist/debian/source: format src/external/bsd/libfido2/dist/docker/bionic: Dockerfile src/external/bsd/libfido2/dist/fuzz: corpus.tgz src/external/bsd/libfido2/dist/openbsd-compat: diff.sh src/external/bsd/libfido2/dist/tools: macos_pkg.sh Log Message: merge conflicts and update between libfido 1.5.0 and 1.7.0 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/Makefile.inc cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/bin/fido2-assert/Makefile cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/bin/fido2-cred/Makefile cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/bin/fido2-token/Makefile cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/.travis.yml \ src/external/bsd/libfido2/dist/x src/external/bsd/libfido2/dist/xx cvs rdiff -u -r1.1.1.1 -r0 \ src/external/bsd/libfido2/dist/.github/workflows/scan.yml \ src/external/bsd/libfido2/dist/.github/workflows/windows.yml cvs rdiff -u -r1.1.1.1 -r0 \ src/external/bsd/libfido2/dist/.travis/build-linux-clang \ src/external/bsd/libfido2/dist/.travis/build-linux-gcc \ src/external/bsd/libfido2/dist/.travis/build-linux-mingw \ src/external/bsd/libfido2/dist/.travis/build-osx-clang \ src/external/bsd/libfido2/dist/.travis/fuzz-linux-asan \ src/external/bsd/libfido2/dist/.travis/fuzz-linux-msan cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/debian/changelog \ src/external/bsd/libfido2/dist/debian/compat \ src/external/bsd/libfido2/dist/debian/control \ src/external/bsd/libfido2/dist/debian/copyright \ src/external/bsd/libfido2/dist/debian/fido2-tools.install \ src/external/bsd/libfido2/dist/debian/fido2-tools.manpages \ src/external/bsd/libfido2/dist/debian/libfido2-1.install \ src/external/bsd/libfido2/dist/debian/libfido2-1.symbols \ src/external/bsd/libfido2/dist/debian/libfido2-dev.install \ src/external/bsd/libfido2/dist/debian/libfido2-dev.links \ src/external/bsd/libfido2/dist/debian/libfido2-dev.manpages \ src/external/bsd/libfido2/dist/debian/libfido2-udev.install \ src/external/bsd/libfido2/dist/debian/rules cvs rdiff -u -r1.1.1.1 -r0 \ src/external/bsd/libfido2/dist/debian/source/format cvs rdiff -u -r1.1.1.1 -r0 \ src/external/bsd/libfido2/dist/docker/bionic/Dockerfile cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/fuzz/corpus.tgz cvs rdiff -u -r1.1.1.1 -r0 \ src/external/bsd/libfido2/dist/openbsd-compat/diff.sh cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libfido2/dist/src/hid_netbsd.c cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/libfido2/dist/tools/macos_pkg.sh cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/libfido2/dist/tools/util.c cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/lib/Makefile cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/lib/fido2.map Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/libfido2/Makefile.inc diff -u src/external/bsd/libfido2/Makefile.inc:1.2 src/external/bsd/libfido2/Makefile.inc:1.3 --- src/external/bsd/libfido2/Makefile.inc:1.2 Fri Dec 4 13:27:44 2020 +++ src/external/bsd/libfido2/Makefile.inc Wed Jun 16 21:15:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.2 2020/12/04 18:27:44 christos Exp $ +# $NetBSD: Makefile.inc,v 1.3 2021/06/17 01:15:44 christos Exp $ DIST:=${.PARSEDIR}/dist @@ -13,3 +13,6 @@ FIDO_VERSION=${FIDO_MAJOR}.${FIDO_MINOR} CPPFLAGS+=-D_FIDO_MAJOR=${FIDO_MAJOR} -D_FIDO_MINOR=${FIDO_MINOR} CPPFLAGS+=-D_FIDO_PATCH=${FIDO_PATCH} CPPFLAGS+=-DHAVE_UNISTD_H -DHAVE_ARC4RANDOM_BUF -DHAVE_TIMESPECSUB + +LDFLAGS+=-lz +DPFLAGS+=${LIBZ} Index: src/external/bsd/libfido2/bin/fido2-assert/Makefile diff -u src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.1 src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.2 --- src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.1 Mon Mar 2 19:14:17 2020 +++ src/external/bsd/libfido2/bin/fido2-assert/Makefile Wed Jun 16 21:15:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2020/03/03 00:14:17 christos Exp $ +# $NetBSD: Makefile,v 1.2 2021/06/17 01:15:44 christos Exp $ .include <bsd.own.mk> @@ -6,9 +6,11 @@ BINDIR=/usr/bin PROG= fido2-assert SRCS+=\ +config.c \ assert_get.c \ assert_verify.c \ fido2-assert.c \ +largeblob.c \ base64.c \ bio.c \ credman.c \ @@ -18,6 +20,7 @@ util.c SRCS+=\ explicit_bzero.c \ +freezero.c \ readpassphrase.c \ recallocarray.c Index: src/external/bsd/libfido2/bin/fido2-cred/Makefile diff -u src/external/bsd/libfido2/bin/fido2-cred/Makefile:1.1 src/external/bsd/libfido2/bin/fido2-cred/Makefile:1.2 --- src/external/bsd/libfido2/bin/fido2-cred/Makefile:1.1 Mon Mar 2 19:14:17 2020 +++ src/external/bsd/libfido2/bin/fido2-cred/Makefile Wed Jun 16 21:15:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2020/03/03 00:14:17 christos Exp $ +# $NetBSD: Makefile,v 1.2 2021/06/17 01:15:44 christos Exp $ .include <bsd.own.mk> @@ -6,18 +6,21 @@ BINDIR=/usr/bin PROG= fido2-cred SRCS+=\ +config.c \ cred_make.c \ cred_verify.c \ base64.c \ bio.c \ credman.c \ fido2-cred.c \ +largeblob.c \ pin.c \ token.c \ util.c SRCS+=\ explicit_bzero.c \ +freezero.c \ readpassphrase.c \ recallocarray.c Index: src/external/bsd/libfido2/bin/fido2-token/Makefile diff -u src/external/bsd/libfido2/bin/fido2-token/Makefile:1.1 src/external/bsd/libfido2/bin/fido2-token/Makefile:1.2 --- src/external/bsd/libfido2/bin/fido2-token/Makefile:1.1 Mon Mar 2 19:14:17 2020 +++ src/external/bsd/libfido2/bin/fido2-token/Makefile Wed Jun 16 21:15:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2020/03/03 00:14:17 christos Exp $ +# $NetBSD: Makefile,v 1.2 2021/06/17 01:15:44 christos Exp $ .include <bsd.own.mk> @@ -8,14 +8,17 @@ PROG= fido2-token SRCS+=\ base64.c \ bio.c \ +config.c \ credman.c \ fido2-token.c \ +largeblob.c \ pin.c \ token.c \ util.c SRCS+=\ explicit_bzero.c \ +freezero.c \ readpassphrase.c \ recallocarray.c Index: src/external/bsd/libfido2/dist/src/hid_netbsd.c diff -u src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.1 src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.2 --- src/external/bsd/libfido2/dist/src/hid_netbsd.c:1.1 Sat Dec 12 13:44:38 2020 +++ src/external/bsd/libfido2/dist/src/hid_netbsd.c Wed Jun 16 21:15:46 2021 @@ -28,6 +28,8 @@ struct hid_netbsd { int fd; size_t report_in_len; size_t report_out_len; + sigset_t sigmask; + const sigset_t *sigmaskp; }; /* Hack to make this work with newer kernels even if /usr/include is old. */ @@ -209,8 +211,8 @@ terrible_ping_kludge(struct hid_netbsd * * so we might get an error, but we don't care - we're * synched now. */ - fido_log_debug("%s: got reply", __func__); - fido_log_xxd(data, ctx->report_out_len); + fido_log_xxd(data, ctx->report_out_len, "%s: got reply", + __func__); return 0; } fido_log_debug("%s: no response", __func__); @@ -315,51 +317,15 @@ timespec_to_ms(const struct timespec *ts return (int)(x + y); } -static int -fido_hid_unix_wait(int fd, int ms) +int +fido_hid_set_sigmask(void *handle, const fido_sigset_t *sigmask) { - char ebuf[128]; - struct timespec ts_start; - struct timespec ts_now; - struct timespec ts_delta; - struct pollfd pfd; - int ms_remain; - int r; - - if (ms < 0) - return (0); - - memset(&pfd, 0, sizeof(pfd)); - pfd.events = POLLIN; - pfd.fd = fd; - - if (clock_gettime(CLOCK_MONOTONIC, &ts_start) != 0) { - xstrerror(errno, ebuf, sizeof(ebuf)); - fido_log_debug("%s: clock_gettime: %s", __func__, ebuf); - return (-1); - } + struct hid_netbsd *ctx = handle; - for (ms_remain = ms; ms_remain > 0;) { - if ((r = poll(&pfd, 1, ms_remain)) > 0) - return (0); - else if (r == 0) - break; - else if (errno != EINTR) { - xstrerror(errno, ebuf, sizeof(ebuf)); - fido_log_debug("%s: poll: %s", __func__, ebuf); - return (-1); - } - /* poll interrupted - subtract time already waited */ - if (clock_gettime(CLOCK_MONOTONIC, &ts_now) != 0) { - xstrerror(errno, ebuf, sizeof(ebuf)); - fido_log_debug("%s: clock_gettime: %s", __func__, ebuf); - return (-1); - } - timespecsub(&ts_now, &ts_start, &ts_delta); - ms_remain = ms - timespec_to_ms(&ts_delta, ms); - } + ctx->sigmask = *sigmask; + ctx->sigmaskp = &ctx->sigmask; - return (-1); + return (FIDO_OK); } int @@ -373,7 +339,7 @@ fido_hid_read(void *handle, unsigned cha return (-1); } - if (fido_hid_unix_wait(ctx->fd, ms) < 0) { + if (fido_hid_unix_wait(ctx->fd, ms, ctx->sigmaskp) < 0) { fido_log_debug("%s: fd not ready", __func__); return (-1); } Index: src/external/bsd/libfido2/dist/tools/util.c diff -u src/external/bsd/libfido2/dist/tools/util.c:1.1.1.3 src/external/bsd/libfido2/dist/tools/util.c:1.2 --- src/external/bsd/libfido2/dist/tools/util.c:1.1.1.3 Wed Jun 16 20:38:08 2021 +++ src/external/bsd/libfido2/dist/tools/util.c Wed Jun 16 21:15:46 2021 @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "../openbsd-compat/openbsd-compat.h" #ifdef _MSC_VER Index: src/external/bsd/libfido2/lib/Makefile diff -u src/external/bsd/libfido2/lib/Makefile:1.3 src/external/bsd/libfido2/lib/Makefile:1.4 --- src/external/bsd/libfido2/lib/Makefile:1.3 Sat Dec 12 13:45:11 2020 +++ src/external/bsd/libfido2/lib/Makefile Wed Jun 16 21:15:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2020/12/12 18:45:11 christos Exp $ +# $NetBSD: Makefile,v 1.4 2021/06/17 01:15:46 christos Exp $ NOLINT= .include <bsd.own.mk> @@ -23,6 +23,8 @@ bio.c \ blob.c \ buf.c \ cbor.c \ +compress.c \ +config.c \ cred.c \ credman.c \ dev.c \ @@ -32,11 +34,14 @@ err.c \ es256.c \ hid.c \ hid_netbsd.c \ +hid_unix.c \ info.c \ io.c \ iso7816.c \ +largeblob.c \ log.c \ pin.c \ +random.c \ reset.c \ rs256.c \ u2f.c @@ -49,6 +54,7 @@ timingsafe_bcmp.c INCS+= \ fido.h \ fido/bio.h \ +fido/config.h \ fido/credman.h \ fido/eddsa.h \ fido/err.h \ @@ -76,9 +82,11 @@ fido_cred_new.3 \ fido_cred_set_authdata.3 \ fido_cred_verify.3 \ fido_credman_metadata_new.3 \ +fido_dev_enable_entattest.3 \ fido_dev_get_assert.3 \ fido_dev_get_touch_begin.3 \ fido_dev_info_manifest.3 \ +fido_dev_largeblob_get.3 \ fido_dev_make_cred.3 \ fido_dev_open.3 \ fido_dev_set_io_functions.3 \ @@ -87,8 +95,8 @@ fido_init.3 \ fido_strerr.3 \ rs256_pk_new.3 -SHLIB_MAJOR=2 -SHLIB_MINOR=1 +SHLIB_MAJOR=3 +SHLIB_MINOR=0 .SUFFIXES: .in .in: Index: src/external/bsd/libfido2/lib/fido2.map diff -u src/external/bsd/libfido2/lib/fido2.map:1.2 src/external/bsd/libfido2/lib/fido2.map:1.3 --- src/external/bsd/libfido2/lib/fido2.map:1.2 Fri Dec 4 13:27:44 2020 +++ src/external/bsd/libfido2/lib/fido2.map Wed Jun 16 21:15:46 2021 @@ -13,6 +13,8 @@ FIDO_2_0 { fido_assert_allow_cred; fido_assert_authdata_len; fido_assert_authdata_ptr; + fido_assert_blob_len; + fido_assert_blob_ptr; fido_assert_clientdata_hash_len; fido_assert_clientdata_hash_ptr; fido_assert_count; @@ -22,6 +24,8 @@ FIDO_2_0 { fido_assert_hmac_secret_ptr; fido_assert_id_len; fido_assert_id_ptr; + fido_assert_largeblob_key_len; + fido_assert_largeblob_key_ptr; fido_assert_new; fido_assert_rp_id; fido_assert_set_authdata; @@ -30,6 +34,7 @@ FIDO_2_0 { fido_assert_set_count; fido_assert_set_extensions; fido_assert_set_hmac_salt; + fido_assert_set_hmac_secret; fido_assert_set_options; fido_assert_set_rp; fido_assert_set_sig; @@ -76,6 +81,7 @@ FIDO_2_0 { fido_cbor_info_extensions_ptr; fido_cbor_info_free; fido_cbor_info_fwversion; + fido_cbor_info_maxcredbloblen; fido_cbor_info_maxcredcntlst; fido_cbor_info_maxcredidlen; fido_cbor_info_maxmsgsiz; @@ -91,6 +97,8 @@ FIDO_2_0 { fido_cred_aaguid_ptr; fido_cred_authdata_len; fido_cred_authdata_ptr; + fido_cred_authdata_raw_len; + fido_cred_authdata_raw_ptr; fido_cred_clientdata_hash_len; fido_cred_clientdata_hash_ptr; fido_cred_display_name; @@ -100,6 +108,8 @@ FIDO_2_0 { fido_cred_free; fido_cred_id_len; fido_cred_id_ptr; + fido_cred_largeblob_key_len; + fido_cred_largeblob_key_ptr; fido_cred_new; fido_cred_prot; fido_cred_pubkey_len; @@ -108,6 +118,7 @@ FIDO_2_0 { fido_cred_rp_name; fido_cred_set_authdata; fido_cred_set_authdata_raw; + fido_cred_set_blob; fido_cred_set_clientdata_hash; fido_cred_set_extensions; fido_cred_set_fmt; @@ -122,6 +133,7 @@ FIDO_2_0 { fido_cred_set_x509; fido_cred_sig_len; fido_cred_sig_ptr; + fido_cred_sigcount; fido_cred_type; fido_cred_user_id_len; fido_cred_user_id_ptr; @@ -152,8 +164,10 @@ FIDO_2_0 { fido_dev_build; fido_dev_cancel; fido_dev_close; + fido_dev_enable_entattest; fido_dev_flags; fido_dev_force_fido2; + fido_dev_force_pin_change; fido_dev_force_u2f; fido_dev_free; fido_dev_get_assert; @@ -161,6 +175,9 @@ FIDO_2_0 { fido_dev_get_retry_count; fido_dev_get_touch_begin; fido_dev_get_touch_status; + fido_dev_get_uv_retry_count; + fido_dev_has_pin; + fido_dev_has_uv; fido_dev_info_free; fido_dev_info_manifest; fido_dev_info_manufacturer_string; @@ -171,6 +188,11 @@ FIDO_2_0 { fido_dev_info_ptr; fido_dev_info_vendor; fido_dev_is_fido2; + fido_dev_largeblob_get; + fido_dev_largeblob_get_array; + fido_dev_largeblob_remove; + fido_dev_largeblob_set; + fido_dev_largeblob_set_array; fido_dev_major; fido_dev_make_cred; fido_dev_minor; @@ -180,8 +202,14 @@ FIDO_2_0 { fido_dev_reset; fido_dev_set_io_functions; fido_dev_set_pin; + fido_dev_set_pin_minlen; + fido_dev_set_sigmask; fido_dev_set_transport_functions; fido_dev_supports_cred_prot; + fido_dev_supports_credman; + fido_dev_supports_permissions; + fido_dev_supports_uv; + fido_dev_toggle_always_uv; fido_init; fido_set_log_handler; fido_strerr;