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 <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>
This commit is contained in:
committed by
Gopher Robot
parent
0d502d7cd6
commit
043e94c17a
@@ -64,18 +64,14 @@ var bundle = mustParse([]byte(pemRoots))
|
|||||||
`
|
`
|
||||||
|
|
||||||
var (
|
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)")
|
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 (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 (this overrides certdata-url, if provided)")
|
||||||
output = flag.String("output", "fallback/bundle.go", "Path to file to write output to")
|
output = flag.String("output", "fallback/bundle.go", "Path to file to write output to")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if *certDataPath != "" && *certDataURL != "" {
|
|
||||||
log.Fatal("Only one of --certdata-url and --certdata-path may be supplied")
|
|
||||||
}
|
|
||||||
|
|
||||||
var certdata io.Reader
|
var certdata io.Reader
|
||||||
|
|
||||||
if *certDataPath != "" {
|
if *certDataPath != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user