From nobody Thu Aug 14 09:59:52 2025 X-Original-To: dev-commits-src-main@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 4c2ghX38rmz64BW9; Thu, 14 Aug 2025 09:59:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c2ghX23Fhz3rCl; Thu, 14 Aug 2025 09:59:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755165596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q0eS2NMyeVXIlWeAaMSv6kcJjEZeDKldpJGzxm9JlZ4=; b=HRWO7Lq1i4ZlaYlFH52FVjL2F3hoIRyGXVvwy+T/CTI/1ThATnbPH5ftBzQYL6NY3ghINX /qFaIPdolzpsHXz5AQUOhOpWQ0NLmNE7MYiqvvJ/EjOPKweZrYK8MxnTJ7dUfXw79VNfyU fpPS8vjwlddzBh+5zz1lxvjfsKjp34RkctCziISu8Om5loznfyfYlMWlfpoCNQOP6ZIOSx JSqRGZcXzdxT3LGOWkcpgpwBaN5fiLHw6by/iE4P8CZbQVMwV7hOHN6trYfxfci4yXiWSv k+Wjp3T82I4/TB3KClcNZQPrUVpseT87m1UkPhMmP8xAOD3q+GV8v7ZL3T1Ebg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755165596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q0eS2NMyeVXIlWeAaMSv6kcJjEZeDKldpJGzxm9JlZ4=; b=g90eIt6KJMbIWKvFGF35621hffrrfzowqKCXOctivrJt1lt4aH4kkigdNm+9RKxI7Qq+pl 5UKPgYyp0GhPNsUA2XFHzOwboVpq4W7rn1dwgDcloeXL4I9CK72mBC1zMNh8TYOTioKSV9 3jD926sDhjcKY/5YBF6nHHUqvdyJ6AXhSU/U6ibInZasoW6V3T2nyGOx4EcbpqE4BdBBqH VlSHyDihafeKI70KPrqVHU5fJACU3HNzCr5Ww3K1hjrdq47o2aLySekuBCuoBAZdjV7R6a vx/sLsml6H1F8Mctcy07vzSjoqi2Rzo+DZJHHIcvvKpT+sdQZZ405Oz9/Ot9QQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755165596; a=rsa-sha256; cv=none; b=T6UE38w7hR4jURapqYp44BMuNhg0wcCXZ7/jCspJzH9h+Y6rkvZpoxL541LxdCN55PVpUj Aa1H9r7W+PrsuqXEtZ1eI9UGlFl9tL4UlwP3V6tH8fUa+zhStWAtLrny1aoHO2cbzpzjj6 N2wAaCnIt9g28yGvWi6BK/hNn89p7a+lr1IMxWjnBve6pAZlv04J61Vr6GTRwx89JmT1+S hBN+CN0b0v8GqPbJrczdJDU5SGLZ3AIZMJIE9mbimt5vIoExuyJ9e1twMBiz7MbqI58hiq ql1AXH3QEnNxtWVECSZldPaV77Yb5q+EHhMcna6U1shvR7f82P97BXSGHo65/w== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R11" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4c2ghW6vxSzBNK; Thu, 14 Aug 2025 09:59:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 31DE6467D7; Thu, 14 Aug 2025 11:59:53 +0200 (CEST) From: Kristof Provost To: =?utf-8?q?Dag-Erling_Sm=C3=B8rgrav?= Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 81d8827ad875 - main - certctl: Reimplement in C Date: Thu, 14 Aug 2025 11:59:52 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: <5331736E-B67F-4B3C-A04A-54E7A5F88B07@FreeBSD.org> In-Reply-To: <202508132225.57DMPlLZ083341@gitrepo.freebsd.org> References: <202508132225.57DMPlLZ083341@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_E13A9DC5-543A-4DAC-AEC3-456857F598E0_=" --=_MailMate_E13A9DC5-543A-4DAC-AEC3-456857F598E0_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 14 Aug 2025, at 0:25, Dag-Erling Sm=C3=B8rgrav wrote: > The branch main has been updated by des: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D81d8827ad8752e35411204541f1f0= 9df1481e417 > > commit 81d8827ad8752e35411204541f1f09df1481e417 > Author: Dag-Erling Sm=C3=B8rgrav > AuthorDate: 2025-08-13 22:25:27 +0000 > Commit: Dag-Erling Sm=C3=B8rgrav > CommitDate: 2025-08-13 22:25:27 +0000 > > certctl: Reimplement in C > > Notable changes include: > > * We no longer forget manually untrusted certificates when = > rehashing. > > * Rehash will now scan the existing directory and progressively = > replace > its contents with those of the new trust store. The trust store = > as a > whole is not replaced atomically, but each file within it is. > > * We no longer attempt to link to the original files, but we don't = > copy > them either. Instead, we write each certificate out in its = > minimal > form. > > * We now generate a trust bundle in addition to the hashed = > diretory. > This also contains only the minimal DER form of each = > certificate. > > * The C version is approximately two orders of magnitude faster = > than the > sh version, with rehash taking ~100 ms vs ~5-25 s depending on = > whether > ca_root_nss is installed. > > * The DISTBASE concept has been dropped; the same effect can be = > achieved > by adjusting DESTDIR. > > * We now also have rudimentary tests. > > Reviewed by: kevans > Differential Revision: https://reviews.freebsd.org/D42320 I=E2=80=99m seeing errors like this during bricoler test runs now: > /usr/home/kp/bricoler/freebsd-src-regression-suite-vm-image/image.amd64= =2Eamd64-METALOG.mtree:38358: = > error: word too long to fit buffer (max 10 characters) Those are all lines with absolute paths (e.g. /etc/ssl/cert.pem rather = than ./etc/ssl/cert.pem). This hack seems to fix things for me, but I=E2=80=99m nowhere near famili= ar = enough with the relevant build bits to say for sure if that=E2=80=99s rig= ht or = not: diff --git a/usr.sbin/certctl/certctl.c b/usr.sbin/certctl/certctl.c index 365870167aeb..336a49830a3d 100644 --- a/usr.sbin/certctl/certctl.c +++ b/usr.sbin/certctl/certctl.c @@ -490,7 +490,7 @@ write_certs(const char *dir, struct cert_tree = *tree) } /* emit metalog */ if (mlf !=3D NULL) { - fprintf(mlf, "%s/%s type=3Dfile " + fprintf(mlf, "./%s/%s type=3Dfile " "uname=3D%s gname=3D%s mode=3D%#o size=3D%ld= \n", unexpand_path(dir), path, uname, gname, mode, ftell(f)); @@ -561,7 +561,7 @@ write_bundle(const char *dir, const char *file, = struct cert_tree *tree) } if (ret =3D=3D 0 && mlf !=3D NULL) { fprintf(mlf, - "%s/%s type=3Dfile uname=3D%s gname=3D%s mode=3D%#o = size=3D%ld\n", + "./%s/%s type=3Dfile uname=3D%s gname=3D%s mode=3D%#= o = size=3D%ld\n", unexpand_path(dir), file, uname, gname, mode, = ftell(f)); } fclose(f); =E2=80=94 Kristof --=_MailMate_E13A9DC5-543A-4DAC-AEC3-456857F598E0_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 14 Aug 2025, at 0:25, Dag-Erling Sm=C3=B8rgrav wrote:<= /p>

