From 043e94c17aa993f4d1026a2f692b8980e7740df2 Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Tue, 20 Jun 2023 11:21:59 -0700 Subject: [PATCH] x509roots: fix generate script argument checking Check for supply of both arguments forgot that the URL is set by default. Instead just let the local path supersede the URL. Change-Id: I0499137c99c735e8e453ff1c2a925435f3cd8039 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/504596 Run-TryBot: Roland Shoemaker Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Auto-Submit: Roland Shoemaker --- x509roots/gen_fallback_bundle.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x509roots/gen_fallback_bundle.go b/x509roots/gen_fallback_bundle.go index c3e562febc..c347c37913 100644 --- a/x509roots/gen_fallback_bundle.go +++ b/x509roots/gen_fallback_bundle.go @@ -64,18 +64,14 @@ var bundle = mustParse([]byte(pemRoots)) ` var ( - certDataURL = flag.String("certdata-url", "https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt", "URL to the raw certdata.txt file to parse (only one of certdata-url and certdata-path may be specified)") - certDataPath = flag.String("certdata-path", "", "Path to the NSS certdata.txt file to parse (only one of certdata-url and certdata-path may be specified)") + certDataURL = flag.String("certdata-url", "https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt", "URL to the raw certdata.txt file to parse (certdata-path overrides this, if provided)") + certDataPath = flag.String("certdata-path", "", "Path to the NSS certdata.txt file to parse (this overrides certdata-url, if provided)") output = flag.String("output", "fallback/bundle.go", "Path to file to write output to") ) func main() { flag.Parse() - if *certDataPath != "" && *certDataURL != "" { - log.Fatal("Only one of --certdata-url and --certdata-path may be supplied") - } - var certdata io.Reader if *certDataPath != "" {