Godeps: Update zlint dependency to 02fe9a2 (tip of master) (#3822)

Notably this brings an [updated gTLD list](https://github.com/zmap/zlint/pull/233).

Tests are confirmed to pass:
```
go test ./...
ok    github.com/zmap/zlint 0.157s
?     github.com/zmap/zlint/cmd/zlint [no test files]
ok    github.com/zmap/zlint/lints 0.130s
ok    github.com/zmap/zlint/util  0.005s
```
This commit is contained in:
Daniel McCarney 2018-08-22 13:46:00 -04:00 committed by Roland Bracewell Shoemaker
parent 876c727b6f
commit 4ed1ddb30e
6 changed files with 30 additions and 20 deletions

6
Godeps/Godeps.json generated
View File

@ -280,15 +280,15 @@
},
{
"ImportPath": "github.com/zmap/zlint",
"Rev": "9bebe5e32c2c4b27892021e8e2f0459ef3b075ab"
"Rev": "02fe9a29bbae57da0c77db7afb53734dc262b130"
},
{
"ImportPath": "github.com/zmap/zlint/lints",
"Rev": "9bebe5e32c2c4b27892021e8e2f0459ef3b075ab"
"Rev": "02fe9a29bbae57da0c77db7afb53734dc262b130"
},
{
"ImportPath": "github.com/zmap/zlint/util",
"Rev": "9bebe5e32c2c4b27892021e8e2f0459ef3b075ab"
"Rev": "02fe9a29bbae57da0c77db7afb53734dc262b130"
},
{
"ImportPath": "golang.org/x/crypto/cryptobyte",

View File

@ -50,6 +50,7 @@ const (
UnknownLintSource LintSource = iota
CABFBaselineRequirements
RFC5280
RFC5891
ZLint
AWSLabs
)

View File

@ -23,17 +23,17 @@ import (
"golang.org/x/text/unicode/norm"
)
type IDNNotNFKC struct{}
type IDNNotNFC struct{}
func (l *IDNNotNFKC) Initialize() error {
func (l *IDNNotNFC) Initialize() error {
return nil
}
func (l *IDNNotNFKC) CheckApplies(c *x509.Certificate) bool {
func (l *IDNNotNFC) CheckApplies(c *x509.Certificate) bool {
return util.IsExtInCert(c, util.SubjectAlternateNameOID)
}
func (l *IDNNotNFKC) Execute(c *x509.Certificate) *LintResult {
func (l *IDNNotNFC) Execute(c *x509.Certificate) *LintResult {
for _, dns := range c.DNSNames {
labels := strings.Split(dns, ".")
for _, label := range labels {
@ -42,7 +42,7 @@ func (l *IDNNotNFKC) Execute(c *x509.Certificate) *LintResult {
if err != nil {
return &LintResult{Status: NA}
}
if !norm.NFKC.IsNormalString(unicodeLabel) {
if !norm.NFC.IsNormalString(unicodeLabel) {
return &LintResult{Status: Error}
}
}
@ -53,11 +53,11 @@ func (l *IDNNotNFKC) Execute(c *x509.Certificate) *LintResult {
func init() {
RegisterLint(&Lint{
Name: "e_international_dns_name_not_nfkc",
Description: "Internationalized DNSNames must be normalized by unicode normalization form KC",
Citation: "RFC 3490",
Source: RFC5280,
EffectiveDate: util.RFC3490Date,
Lint: &IDNNotNFKC{},
Name: "e_international_dns_name_not_nfc",
Description: "Internationalized DNSNames must be normalized by unicode normalization form C",
Citation: "RFC 8399",
Source: RFC5891,
EffectiveDate: util.RFC8399Date,
Lint: &IDNNotNFC{},
})
}

View File

@ -1,6 +1,9 @@
# Script to update the list of gTLDs
curl -o data/newgtlds.txt http://data.iana.org/TLD/tlds-alpha-by-domain.txt
echo "ONION" >> data/newgtlds.txt
curl -o data/iana_gtlds.txt http://data.iana.org/TLD/tlds-alpha-by-domain.txt
echo "ONION" >> data/iana_gtlds.txt
sort data/iana_gtlds.txt data/newgtlds.txt | uniq > data/tmp_gtlds.txt
rm data/iana_gtlds.txt
mv data/tmp_gtlds.txt data/newgtlds.txt
curl -o data/removedtlds.txt https://raw.githubusercontent.com/pzb/TLDs/master/removed/rmtlds.csv
python scripts/consolidate_tlds.py data/newgtlds.txt data/removedtlds.txt util/gtld_map.go
gofmt -w .

View File

@ -186,7 +186,7 @@ var tldMap = map[string]bool{
"BBC": true,
"COOKINGCHANNEL": true,
"WHOSWHO": true,
"CLUBMED": true,
"WORLD": true,
"BBT": true,
"AUDIBLE": true,
"CHANNEL": true,
@ -227,6 +227,7 @@ var tldMap = map[string]bool{
"WED": true,
"COOKING": true,
"ANDROID": true,
"SPORT": true,
"MASERATI": true,
"LIDL": true,
"KM": true,
@ -407,6 +408,7 @@ var tldMap = map[string]bool{
"HOW": true,
"HOT": true,
"XN--NQV7F": true,
"XN--OTU796D": true,
"XN--1QQW23A": true,
"RMIT": true,
"VERISIGN": true,
@ -467,7 +469,7 @@ var tldMap = map[string]bool{
"ING": true,
"MY": true,
"MX": true,
"MZ": true,
"INC": true,
"XN--MIX891F": true,
"READ": true,
"CUISINELLA": true,
@ -556,7 +558,7 @@ var tldMap = map[string]bool{
"SES": true,
"FINANCE": true,
"SEX": true,
"WORLD": true,
"CLUBMED": true,
"XN--MGBI4ECEXP": true,
"CARS": true,
"FRL": true,
@ -721,6 +723,7 @@ var tldMap = map[string]bool{
"XN--CG4BKI": true,
"TATAMOTORS": true,
"CREDIT": true,
"SD": true,
"FLY": true,
"XN--0ZWM56D": true,
"MOSCOW": true,
@ -866,7 +869,7 @@ var tldMap = map[string]bool{
"SA": true,
"OLAYAN": true,
"SE": true,
"SD": true,
"CHARITY": true,
"JOBURG": true,
"IBM": true,
"CAR": true,
@ -1062,6 +1065,7 @@ var tldMap = map[string]bool{
"DIAMONDS": true,
"LADBROKES": true,
"HOTELES": true,
"MZ": true,
"XN--ROVU88B": true,
"CAMP": true,
"HISAMITSU": true,
@ -1516,6 +1520,7 @@ var tldMap = map[string]bool{
"REPORT": true,
"CENTER": true,
"TEVA": true,
"LLC": true,
"SAMSUNG": true,
"SCIENCE": true,
"XN--J1AMH": true,

View File

@ -27,6 +27,7 @@ var (
RFC2459Date = time.Date(1999, time.January, 1, 0, 0, 0, 0, time.UTC)
RFC3280Date = time.Date(2002, time.April, 1, 0, 0, 0, 0, time.UTC)
RFC3490Date = time.Date(2003, time.March, 1, 0, 0, 0, 0, time.UTC)
RFC8399Date = time.Date(2018, time.May, 1, 0, 0, 0, 0, time.UTC)
RFC4325Date = time.Date(2005, time.December, 1, 0, 0, 0, 0, time.UTC)
RFC4630Date = time.Date(2006, time.August, 1, 0, 0, 0, 0, time.UTC)
RFC5280Date = time.Date(2008, time.May, 1, 0, 0, 0, 0, time.UTC)