Reverse order of certspotter.MatchesWildcard arguments
This commit is contained in:
parent
92fbdcb947
commit
f9432ae4b9
|
@ -67,7 +67,7 @@ func dnsLabelMatches (certLabel string, watchLabel string) bool {
|
|||
return certLabel == "*" ||
|
||||
certLabel == "?" ||
|
||||
certLabel == certspotter.UnparsableDNSLabelPlaceholder ||
|
||||
certspotter.MatchWildcard(certLabel, watchLabel)
|
||||
certspotter.MatchesWildcard(watchLabel, certLabel)
|
||||
}
|
||||
|
||||
func dnsNameMatches (dnsName []string, watchDomain []string) bool {
|
||||
|
|
|
@ -400,10 +400,10 @@ func WriteCertRepository (repoPath string, isPrecert bool, certs [][]byte) (bool
|
|||
return false, path, nil
|
||||
}
|
||||
|
||||
func MatchWildcard (pattern string, dnsName string) bool {
|
||||
func MatchesWildcard (dnsName string, pattern string) bool {
|
||||
for len(pattern) > 0 {
|
||||
if pattern[0] == '*' {
|
||||
if len(dnsName) > 0 && dnsName[0] != '.' && MatchWildcard(pattern, dnsName[1:]) {
|
||||
if len(dnsName) > 0 && dnsName[0] != '.' && MatchesWildcard(dnsName[1:], pattern) {
|
||||
return true
|
||||
}
|
||||
pattern = pattern[1:]
|
||||
|
|
Loading…
Reference in New Issue