From nobody Mon Nov 16 06:33:19 2026 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 4jSdNJ0KWPz71JFw for ; Mon, 16 Nov 2026 06:33: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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jSdNH4gnsz3NH6 for ; Mon, 16 Nov 2026 06:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794810799; 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=VTa0z7gXiaqEBf0S1W4TvrWmU9v2vv2Qt3s1FvGYZfA=; b=KWUVLqs+zWVnJe2Xc7zxf4lcuYBQw715RkNpMmgk0R+4WrbvDGH9ay2S7cLm3J0SPvC98U dyILMak1y4/axtk9rvgGel1829GeQ+iHkr4k6H2vh8tnuaCeW3ZHFdh3jqqI2sHUI+vk0H uf4hZ9bRwwsvWixvcJLAcCEw+1DEgd6nHEwJBb3yuKZJcknFKIsC+LLiguku6aCr4z4wAh QNIdWPP58zMiIeyPsoWO13iJyvDbz1Q/KdDU/SZVMDGuzkKqxx0AU9PNNbtV7NHqWMD+xo QvFT6WlqwDAV9t3I5Vtk+z4LplWGehs/2v3s0LpK5FiXiIxCZukUXPFG6pS75Q== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794810799; b=IfUKOBQ9PKbY60rNMWrK4ffz5AeeborN6QqaaYKlf6BuiSHQ4YBPdHQR9ODxbg1y4cDrD3 ASC/9a54L2RAlmZNSiMBmdsdLh2Wyp0RYsWcAM8n7P1Z/+JWXMT6AKcUFhpk74T4hKguqI 5UItB0jkrF38o4oGppZB0bd9G7iRq+REqbUR9ayLXC8TOYsR80bZ2pj5Y3dqzXa3aIF1sa LOq58vMkpOr21P2N9akC+QZM1EUt5wbtqt81qMIBj5foxN8FB2Ppo6zywdN/6+YXDfGy5p Yed6LPJrCdamupHVE/4iNpGvzHlit4oYe12lNij8mNArbd4dHlWCmIzxY5pROg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794810799; 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=VTa0z7gXiaqEBf0S1W4TvrWmU9v2vv2Qt3s1FvGYZfA=; b=g11msU4e0ab1c+pSqtDfhSHg+SLDp4Jln5HBYjJCzuaj87k6rHktvFJC9+8c7enaU3pFDO K+cK5KihuNWzqyODQ7BI07OK1zLnmLq8Md9jCva5gWJwlcw/VP5PnmezbLzRkzrCmR9lf5 BLGQSb/gxto6n2VwuhIyL3UrszYIV0oho5G5ib7+xpMvutJR5TuDfcs4BCl4ezlRJrb6g/ 7QKRXJ+dLw6NsL3Ggw1fKgm89k5Xgy2py7i/uY6j0I+rrfdk41k7d2E49D3F7BcL2IoZkg YTgwjICMwGQSCJJnaBoKl3n/K5Zb8K2RH00VOhEch2AqA5FXeyiB0ghOWCVH2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jSdNH4CtRzjwW for ; Mon, 16 Nov 2026 06:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 12e7a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 16 Nov 2026 06:33:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f0798d084392 - stable/15 - openssl: build legacy provider as upstream does List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f0798d0843924389f4da582697c31c3af6aaa802 Auto-Submitted: auto-generated Date: Mon, 16 Nov 2026 06:33:19 +0000 Message-Id: <6afaa3af.12e7a.dcee0c6@gitrepo.freebsd.org> The branch stable/15 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f0798d0843924389f4da582697c31c3af6aaa802 commit f0798d0843924389f4da582697c31c3af6aaa802 Author: Gordon Tetlow AuthorDate: 2026-11-06 18:42:45 +0000 Commit: Gordon Tetlow CommitDate: 2026-11-16 06:22:19 +0000 openssl: build legacy provider as upstream does - Build with libcrypto's compile flags: modules/Makefile.inc now includes libcrypto's Makefile.inc, which brings in Makefile.common (NDEBUG, the asm dispatch defines, OPENSSL_PIC, the directory defines). Before this change, assertions were enabled in legacy.so. - Use upstream's per-architecture source list: the provider's own CPU capability code (cpuid asm and armcap.c/ppccap.c, or mem_clr.c without asm), and the MD5, RC4 and DES asm where upstream uses it. The provider no longer uses libcrypto's exported RC4, SHA1 and CRYPTO_*128 functions. - Drop the objects that upstream's linker leaves out of legacy.so (fcrypt_b.c, md5_one.c, md5_sha1.c, provider_err.c and ciphercommon_{ccm,gcm}*.c / ciphercommon_hw.c). Without them, params_idx.c is not needed either. - Add a version script, a copy of upstream's providers/legacy.ld, so that only OSSL_provider_init is exported. Around 209 symbols were exported before. Reviewed by: ngie Event: FreeBSD Vendor Summit 2026 Differential Revision: https://reviews.freebsd.org/D60398 (cherry picked from commit 46453f0abb85c1c93dce7139950c6343a6cf04df) --- secure/lib/libcrypto/modules/Makefile.inc | 12 ++--- secure/lib/libcrypto/modules/legacy/Makefile | 67 ++++++++++++++++++------- secure/lib/libcrypto/modules/legacy/Version.map | 5 ++ 3 files changed, 57 insertions(+), 27 deletions(-) diff --git a/secure/lib/libcrypto/modules/Makefile.inc b/secure/lib/libcrypto/modules/Makefile.inc index 64fb57ee74c5..75f9218c8e29 100644 --- a/secure/lib/libcrypto/modules/Makefile.inc +++ b/secure/lib/libcrypto/modules/Makefile.inc @@ -1,13 +1,7 @@ -PACKAGE?= openssl -LIB_PACKAGE= SHLIBDIR= ${LIBDIR}/ossl-modules -LCRYPTO_SRC= ${SRCTOP}/crypto/openssl - -CFLAGS+= -I${LCRYPTO_SRC} -CFLAGS+= -I${LCRYPTO_SRC}/include -CFLAGS+= -I${LCRYPTO_SRC}/providers/common/include -CFLAGS+= -I${LCRYPTO_SRC}/providers/fips/include -CFLAGS+= -I${LCRYPTO_SRC}/providers/implementations/include +# Same compile flags as libcrypto (asm dispatch defines, NDEBUG, ...), as +# upstream builds its modules with the library flags. +.include "../Makefile.inc" WARNS?= 0 diff --git a/secure/lib/libcrypto/modules/legacy/Makefile b/secure/lib/libcrypto/modules/legacy/Makefile index 8f91d9504504..7aa9ece42d28 100644 --- a/secure/lib/libcrypto/modules/legacy/Makefile +++ b/secure/lib/libcrypto/modules/legacy/Makefile @@ -1,12 +1,14 @@ SHLIB_NAME?= legacy.so LIBADD= crypto +VERSION_MAP= ${.CURDIR}/Version.map + +# Pull in ../Makefile.inc now: the ASM_* tests below need Makefile.common. +.include SRCS+= legacyprov.c prov_running.c # ciphers -SRCS+= ciphercommon.c ciphercommon_hw.c ciphercommon_block.c \ - ciphercommon_gcm.c ciphercommon_gcm_hw.c \ - ciphercommon_ccm.c ciphercommon_ccm_hw.c +SRCS+= ciphercommon.c ciphercommon_block.c SRCS+= cipher_desx.c cipher_desx_hw.c cipher_des.c cipher_des_hw.c SRCS+= cipher_tdes_common.c SRCS+= cipher_blowfish.c cipher_blowfish_hw.c @@ -16,18 +18,47 @@ SRCS+= cipher_rc4.c cipher_rc4_hw.c SRCS+= cipher_rc4_hmac_md5.c cipher_rc4_hmac_md5_hw.c SRCS+= cipher_seed.c cipher_seed_hw.c -# crypto -SRCS+= cpuid.c -SRCS+= ctype.c +# crypto: the provider has its own copy of the CPU capability code +SRCS+= cpuid.c ctype.c +.if defined(ASM_aarch64) +SRCS+= arm64cpuid.S armcap.c +.elif defined(ASM_amd64) +SRCS+= x86_64cpuid.S +.elif defined(ASM_arm) +SRCS+= armv4cpuid.S armcap.c +.elif defined(ASM_i386) +SRCS+= x86cpuid.S +.elif defined(ASM_powerpc) || defined(ASM_powerpc64) || defined(ASM_powerpc64le) +SRCS+= ppccpuid.S ppccap.c +.else +SRCS+= mem_clr.c +.endif # crypto/des +.if defined(ASM_i386) +SRCS+= crypt586.S des-586.S +.else SRCS+= des_enc.c -SRCS+= fcrypt_b.c +.endif # crypto/md5 SRCS+= md5_dgst.c -SRCS+= md5_one.c -SRCS+= md5_sha1.c +.if defined(ASM_aarch64) +SRCS+= md5-aarch64.S +.elif defined(ASM_amd64) +SRCS+= md5-x86_64.S +.elif defined(ASM_i386) +SRCS+= md5-586.S +.endif + +# crypto/rc4 +.if defined(ASM_amd64) +SRCS+= rc4-md5-x86_64.S rc4-x86_64.S +.elif defined(ASM_i386) +SRCS+= rc4-586.S +.else +SRCS+= rc4_enc.c rc4_skey.c +.endif # providers/implementations/digests SRCS+= digestcommon.c @@ -38,26 +69,26 @@ SRCS+= pbkdf1.c SRCS+= pvkkdf.c # common -SRCS+= provider_err.c provider_ctx.c -SRCS+= provider_util.c +SRCS+= provider_ctx.c provider_util.c SRCS+= tls_pad.c -# This is needed so the provider can be loaded for us. -# -# There's a discrepancy between how this provider gets built in OpenSSL proper -# and FreeBSD. -SRCS+= params_idx.c - .include +.if defined(ASM_${MACHINE_CPUARCH}) +.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} +.elif defined(ASM_${MACHINE_ARCH}) +.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_ARCH} +.endif + .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/des \ ${LCRYPTO_SRC}/crypto/md5 \ + ${LCRYPTO_SRC}/crypto/rc4 \ ${LCRYPTO_SRC}/providers \ ${LCRYPTO_SRC}/providers/common \ ${LCRYPTO_SRC}/providers/implementations/ciphers \ ${LCRYPTO_SRC}/providers/implementations/digests \ ${LCRYPTO_SRC}/providers/implementations/kdfs \ ${LCRYPTO_SRC}/ssl \ - ${LCRYPTO_SRC}/ssl/record/methods \ + ${LCRYPTO_SRC}/ssl/record/methods diff --git a/secure/lib/libcrypto/modules/legacy/Version.map b/secure/lib/libcrypto/modules/legacy/Version.map new file mode 100644 index 000000000000..1debaaa7ff65 --- /dev/null +++ b/secure/lib/libcrypto/modules/legacy/Version.map @@ -0,0 +1,5 @@ +{ + global: + OSSL_provider_init; + local: *; +};