Source: ca-certificates
Version: 20260816+nmu1
Severity: normal
Tags: patch

Hello,

Rebuilding the Mozilla certificate set in an existing ca-certificates
source tree can retain certificates removed from the input set.
certdata2pem.py leaves old CRTs in place and writes a _2 variant when
the normal filename already exists.

To reproduce in a disposable extraction of the 20260816+nmu1 source:

  make -C mozilla all
  printf '\n"ISRG Root X1"\n' >> mozilla/blacklist.txt
  make -C mozilla all

The test-only blacklist edit simulates removing one root. Expected: 119
CRT files, with ISRG_Root_X1.crt gone. Observed: 238 CRTs (up from 120),
with ISRG_Root_X1.crt still present. With the attached patch, the repeated
build produced exactly the same 119 filenames and SHA-256 hashes as a
clean build with the changed blacklist. Tested the Debian source with
Python 3.14.4 and cryptography 46.0.5; no system trust store was modified.

The patch only clears generated outputs in mozilla/ before invoking the
converter. It does not change the source trust policy or installation.
The OpenWrt PR also addresses its separate private staging directory;
that downstream change is not part of this patch:
https://github.com/openwrt/openwrt/pull/26790

Bug discovery was LLM-assisted. A human reviewed the patch and
authorized its submission.

Thanks,
Alexey
>From 99277872bdc1495453458493affed7111307c825 Mon Sep 17 00:00:00 2001
From: Alexey Immoreev <[email protected]>
Date: Wed, 18 Nov 2026 18:48:12 +0000
Subject: [PATCH] mozilla: remove stale generated certificates before
 conversion

certdata2pem.py does not remove obsolete files and creates a _2 variant
when a certificate output name already exists. Clear previous generated
output before invoking the converter.

Signed-off-by: Alexey Immoreev <[email protected]>
---
 mozilla/Makefile | 1 +
 1 file changed, 1 insertion(+)

--- a/mozilla/Makefile
+++ b/mozilla/Makefile
@@ -3,6 +3,7 @@
 #
 
 all:
+	rm -f -- *.crt
 	python3 certdata2pem.py
 
 clean:

Reply via email to