Skip to content

Commit ec01da1

Browse files
authored
[Backport staging-next-25.11] cacert 3.117 -> 3.121 (#493496)
2 parents edb2626 + a21ff0c commit ec01da1

2 files changed

Lines changed: 25 additions & 38 deletions

File tree

pkgs/by-name/ca/cacert/package.nix

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
lib,
33
stdenv,
44
writeText,
5-
fetchFromGitHub,
5+
fetchurl,
66
buildcatrust,
77
blacklist ? [ ],
88
extraCertificateFiles ? [ ],
99
extraCertificateStrings ? [ ],
1010

11-
# Used by update.sh
12-
nssOverride ? null,
13-
1411
# Used for tests only
1512
runCommand,
1613
cacert,
@@ -23,10 +20,9 @@ let
2320
lib.concatStringsSep "\n\n" extraCertificateStrings
2421
);
2522

26-
srcVersion = "3.117";
27-
version = if nssOverride != null then nssOverride.version else srcVersion;
23+
version = "3.121";
2824
meta = {
29-
homepage = "https://curl.haxx.se/docs/caextract.html";
25+
homepage = "https://firefox-source-docs.mozilla.org/security/nss/runbooks/rootstore.html#root-store-consumers";
3026
description = "Bundle of X.509 certificates of public Certificate Authorities (CA)";
3127
platforms = lib.platforms.all;
3228
maintainers = with lib.maintainers; [
@@ -35,40 +31,31 @@ let
3531
];
3632
license = lib.licenses.mpl20;
3733
};
38-
certdata = stdenv.mkDerivation {
39-
pname = "nss-cacert-certdata";
40-
inherit version;
41-
42-
src =
43-
if nssOverride != null then
44-
nssOverride.src
45-
else
46-
fetchFromGitHub {
47-
owner = "nss-dev";
48-
repo = "nss";
49-
rev = "NSS_${lib.replaceStrings [ "." ] [ "_" ] version}_RTM";
50-
hash = "sha256-sAs0TiV3TK/WtgHvEjl2KFAgebyWZYmcRcmxjpn2AME=";
51-
};
52-
53-
dontBuild = true;
54-
55-
installPhase = ''
56-
runHook preInstall
57-
58-
mkdir $out
59-
cp lib/ckfw/builtins/certdata.txt $out
60-
61-
runHook postInstall
62-
'';
63-
64-
inherit meta;
65-
};
6634
in
6735
stdenv.mkDerivation {
6836
pname = "nss-cacert";
6937
inherit version;
7038

71-
src = certdata;
39+
src = fetchurl {
40+
urls =
41+
let
42+
# This file is effectively a public interface, see the homepage link
43+
file = "lib/ckfw/builtins/certdata.txt";
44+
tag = "NSS_${lib.replaceStrings [ "." ] [ "_" ] version}_RTM";
45+
in
46+
[
47+
# Prefer mercurial as the canonical source, while github is just a mirror
48+
"https://hg-edge.mozilla.org/projects/nss/raw-file/${tag}/${file}"
49+
"https://raw.githubusercontent.com/nss-dev/nss/refs/tags/${tag}/${file}"
50+
];
51+
hash = "sha256-O5jU4/9XoybZWHwzYzA5yMOpzwtV98pYHXWY/zKesfM=";
52+
};
53+
54+
unpackPhase = ''
55+
runHook preUnpack
56+
cp "$src" "$(stripHash "$src")"
57+
runHook postUnpack
58+
'';
7259

7360
outputs = [
7461
"out"

pkgs/by-name/ca/cacert/update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ BASEDIR="$(dirname "$0")/../../../.."
2525

2626

2727
CURRENT_PATH=$(nix-build --no-out-link -A cacert.out)
28-
PATCHED_PATH=$(nix-build --no-out-link -E "with import $BASEDIR {}; (cacert.override { nssOverride = nss_latest; }).out")
28+
PATCHED_PATH=$(nix-build --no-out-link -E "with import $BASEDIR {}; (cacert.overrideAttrs { src = nss_latest.src + \"/lib/ckfw/builtins/certdata.txt\"; }).out")
2929

3030
# Check the hash of the etc subfolder
3131
# We can't check the entire output as that contains the nix-support folder
@@ -35,5 +35,5 @@ PATCHED_HASH=$(nix-hash "$PATCHED_PATH/etc")
3535

3636
if [[ "$CURRENT_HASH" != "$PATCHED_HASH" ]]; then
3737
NSS_VERSION=$(nix-instantiate --json --eval -E "with import $BASEDIR {}; nss_latest.version" | jq -r .)
38-
update-source-version --version-key=srcVersion cacert.src "$NSS_VERSION"
38+
update-source-version cacert "$NSS_VERSION"
3939
fi

0 commit comments

Comments
 (0)