<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.sbin/certctl, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>certctl: Enforce 0444 mode on new files</title>
<updated>2026-07-19T12:45:43+00:00</updated>
<author>
<name>Lexi Winter</name>
<email>ivy@FreeBSD.org</email>
</author>
<published>2026-07-19T12:45:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=02f174179a538f89185d275b4e64277baf3acc50'/>
<id>02f174179a538f89185d275b4e64277baf3acc50</id>
<content type='text'>
When writing to a file, call fchmod() to ensure the file mode matches
the intended mode, which is 0444.  This was already done when replacing
an existing file, but not when creating a new file, which meant if the
process umask was 077, the resulting certificates and bundle would be
unreadable by unprivileged users.

MFC after:	1 week
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D58304
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When writing to a file, call fchmod() to ensure the file mode matches
the intended mode, which is 0444.  This was already done when replacing
an existing file, but not when creating a new file, which meant if the
process umask was 077, the resulting certificates and bundle would be
unreadable by unprivileged users.

MFC after:	1 week
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D58304
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl: Style nits</title>
<updated>2026-05-28T12:28:22+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-05-28T12:28:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=39f23af2ba4b845eb7f4ec7ae4079a67557eb63d'/>
<id>39f23af2ba4b845eb7f4ec7ae4079a67557eb63d</id>
<content type='text'>
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57298
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57298
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl: Unstickify (un)trusted certificates</title>
<updated>2026-05-05T22:30:52+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-05-05T22:30:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2fef18ff594328a771b6aa659e8ffa5a7e076540'/>
<id>2fef18ff594328a771b6aa659e8ffa5a7e076540</id>
<content type='text'>
Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH.  Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.

Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.

PR:		290078
MFC after:	1 week
Reviewed by:	kevans, bcr
Differential Revision:	https://reviews.freebsd.org/D56617
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH.  Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.

Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.

PR:		290078
MFC after:	1 week
Reviewed by:	kevans, bcr
Differential Revision:	https://reviews.freebsd.org/D56617
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl.8: Prefer the new TRUSTDESTDIR variable</title>
<updated>2025-12-05T17:36:49+00:00</updated>
<author>
<name>Jose Luis Duran</name>
<email>jlduran@FreeBSD.org</email>
</author>
<published>2025-12-05T17:36:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5c7176bba30ab3b250177cba3923bdc84b68a7c7'/>
<id>5c7176bba30ab3b250177cba3923bdc84b68a7c7</id>
<content type='text'>
With the reimplementation in C of certctl, the environment variable
previously known as CERTDESTDIR was renamed to TRUSTDESTDIR for
consistency.

Although the previous variable is still valid, prefer the new one, as it
is described in the manual page, while the old one is not.

Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54044
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the reimplementation in C of certctl, the environment variable
previously known as CERTDESTDIR was renamed to TRUSTDESTDIR for
consistency.

Although the previous variable is still valid, prefer the new one, as it
is described in the manual page, while the old one is not.

Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54044
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl.8: Update documentation of BUNDLE</title>
<updated>2025-10-14T13:41:20+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-10-14T13:32:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ec8e07e8fa94767dceb409c4c7c1840bba39172b'/>
<id>ec8e07e8fa94767dceb409c4c7c1840bba39172b</id>
<content type='text'>
- Fix a typo.
- Provide the default path.

Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D53001
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Fix a typo.
- Provide the default path.

Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D53001
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl: Include sys/types.h</title>
<updated>2025-09-09T13:47:42+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-09-09T13:47:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2024887abc7d1b931e00fbb0697658e98adf048d'/>
<id>2024887abc7d1b931e00fbb0697658e98adf048d</id>
<content type='text'>
This is needed to fix bootstrapping on FreeBSD versions before commit
56ee5c551f89 ("sysctl: make sys/sysctl.h self contained").  Moreover,
certctl should really be including sys/types.h directly since it uses
size_t.

MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is needed to fix bootstrapping on FreeBSD versions before commit
56ee5c551f89 ("sysctl: make sys/sysctl.h self contained").  Moreover,
certctl should really be including sys/types.h directly since it uses
size_t.

MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl: Use __DECONST rather than reimplementing</title>
<updated>2025-09-09T13:27:02+00:00</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@FreeBSD.org</email>
</author>
<published>2025-09-09T13:27:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=26d56dec1e0e3bab571a00fcb9c39d3269fbcf97'/>
<id>26d56dec1e0e3bab571a00fcb9c39d3269fbcf97</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl: Create output directories</title>
<updated>2025-08-22T15:33:45+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-08-22T15:33:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=03221b189a48a509c1bc9adb8331638ae3eac065'/>
<id>03221b189a48a509c1bc9adb8331638ae3eac065</id>
<content type='text'>
In a pkgbase world, we cannot assume that these directories exist; we
must create them ourselves.

Fixes:		c340ef28fd38 ("certctl: Reimplement in C")
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D52121
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a pkgbase world, we cannot assume that these directories exist; we
must create them ourselves.

Fixes:		c340ef28fd38 ("certctl: Reimplement in C")
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D52121
</pre>
</div>
</content>
</entry>
<entry>
<title>certctl: Reimplement in C</title>
<updated>2025-08-18T14:28:29+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-08-18T14:26:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c340ef28fd384b567e35882d04ce17fa31b7384f'/>
<id>c340ef28fd384b567e35882d04ce17fa31b7384f</id>
<content type='text'>
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.
  This allows e.g. Unbound to preload the bundle before chrooting.

* 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.

* We now also have tests.

Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D42320
Differential Revision:	https://reviews.freebsd.org/D51896
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
  This allows e.g. Unbound to preload the bundle before chrooting.

* 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.

* We now also have tests.

Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D42320
Differential Revision:	https://reviews.freebsd.org/D51896
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert certctl reimplementation and follow-ups</title>
<updated>2025-08-17T00:25:49+00:00</updated>
<author>
<name>Colin Percival</name>
<email>cperciva@FreeBSD.org</email>
</author>
<published>2025-08-17T00:17:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=31ac42b486ebb5609c94cfd8a9bec86e457f9b53'/>
<id>31ac42b486ebb5609c94cfd8a9bec86e457f9b53</id>
<content type='text'>
The reimplementation of certctl, while much needed, broke the release
build and 72 hours later corrections are still under review (D51896).

This revert should be reverted once that is ready to land; I just need
this out of the tree temporarily because breakage is interfering with
release engineering for the upcoming 15.0-RELEASE.

Unsquashed reversions:
Revert "etc: add missing mtree entry for certctl tests"
This reverts commit f751757259158a8d3b81d4fb7576b3ebe226dece.
Revert "certctl: Fix bootstrap build"
This reverts commit c989e3cc3da1bfd8ac3ec5a05d1e86ab8ff719f7.
Revert "certctl: Reimplement in C"
This reverts commit 81d8827ad8752e35411204541f1f09df1481e417.

With hat:	re@
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The reimplementation of certctl, while much needed, broke the release
build and 72 hours later corrections are still under review (D51896).

This revert should be reverted once that is ready to land; I just need
this out of the tree temporarily because breakage is interfering with
release engineering for the upcoming 15.0-RELEASE.

Unsquashed reversions:
Revert "etc: add missing mtree entry for certctl tests"
This reverts commit f751757259158a8d3b81d4fb7576b3ebe226dece.
Revert "certctl: Fix bootstrap build"
This reverts commit c989e3cc3da1bfd8ac3ec5a05d1e86ab8ff719f7.
Revert "certctl: Reimplement in C"
This reverts commit 81d8827ad8752e35411204541f1f09df1481e417.

With hat:	re@
</pre>
</div>
</content>
</entry>
</feed>
