public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/erlang-certifi] f45: Adapt tests to the system CA bundle
@ 2026-10-23 13:31 Peter Lemenkov
  0 siblings, 0 replies; only message in thread
From: Peter Lemenkov @ 2026-10-23 13:31 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/erlang-certifi
            Branch : f45
            Commit : 2a84089a9cec1379cdc8c99621b0940ce513544c
            Author : Peter Lemenkov <lemenkov@gmail.com>
            Date   : 2026-10-23T15:06:32+02:00
            Stats  : +56/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/erlang-certifi/c/2a84089a9cec1379cdc8c99621b0940ce513544c?branch=f45

            Log:
            Adapt tests to the system CA bundle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

---
diff --git a/erlang-certifi-0002-Adapt-tests-to-the-system-CA-bundle.patch b/erlang-certifi-0002-Adapt-tests-to-the-system-CA-bundle.patch
new file mode 100644
index 0000000..9898f14
--- /dev/null
+++ b/erlang-certifi-0002-Adapt-tests-to-the-system-CA-bundle.patch
@@ -0,0 +1,55 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov@gmail.com>
+Date: Fri, 23 Oct 2026 15:04:59 +0200
+Subject: [PATCH] Adapt tests to the system CA bundle
+
+Fedora builds certifi against the system CA bundle instead of the
+bundled Mozilla snapshot, so the number, order and exact contents of the
+CA certificates cannot be asserted against upstream's priv/cacerts.pem.
+Replace those checks with generic sanity checks, and drop the test for
+the distrusted emSign roots: their removal is up to ca-certificates.
+
+Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
+Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
+
+diff --git a/test/certifi_tests.erl b/test/certifi_tests.erl
+index 2f089fd..f78aebd 100644
+--- a/test/certifi_tests.erl
++++ b/test/certifi_tests.erl
+@@ -8,30 +8,16 @@ reproducible_module_test() ->
+     ?assertMatch([{version,[_|_]}], certifi:module_info(compile)).
+ -endif.
+ 
++%% Fedora builds against the system CA bundle, so the exact count, order and
++%% contents of upstream's Mozilla snapshot cannot be asserted here.
+ cacerts_test_() ->
+-    Certs = [Cert1, Cert2, Cert3 | _] = certifi:cacerts(),
+-    [?_assertEqual(118, length(Certs))
+-    ,?_assertMatch(<<48,130,5,130,48,130,3,106,160,3,2,1,2,2,15,1,139,210,80,171,_/binary>>, Cert1)
+-    ,?_assertMatch(<<48,130,2,50,48,130,1,183,160,3,2,1,2,2,15,1,139,210,34,84,_/binary>>, Cert2)
+-    ,?_assertMatch(<<48,130,2,76,48,130,1,209,160,3,2,1,2,2,9,0,129,122,44,239,_/binary>>, Cert3)
+-    ,?_assertMatch(<<48,130,2,137,48,130,2,15,160,3,2,1,2,2,16,31,71,175,170,98,_/binary>>, lists:last(Certs))
++    Certs = certifi:cacerts(),
++    [?_assertNotEqual([], Certs)
++    ,?_assertEqual(length(Certs), length(lists:usort(Certs)))
++    ,?_assertEqual([], [C || C <- Certs, not is_tuple(catch public_key:pkix_decode_cert(C, otp))])
+     ].
+ 
+ cacertfile_matches_embedded_bundle_test() ->
+     {ok, Pem} = file:read_file(certifi:cacertfile()),
+     Certs = [Der || {'Certificate', Der, _} <- public_key:pem_decode(Pem)],
+     ?assertEqual(lists:sort(Certs), lists:sort(certifi:cacerts())).
+-
+-distrusted_emsign_roots_test_() ->
+-    Fingerprints = [crypto:hash(sha256, Cert) || Cert <- certifi:cacerts()],
+-    %% Removed by Mozilla NSS in October 2026 (bugs 2083709 and 2084101).
+-    Distrusted = [
+-        {"emSign Root CA - C1",
+-         <<16#125609aa301da0a249b97a8239cb6a34216f44dcac9f3954b14292f2e8c8608f:256>>},
+-        {"emSign ECC Root CA - C3",
+-         <<16#bc4d809b15189d78db3e1d8cf4f9726a795da1643ca5f1358e1ddb0edc0d7eb3:256>>},
+-        {"emSign ECC Root CA - G3",
+-         <<16#86a1ecba089c4a8d3bbe2734c612ba341d813e043cf9e8a862cd5c57a36bbe6b:256>>}
+-    ],
+-    [{Name, ?_assertNot(lists:member(Fingerprint, Fingerprints))}
+-     || {Name, Fingerprint} <- Distrusted].

diff --git a/erlang-certifi.spec b/erlang-certifi.spec
index 7143240..6b56380 100644
--- a/erlang-certifi.spec
+++ b/erlang-certifi.spec
@@ -10,6 +10,7 @@ URL:      https://github.com/%{realname}/erlang-%{realname}
 VCS:      git:%{url}.git
 Source:   %{url}/archive/%{version}/%{realname}-%{version}.tar.gz
 Patch:    erlang-certifi-0001-Enforce-Fedora-CA-bundle.patch
+Patch:    erlang-certifi-0002-Adapt-tests-to-the-system-CA-bundle.patch
 BuildRequires: erlang-parse_trans
 BuildSystem:   rebar3
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-23 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 13:31 [rpms/erlang-certifi] f45: Adapt tests to the system CA bundle Peter Lemenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox