From nobody Wed Feb 09 23:58:17 2022 X-Original-To: dev-commits-src-all@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 7F7FE19C5ABB; 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 4JvGzb1C31z4kWB; 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=IOMYoczDdAffTliKReTTPy0bfGFeMeesxPMgP9BZgwI=; b=lgb+AHCd60wpWPtT6qRkzhem+DkTmwobtnmLoQ9BkfBiRN2m0Ht2upADkGduEVNW5AFBYx Cfdrpy8RxteMy+1gOyjDBEABNoK0l77naUO7/H/3HCVCzs+SG08zL3WthNyxjWaK+Qbrs/ UlnpMdlYiiuvkbgi4ADmJOVq0ajzbM3Pyym90B3Clxfbs7A4rekxQMZsvWi7xprF6pZ4Jm o+gp6NfTpD2jk0EkZ9GSddeS5mmLXExCvEjLTPCSsM1k1cxxY4dbzyhHTWQQ+3deK8ukTS MF3RZzGU3Qhgm0YyQlU3Dc1F0s3nyjVbJIW2ZTSRWGZoLJaaPcwbjpqBcWw5bg== 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 C219916981; Wed, 9 Feb 2022 23:58:17 +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 219NwHsJ043704; Wed, 9 Feb 2022 23:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 219NwHII043703; Wed, 9 Feb 2022 23:58:17 GMT (envelope-from git) Date: Wed, 9 Feb 2022 23:58:17 GMT Message-Id: <202202092358.219NwHII043703@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: e610bb4a8527 - stable/13 - Add libcbor to the build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: e610bb4a8527a4964bcd70b7ea2b1986d5bbc5d9 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=IOMYoczDdAffTliKReTTPy0bfGFeMeesxPMgP9BZgwI=; b=eI0QEKoXxhPxvtaO64eQ4nvuzk5dxA34BUmOkiMRYILgvBZ9ZO7FR/kyOBiYC1J4qbREJs D8WFBiKt2cdUVxReuJa6CNKIY8JCe3ZiDX2HnqRAd6Q3eIHsom7NNXgObdCE+JCMz0a3jW cTkdUlHt0CySdls6ZWq/MVHAKmtGL9aggJkiFArlfHLa6bNwHMKRF7JY2imF3a/S7IG20M Un9ZheZ1g4GmV/AM6FajjqL+ouFhHZ0zcQzR/ZcUeIDX3lgaS2ovBjBOp5sgRHs5q4yD48 nghiH+ciuCj6ARcsK0j8HhRp2zSJyMvQVMqAQNg6xMYtPK+3OsifnQ3WHwb2/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644451100; a=rsa-sha256; cv=none; b=jGY+Ncab8v9Oq08nrsgRPhfY06Ud5wpYupQot8R2arL1sVa/dGwEOC/dI1lNroEd/2lBSa MGZnMOGETC37O8xKYkUrpnh84gaRgQnIVdWVfz9G0Er+FMDALtQ0GS3c/MXbe1eQiIU/Dh y80CXmgh9Syxt9IKDlY2skPLSnfLZElJCac9049L0Dcy3fOAM0+PJ1PdIsbPYVRcJBq9Th K68CUHcL494JYR1zSAlz5A0+Ynkc8fZkKNATLDzdrd4e1JUXETHHbazFqoCqI4c9eL4Fhj 5nMvE5Du+QlZd+qp0LSzm2kX+9FPbg+H0WwYqB4et7kxfIbQ3qth8QblAkgMqg== 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=e610bb4a8527a4964bcd70b7ea2b1986d5bbc5d9 commit e610bb4a8527a4964bcd70b7ea2b1986d5bbc5d9 Author: Ed Maste AuthorDate: 2021-10-07 00:42:40 +0000 Commit: Ed Maste CommitDate: 2022-02-09 21:24:32 +0000 Add libcbor to the build From https://github.com/PJK/libcbor: libcbor is a C library for parsing and generating CBOR, the general- purpose schema-less binary data format. libcbor 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. cbor_export.h and configuration.h were generated by the upstream CMake build. We could create them with bmake rules instead (as NetBSD has done) but this is a fine start. This is currently disabled for the 32-bit library build as libfido2 is not compatible with the COMPAT_32BIT hack in usb_ioctl.h, and there is no need for libcbor without libfido2. Reviewed by: kevans MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32347 (cherry picked from commit 2e85df652caef859c532b7e1e8a178c75f1a4a92) --- lib/Makefile | 3 +++ lib/libcbor/Makefile | 35 ++++++++++++++++++++++++++ lib/libcbor/cbor/cbor_export.h | 42 ++++++++++++++++++++++++++++++++ lib/libcbor/cbor/configuration.h | 16 ++++++++++++ share/mk/src.libnames.mk | 2 ++ tools/build/mk/OptionalObsoleteFiles.inc | 3 +++ 6 files changed, 101 insertions(+) diff --git a/lib/Makefile b/lib/Makefile index dbf5182f50a5..8b1365e3e59e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -211,6 +211,9 @@ SUBDIR.${MK_BHYVE}+= libvmmapi .if ${MACHINE_ARCH} != "powerpc" SUBDIR.${MK_OPENMP}+= libomp .endif +.if !defined(COMPAT_32BIT) +SUBDIR.${MK_OPENSSH}+= libcbor +.endif SUBDIR.${MK_OPENSSL}+= libmp SUBDIR.${MK_PF}+= libpfctl SUBDIR.${MK_PMC}+= libpmc libpmcstat diff --git a/lib/libcbor/Makefile b/lib/libcbor/Makefile new file mode 100644 index 000000000000..455efdbfc8ee --- /dev/null +++ b/lib/libcbor/Makefile @@ -0,0 +1,35 @@ +# $FreeBSD$ + +PACKAGE=ssh +LIB= cbor +PRIVATELIB= + +DIST=${SRCTOP}/contrib/libcbor +.PATH: ${DIST}/src + +SRCS= cbor.c +SRCS+= cbor/arrays.c +SRCS+= cbor/bytestrings.c +SRCS+= cbor/callbacks.c +SRCS+= cbor/common.c +SRCS+= cbor/encoding.c +SRCS+= cbor/floats_ctrls.c +SRCS+= cbor/ints.c +SRCS+= cbor/maps.c +SRCS+= cbor/serialization.c +SRCS+= cbor/streaming.c +SRCS+= cbor/strings.c +SRCS+= cbor/tags.c +SRCS+= cbor/internal/builder_callbacks.c +SRCS+= cbor/internal/encoders.c +SRCS+= cbor/internal/loaders.c +SRCS+= cbor/internal/memory_utils.c +SRCS+= cbor/internal/stack.c +SRCS+= cbor/internal/unicode.c + +CFLAGS+= -I${DIST}/src -I${.CURDIR} + +WARNS?= 2 +MAN= + +.include diff --git a/lib/libcbor/cbor/cbor_export.h b/lib/libcbor/cbor/cbor_export.h new file mode 100644 index 000000000000..cce2560b8d29 --- /dev/null +++ b/lib/libcbor/cbor/cbor_export.h @@ -0,0 +1,42 @@ + +#ifndef CBOR_EXPORT_H +#define CBOR_EXPORT_H + +#ifdef CBOR_STATIC_DEFINE +# define CBOR_EXPORT +# define CBOR_NO_EXPORT +#else +# ifndef CBOR_EXPORT +# ifdef cbor_EXPORTS + /* We are building this library */ +# define CBOR_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define CBOR_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef CBOR_NO_EXPORT +# define CBOR_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef CBOR_DEPRECATED +# define CBOR_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef CBOR_DEPRECATED_EXPORT +# define CBOR_DEPRECATED_EXPORT CBOR_EXPORT CBOR_DEPRECATED +#endif + +#ifndef CBOR_DEPRECATED_NO_EXPORT +# define CBOR_DEPRECATED_NO_EXPORT CBOR_NO_EXPORT CBOR_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef CBOR_NO_DEPRECATED +# define CBOR_NO_DEPRECATED +# endif +#endif + +#endif /* CBOR_EXPORT_H */ diff --git a/lib/libcbor/cbor/configuration.h b/lib/libcbor/cbor/configuration.h new file mode 100644 index 000000000000..a1a964c81e7f --- /dev/null +++ b/lib/libcbor/cbor/configuration.h @@ -0,0 +1,16 @@ +#ifndef LIBCBOR_CONFIGURATION_H +#define LIBCBOR_CONFIGURATION_H + +#define CBOR_MAJOR_VERSION 0 +#define CBOR_MINOR_VERSION 8 +#define CBOR_PATCH_VERSION 0 + +#define CBOR_CUSTOM_ALLOC 0 +#define CBOR_BUFFER_GROWTH 2 +#define CBOR_MAX_STACK_SIZE 2048 +#define CBOR_PRETTY_PRINTER 1 + +#define CBOR_RESTRICT_SPECIFIER restrict +#define CBOR_INLINE_SPECIFIER + +#endif //LIBCBOR_CONFIGURATION_H diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index ee3404b676c3..ef21399af7b6 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -17,6 +17,7 @@ _PRIVATELIBS= \ atf_cxx \ auditd \ bsdstat \ + cbor \ devdctl \ event1 \ gmock \ @@ -704,6 +705,7 @@ LIBCAP_NETDIR= ${OBJTOP}/lib/libcasper/services/cap_net LIBCAP_PWDDIR= ${OBJTOP}/lib/libcasper/services/cap_pwd LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl LIBCAP_SYSLOGDIR= ${OBJTOP}/lib/libcasper/services/cap_syslog +LIBCBORDIR= ${OBJTOP}/lib/libcbor LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat LIBKVMDIR= ${OBJTOP}/lib/libkvm LIBPTHREADDIR= ${OBJTOP}/lib/libthr diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index bda8a435c5e1..02b239f33a8e 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -7197,6 +7197,9 @@ OLD_FILES+=usr/bin/ssh-agent OLD_FILES+=usr/bin/ssh-copy-id OLD_FILES+=usr/bin/ssh-keygen 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/pam_ssh.so OLD_LIBS+=usr/lib/pam_ssh.so.6 OLD_FILES+=usr/lib/libprivatessh.a