Skip to content

Commit

Permalink
x509roots: fix generate script argument checking
Browse files Browse the repository at this point in the history
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 <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
  • Loading branch information
rolandshoemaker authored and gopherbot committed Jun 20, 2023
1 parent 0d502d7 commit 043e94c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions x509roots/gen_fallback_bundle.go
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 043e94c

Please sign in to comment.