#!/usr/bin/env zsh set -e # Reduced CA set hardening — downloads specific roots from Mozilla bundle and direct sources, # converts PEM -> DER for bundling in library:network assets/ca/. # # Why: first-party Cloudflare domains only need ISRG + GTS, reducing blast radius of rogue CA. # Appstore STANDARD needs DigiCert + ISRG + GTS (F-Droid + GitHub + Play Store via GTS). # # Nothing fetched here is trusted on its own. Both sources — the Mozilla bundle and the # direct-URL fallback — are converted inside $TMP_DIR and only moved into assets/ca/ when # the result matches its PINS entry below. The pins are the SHA-256 of the .der files as # committed, so the anchors this script can produce are exactly the anchors already in the # tree, and rolling one is a reviewable edit to both the .der and its pin in the same diff: # # sha256sum library/network/src/main/assets/ca/