me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Package CA store maintenance and the compatibility trust paths

diviocity committed 6 days ago · a33ddf23ff7658e6bd33d91c6837d2993ef68787 View patch
Unverified signature 4 files changed +49 -1
ca-certificates-bundle/PKGBUILD.vile +5 -1

@@ -1,7 +1,7 @@

11defpkgbuild(ca-certificates-bundle,

22 #:pkgname, "ca-certificates-bundle",

33 #:pkgver, "20261020",

4- #:pkgrel, 2,

4+ #:pkgrel, 3,

55 #:pkgdesc, "Mozilla TLS certificate authorities for Vinix",

66 #:arch, [#:any],

77 #:url, "https://gitlab.alpinelinux.org/alpine/ca-certificates",

@@ -25,6 +25,10 @@ defpkgbuild(ca-certificates-bundle,

2525 run("install", "-Dm644", "ca-certificates-20261020/cert.pem",

2626 string-append(pkgdir(), "/etc/ssl/certs/ca-certificates.crt"))

2727 run("ln", "-s", "certs/ca-certificates.crt", string-append(pkgdir(), "/etc/ssl/cert.pem"))

28+ run("mkdir", "-p", string-append(pkgdir(), "/etc/ssl1.1"))

29+ run("ln", "-s", "../ssl/certs", string-append(pkgdir(), "/etc/ssl1.1/certs"))

30+ run("ln", "-s", "../ssl/cert.pem", string-append(pkgdir(), "/etc/ssl1.1/cert.pem"))

31+ run("cmp", string-append(pkgdir(), "/etc/ssl1.1/cert.pem"), string-append(pkgdir(), "/etc/ssl1.1/certs/ca-certificates.crt"))

2832 ; The Java trust-store builder also consumes the authorities individually.

2933 dest := string-append(pkgdir(), "/usr/share/ca-certificates/mozilla")

3034 run("mkdir", "-p", dest)

ca-certificates/PKGBUILD.vile new file +33 -0

@@ -0,0 +1,33 @@

1+defpkgbuild(ca-certificates,

2+ #:pkgname, "ca-certificates",

3+ #:pkgver, "20261020",

4+ #:pkgrel, 1,

5+ #:pkgdesc, "Update the system trust store and hash locally installed authorities",

6+ #:arch, [#:x86-64, #:aarch64],

7+ #:url, "https://gitlab.alpinelinux.org/alpine/ca-certificates",

8+ #:license, "MPL-2.0 AND MIT",

9+ #:depends, ["musl", "openssl", "busybox", "ca-certificates-bundle=20261020"],

10+ #:backup, ["etc/ca-certificates.conf"],

11+ #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/ca-certificates-20261020.tar.bz2", "make-config.py", "certhash"],

12+ #:sha256sums, ["1048bc7f50fa42a6621bc2f8816173f89a0c0098f26dff072bc8fe40af714400",

13+ "10e3a6fbeca47340c6e50bff0cd06328f28a36161609fc0bd23d90a80e8e5bc8", "dcdcc8690bcb948d9cf90da1f3e6c504273bd13d560edc7482f141ff17acd76a"],

14+ #:build, fn() {

15+ run("make", "-C", "ca-certificates-20261020", "CC=vinix-cc", "update-ca-certificates", "c_rehash")

16+ run("python3", "make-config.py")

17+ },

18+ #:check, fn() {

19+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")

20+ run("mkdir", "checked")

21+ run("cp", string-append(root, "/usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt"), "checked/test.crt")

22+ run("vinix-run", "ca-certificates-20261020/c_rehash", "checked")

23+ run("vinix-run", string-append(root, "/usr/bin/openssl"), "verify", "-no-CAfile", "-no-CAstore", "-no_check_time",

24+ "-CApath", "checked", "checked/test.crt")

25+ },

26+ #:package, fn() {

27+ run("install", "-Dm755", "ca-certificates-20261020/update-ca-certificates", string-append(pkgdir(), "/usr/sbin/update-ca-certificates"))

28+ run("install", "-Dm755", "ca-certificates-20261020/c_rehash", string-append(pkgdir(), "/usr/bin/c_rehash"))

29+ run("install", "-Dm755", "certhash", string-append(pkgdir(), "/etc/ca-certificates/update.d/certhash"))

30+ run("install", "-Dm644", "ca-certificates.conf", string-append(pkgdir(), "/etc/ca-certificates.conf"))

31+ run("install", "-Dm644", "ca-certificates-20261020/update-ca-certificates.8", string-append(pkgdir(), "/usr/share/man/man8/update-ca-certificates.8"))

32+ run("mkdir", "-p", string-append(pkgdir(), "/usr/local/share/ca-certificates"))

33+ })

ca-certificates/certhash new file +2 -0

@@ -0,0 +1,2 @@

1+#!/bin/sh

2+exec /usr/bin/c_rehash /etc/ssl/certs

ca-certificates/make-config.py new file +9 -0

@@ -0,0 +1,9 @@

1+"""Write update-ca-certificates' default trust selections from the matching Vinix bundle."""

2+from pathlib import Path

3+import os

4+

5+certs = Path(os.environ["VPAC_MAKEPKG_ROOT"]) / "usr/share/ca-certificates"

6+files = sorted(path.relative_to(certs).as_posix() for path in (certs / "mozilla").glob("*.crt"))

7+if "mozilla/ISRG_Root_X1.crt" not in files:

8+ raise SystemExit("missing packaged Mozilla authorities")

9+Path("ca-certificates.conf").write_text("\n".join(files) + "\n")