Skip to content

frostwire-bin: drop unused bundled JRE - #577810

Open
irgolic wants to merge 1 commit into
NixOS:masterfrom
irgolic:cacert/frostwire-bin
Open

irgolic wants to merge 1 commit into
NixOS:masterfrom
irgolic:cacert/frostwire-bin

Conversation

@irgolic

@irgolic irgolic commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Part of #576543, though the bundle in this package is currently part of some dead code, that this PR removes.

FrostWire, frostwire-bin, has a bundled JRE in share/java/jre with a Java trust store, lib/security/cacerts. The frostwire launcher does not use this JRE, because the package sets JAVA_PROGRAM_DIR to the bin directory of the nixpkgs jre. The bundled JRE is in the output only because the */*.jar glob of installPhase finds no file. Thus, ls gives all files of the source, and mv moves all of them into share/java. This change removes share/java/jre, and the output becomes 57 MB smaller.

Warning

AI Disclosure: Claude Code made the code change, the commit message and the first version of this pull request description. Claude Code used Claude Fable 5.1 and Claude Opus 5.5. I examined all of this work. Claude Code also wrote all of nix-cacert-harness. This pull request description is written in ASD-STE100 (Simplified Technical English), examined with memelint in strict mode.

Test

nix-cacert-harness examines the package before and after this change. A local copy of nixpkgs is not necessary.

nix run github:irgolic/nix-cacert-harness -- frostwire-bin --pr 577810 --emudhra
Harness output: frostwire-bin
$ nix run github:irgolic/nix-cacert-harness -- frostwire-bin --base 9ced70b05ecbc2a707ca03de0c96df9603dcbe05 --after github:irgolic/nixpkgs/0e9b68bb85afb62d52cbed083978adcaa537c966 --emudhra
[1/2] static check + eMudhra chains: offline, reproducible
base (before) = 9ced70b05ecbc2a707ca03de0c96df9603dcbe05
reference: fprs4zi8r6227x12qbsd1grvfrpz6201-nss-cacert-3.131.1 TLS roots=118 all=169
==================================================================
ATTR frostwire-bin
before: 9ced70b05ecbc2a707ca03de0c96df9603dcbe05   after: github:irgolic/nixpkgs/0e9b68bb85afb62d52cbed083978adcaa537c966
before ok (0 built, 1s)
        drv /nix/store/…-frostwire-6.13.3.drv
after  ok (0 built, 1s)
        drv /nix/store/…-frostwire-6.13.3.drv

| output:path | before | after |
|---|---|---|
| out:/share/java/jre/lib/security/cacerts | keystore 110 certs: 38 not in cacert, 17 in cacert but not for TLS, 63 cacert TLS roots missing [no-password]; scanner: AAA,ECC G3 | absent |

cacert in runtime closure (before): no
cacert in runtime closure (after): no
CAs trusted before but not trusted for TLS by cacert (55 total), e.g.:
  - CN=AAA Certificate Services, O=Comodo CA Limited, L=Salford, ST=Greater Manchester, C=GB
  - CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
  - CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
  - CN=AddTrust External CA Root, OU=AddTrust External TTP Network, O=AddTrust AB, C=SE
  - CN=AddTrust Qualified CA Root, OU=AddTrust TTP Network, O=AddTrust AB, C=SE
  - CN=AffirmTrust Commercial, O=AffirmTrust, C=US
  - CN=AffirmTrust Networking, O=AffirmTrust, C=US
  - CN=AffirmTrust Premium ECC, O=AffirmTrust, C=US
  - CN=AffirmTrust Premium, O=AffirmTrust, C=US
VERDICT frostwire-bin: FIXED: before trusted CAs outside cacert; after: 0 store(s) == cacert, none with extra CAs

eMudhra chains (--emudhra; offline and reproducible): the 14 chains in fixtures/emudhra,
each leaf verified against each store (openssl verify -purpose sslserver, at 2026-10-23):
| output:path | before | after |
|---|---|---|
| out:/share/java/jre/lib/security/cacerts | keystore: accepted 14/14 (g3: 7/7, aaa: 7/7, noct: 2/2) | absent |
VERDICT frostwire-bin emudhra: FIXED: before accepted 14/14 compromised eMudhra chains (g3: 7/7, aaa: 7/7, noct: 2/2); after 0/14

[2/2] live eMudhra test hosts: needs network, NOT reproducible offline
==================================================================
LIVE frostwire-bin: needs network; NOT reproducible offline (the static and behavioral checks are)
before: 9ced70b05ecbc2a707ca03de0c96df9603dcbe05   after: github:irgolic/nixpkgs/0e9b68bb85afb62d52cbed083978adcaa537c966
shim: shims/live/frostwire-bin.nix   hosts: https://<host>-emudhra.we-have-a-problem.com/, one request per host per side, 10s timeout
before ok (0 package drvs built, 2s)
        wrapper /nix/store/…-ca-live-frostwire-bin
after  ok (0 package drvs built, 2s)
        wrapper /nix/store/…-ca-live-frostwire-bin
system store: visible: /etc/ssl/certs/ca-certificates.crt -> nss-cacert-3.126/etc/ssl/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt -> nss-cacert-3.126/etc/ssl/certs/ca-bundle.crt
              rejects every served chain, so it cannot make a cell CONNECTED
              but it holds the root of dv-g3b,dv-g3b-aaa,dv-g3c,dv-g3c-aaa with a trust rule that REJECTS it (OpenSSL "certificate rejected"):
              a program that loads it next to its own store (OpenSSL's default paths, e.g. excon) is
              REFUSED there whatever its own store says; --no-system-store shows the package's store alone
control dv-g3b: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3b-emudhra.we-have-a-problem.com.pem (3 certs, valid for the host up to emSign ECC Root CA - G3), stock cacert rejects it
control dv-g3b-aaa: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3b-aaa-emudhra.we-have-a-problem.com.pem (2 certs, valid for the host up to AAA Certificate Services), stock cacert rejects it
control dv-g3c: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3c-emudhra.we-have-a-problem.com.pem (3 certs, valid for the host up to emSign ECC Root CA - G3), stock cacert rejects it
control dv-g3c-aaa: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3c-aaa-emudhra.we-have-a-problem.com.pem (2 certs, valid for the host up to AAA Certificate Services), stock cacert rejects it
  before dv-g3b      REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  before dv-g3b-aaa  REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  before dv-g3c      REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  before dv-g3c-aaa  REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  after  dv-g3b      REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  after  dv-g3b-aaa  REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  after  dv-g3c      REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild
  after  dv-g3c-aaa  REFUSED        | Exception in thread "main" javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuild

frostwire-bin  (live; before 9ced70b05ecbc2a707ca03de0c96df9603dcbe05, after github:irgolic/nixpkgs/0e9b68bb85afb62d52cbed083978adcaa537c966)
         | dv-g3b         | dv-g3b-aaa     | dv-g3c         | dv-g3c-aaa
before   | REFUSED        | REFUSED        | REFUSED        | REFUSED
after    | REFUSED        | REFUSED        | REFUSED        | REFUSED
VERDICT frostwire-bin live: INCONCLUSIVE-BEFORE: before was REFUSED on all 4 host(s) too (the program's runtime store never trusted these chains, e.g. it runs on the already-fixed openjdk); after REFUSED on all 4. The host's system store, visible here, distrusts the roots of dv-g3b,dv-g3b-aaa,dv-g3c,dv-g3c-aaa: rerun with --no-system-store if the program also loads it

The harness tests the package with the certificate chains of the eMudhra incident, from https://emudhra.we-have-a-problem.com/ (only the certificates, not the keys). The trust store of the bundled JRE accepts all 14 chains (accepted 14/14), through emSign ECC Root CA - G3 and through the Sectigo cross-sign by AAA Certificate Services. This change removes this trust store with the bundled JRE (absent). FrostWire does not operate on this JRE, but on the nixpkgs jre, and cacert makes the trust store of this JRE. In the second part of the output, a Java test on the java in JAVA_PROGRAM_DIR sends one request to each of four test servers. The test connects to no server before and after this change. This result is correct, because FrostWire operates on the nixpkgs jre before and after this change.

Things done

Assisted-by: Claude Code (Claude Fable 5.1)
Assisted-by: Claude Code (Claude Opus 5.5)
@irgolic irgolic added 1.severity: security Issues which raise a security issue, or PRs that fix one and removed 1.severity: security Issues which raise a security issue, or PRs that fix one labels Oct 23, 2026
@zimbatm zimbatm mentioned this pull request Oct 23, 2026
28 of 37 tasks
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. llm-assisted Contributions that include code generation with LLMs labels Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.needs: reviewer This PR currently has no reviewers requested and needs attention. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant