From nobody Wed Feb 09 23:58:18 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7400D19C59E7; Wed, 9 Feb 2022 23:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JvGzb38K0z4kTS; Wed, 9 Feb 2022 23:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644451100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FeGIbAKy1bHb+eVnoyJKdJ4f9qa7A72O1tudbu2DNZo=; b=kn6/EWkQzysEWQ53lrS65lo5N+0OI9VTR7SMvGW6EvMqPQgSB8bvf6KuR4xKGprxV4BhoF uuyHHjPD7z4EpX+oI/6qY/y+NOnCfzCR6LtP3KKus95bK3MpiJb/+x4prrD9UvYdLrbd3S OIsqbCCDBKbnToHTt56YSrtHpxZNraQ8xqotwQ8SpuHqrwZZinZ3L0hGhDoKIqnR/4jh8D 0qHMsVxaM280AOvkAnltmHoJSxtsPCm5awbDXN/q+DOyWEdNKulvs8+lBbOpV79KlrBGeN fak1rjOPljnSosR72h69dQpRVgEd8tzbd6nYOs6TT3JktrEul4Ztz1FCVHilyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E162816748; Wed, 9 Feb 2022 23:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 219NwIWb043728; Wed, 9 Feb 2022 23:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 219NwIYw043727; Wed, 9 Feb 2022 23:58:18 GMT (envelope-from git) Date: Wed, 9 Feb 2022 23:58:18 GMT Message-Id: <202202092358.219NwIYw043727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c437ff145cbe - stable/13 - Add libfido2 to the build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c437ff145cbe5a6173f49472fe5f1ae4c686f121 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644451100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FeGIbAKy1bHb+eVnoyJKdJ4f9qa7A72O1tudbu2DNZo=; b=KZq5AWNQJU5wlOh2zTacyH9U5PMmjjV7Il/HryH/HQC445fzJ4dW24WAEhdU462+32uJre Ri3hjCCvQmqBXJvTTRsqmv1FwWQqIxnzgGYToliqL89sragUJoMOrcs0SPCXhLtTQzldsW 6NqAFHc6o9Zz7ekr5DI0ZyHVK9B9YosxNCuN+sMGHK+ByUupNYtw2P6zT/6FuFhDDiXD0H Ns2M4F9vQqjPLIhTEWRpRoz5fAG6wjAL/7zL1dDmU44xxInRZHIqQBl+aQI3twSbOEd2a8 0Sazy247oWWNkTrto2ZmA6kG7F4oebRZJyGwQNzHMIKUT/4gxBt9mJBT6k/Ptg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644451100; a=rsa-sha256; cv=none; b=qV8Yzec4dHSoQ52IT7GWb69ZfiOnE/ibVTUmGh2Ob+NUFdaaG/qatq9qxC0qZMVcq3i+6Y Xd2i0GPQXUm9+IWHYcwjoNky9U4Vdi+3xro1chkkGzEplQgXPC/sqswzUJlP/zcFH56vhA USneDAIwPTecnFJEE8+ILiVW+aj1qXLVspEv6mGhJgK+4tW2uGQbG5wjKkc5gHRgYx87w/ RFl+F3vYRjR87+fch8hgj+jpHWPEyvEBQG36TrEUzU0bMj5cJAfGWK3vQq+jmSzBMvFQCW btgLSVBsZxZ9Y2x1wPLwIVOIYtgouYvhyMMIHqP2NbnFzXzYJEmj8AQCwWRifQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c437ff145cbe5a6173f49472fe5f1ae4c686f121 commit c437ff145cbe5a6173f49472fe5f1ae4c686f121 Author: Ed Maste AuthorDate: 2021-10-07 01:52:05 +0000 Commit: Ed Maste CommitDate: 2022-02-09 21:24:54 +0000 Add libfido2 to the build From https://github.com/Yubico/libfido2: libfido2 provides library functionality and command-line tools to communicate with a FIDO device over USB, and to verify attestation and assertion signatures. libfido2 supports the FIDO U2F (CTAP 1) and FIDO 2.0 (CTAP 2) protocols. libfido2 will be used by ssh to support FIDO/U2F keys. It is currently intended only for use by ssh, and so is installed as a PRIVATELIB and is placed in the ssh pkgbase package. This is currently disabled for the 32-bit library build as libfido2 is not compatible with the COMPAT_32BIT hack in usb_ioctl.h. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32448 (cherry picked from commit 7b1e19ad78c6a3f84f81cb1a16a39500f0337062) (cherry picked from commit 93942379cced89ad4ac653f262ac8277a8550853) --- lib/Makefile | 4 +- lib/libfido2/Makefile | 73 ++++++++++++++++++++++++++++++++ share/mk/src.libnames.mk | 3 ++ tools/build/mk/OptionalObsoleteFiles.inc | 3 ++ 4 files changed, 81 insertions(+), 2 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 8b1365e3e59e..5e740edc78a5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -211,8 +211,8 @@ SUBDIR.${MK_BHYVE}+= libvmmapi .if ${MACHINE_ARCH} != "powerpc" SUBDIR.${MK_OPENMP}+= libomp .endif -.if !defined(COMPAT_32BIT) -SUBDIR.${MK_OPENSSH}+= libcbor +.if !defined(COMPAT_32BIT) && ${MK_USB} != "no" +SUBDIR.${MK_OPENSSH}+= libcbor libfido2 .endif SUBDIR.${MK_OPENSSL}+= libmp SUBDIR.${MK_PF}+= libpfctl diff --git a/lib/libfido2/Makefile b/lib/libfido2/Makefile new file mode 100644 index 000000000000..edf737b9dafc --- /dev/null +++ b/lib/libfido2/Makefile @@ -0,0 +1,73 @@ +PACKAGE=ssh +LIB= fido2 +PRIVATELIB= +DIST= ${SRCTOP}/contrib/libfido2 + +.PATH: ${DIST}/src ${DIST} + +SRCS+= aes256.c +SRCS+= assert.c +SRCS+= authkey.c +SRCS+= bio.c +SRCS+= blob.c +SRCS+= buf.c +SRCS+= cbor.c +SRCS+= compress.c +SRCS+= config.c +SRCS+= cred.c +SRCS+= credman.c +SRCS+= dev.c +SRCS+= ecdh.c +SRCS+= eddsa.c +SRCS+= err.c +SRCS+= es256.c +SRCS+= hid_freebsd.c +SRCS+= hid_unix.c +SRCS+= hid.c +SRCS+= info.c +SRCS+= io.c +SRCS+= iso7816.c +SRCS+= largeblob.c +SRCS+= log.c +SRCS+= pin.c +SRCS+= random.c +SRCS+= reset.c +SRCS+= rs256.c +SRCS+= u2f.c + +SRCS+= openbsd-compat/freezero.c +SRCS+= openbsd-compat/recallocarray.c + +CFLAGS+= -I ${DIST}/src -I${SRCTOP}/contrib/libcbor/src -I${.CURDIR}/../libcbor +CFLAGS+= -D_FIDO_INTERNAL +CFLAGS+= -DHAVE_ARC4RANDOM_BUF +CFLAGS+= -DHAVE_CLOCK_GETTIME +CFLAGS+= -DHAVE_DEV_URANDOM +CFLAGS+= -DHAVE_ERR_H +CFLAGS+= -DHAVE_EXPLICIT_BZERO +CFLAGS+= -DHAVE_GETLINE +CFLAGS+= -DHAVE_GETOPT +CFLAGS+= -DHAVE_GETPAGESIZE +CFLAGS+= -DHAVE_GETRANDOM +CFLAGS+= -DHAVE_OPENSSLV_H +CFLAGS+= -DHAVE_READPASSPHRASE +CFLAGS+= -DHAVE_SIGNAL_H +CFLAGS+= -DHAVE_STRLCAT +CFLAGS+= -DHAVE_STRLCPY +CFLAGS+= -DHAVE_STRSEP +CFLAGS+= -DHAVE_SYSCONF +CFLAGS+= -DHAVE_SYS_RANDOM_H +CFLAGS+= -DHAVE_TIMESPECSUB +CFLAGS+= -DHAVE_TIMINGSAFE_BCMP +CFLAGS+= -DHAVE_UNISTD_H +CFLAGS+= -DTLS=__thread +CFLAGS+= -D_FIDO_MAJOR=1 +CFLAGS+= -D_FIDO_MINOR=9 +CFLAGS+= -D_FIDO_PATCH=0 + +LIBADD= crypto z + +WARNS=2 +MAN= + +.include diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index ef21399af7b6..99d416556b54 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -20,6 +20,7 @@ _PRIVATELIBS= \ cbor \ devdctl \ event1 \ + fido2 \ gmock \ gtest \ gmock_main \ @@ -349,6 +350,7 @@ _DP_pam= radius tacplus opie md util _DP_pam+= krb5 .endif .if ${MK_OPENSSH} != "no" +_DP_fido2+= crypto z _DP_pam+= ssh .endif .if ${MK_NIS} != "no" @@ -707,6 +709,7 @@ LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl LIBCAP_SYSLOGDIR= ${OBJTOP}/lib/libcasper/services/cap_syslog LIBCBORDIR= ${OBJTOP}/lib/libcbor LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat +LIBFIDO2DIR= ${OBJTOP}/lib/libfido2 LIBKVMDIR= ${OBJTOP}/lib/libkvm LIBPTHREADDIR= ${OBJTOP}/lib/libthr LIBMDIR= ${OBJTOP}/lib/msun diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 02b239f33a8e..972a58a330dc 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -7200,6 +7200,9 @@ OLD_FILES+=usr/bin/ssh-keyscan OLD_FILES+=usr/lib/libprivatecbor.a OLD_FILES+=usr/lib/libprivatecbor.so OLD_LIBS+=usr/lib/libprivatecbor.so.5 +OLD_FILES+=/usr/lib/libprivatefido2.a +OLD_FILES+=/usr/lib/libprivatefido2.so +OLD_LIBS+=/usr/lib/libprivatefido2.so.5 OLD_FILES+=usr/lib/pam_ssh.so OLD_LIBS+=usr/lib/pam_ssh.so.6 OLD_FILES+=usr/lib/libprivatessh.a