The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3D81d8827ad8752e35411204541f1f09df1481e417

commit 81d8827ad8752e35411204541f1f09df1481e417
Author: Dag-Erling Sm=C3=B8rgrav d= es@FreeBSD.org
AuthorDate: 2025-08-13 22:25:27 +0000
Commit: Dag-Erling Sm=C3=B8rgrav d= es@FreeBSD.org
CommitDate: 2025-08-13 22:25:27 +0000

ce=
rtctl: Reimplement in C

Notable changes include:

* We no longer forget manually untrusted certificates when rehashing.

* Rehash will now scan the existing directory and progressively replace
  its contents with those of the new trust store.  The trust store as a
  whole is not replaced atomically, but each file within it is.

* We no longer attempt to link to the original files, but we don't copy
  them either.  Instead, we write each certificate out in its minimal
  form.

* We now generate a trust bundle in addition to the hashed diretory.
  This also contains only the minimal DER form of each certificate.

* The C version is approximately two orders of magnitude faster than the
  sh version, with rehash taking ~100 ms vs ~5-25 s depending on whether
  ca_root_nss is installed.

* The DISTBASE concept has been dropped; the same effect can be achieved
  by adjusting DESTDIR.

* We now also have rudimentary tests.

Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D42320

I=E2=80=99m seeing errors like this during bricoler test = runs now:

/usr/home/kp/bricoler/freebsd-src-regression-suite-vm-ima= ge/image.amd64.amd64-METALOG.mtree:38358: error: word too long to fit buf= fer (max 10 characters)

Those are all lines with absolute paths (e.g. /etc/ssl/ce= rt.pem rather than ./etc/ssl/cert.pem).
This hack seems to fix things for me, but I=E2=80=99m nowhere near famili= ar enough with the relevant build bits to say for sure if that=E2=80=99s = right or not:

di=
ff --git a/usr.sbin/certctl/certctl.c b/usr.sbin/certctl/certctl.c
index 365870167aeb..336a49830a3d 100644
--- a/usr.sbin/certctl/certctl.c
+++ b/usr.sbin/certctl/certctl.c
@@ -490,7 +490,7 @@ write_certs(const char *dir, struct cert_tree *tree)
                }
                /* emit metalog */
                if (mlf !=3D NULL) {
-                       fprintf(mlf, "%s/%s type=3Dfile "
+                       fprintf(mlf, "./%s/%s type=3Dfile "
                            "uname=3D%s gname=3D%s mode=3D%#o size=3D=
%ld\n",
                            unexpand_path(dir), path,
                            uname, gname, mode, ftell(f));
@@ -561,7 +561,7 @@ write_bundle(const char *dir, const char *file, struc=
t cert_tree *tree)
        }
        if (ret =3D=3D 0 && mlf !=3D NULL) {
                fprintf(mlf,
-                   "%s/%s type=3Dfile uname=3D%s gname=3D%s mode=3D=
%#o size=3D%ld\n",
+                   "./%s/%s type=3Dfile uname=3D%s gname=3D%s mode=3D=
%#o size=3D%ld\n",
                    unexpand_path(dir), file, uname, gname, mode, ftell(f=
));
        }
        fclose(f);

=E2=80=94
Kristof

--=_MailMate_E13A9DC5-543A-4DAC-AEC3-456857F598E0_=--