From f9432ae4b9daa6a1e7689524065ac0199a5d8829 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Tue, 10 May 2016 14:29:04 -0700 Subject: [PATCH] Reverse order of certspotter.MatchesWildcard arguments --- cmd/certspotter/main.go | 2 +- helpers.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/certspotter/main.go b/cmd/certspotter/main.go index 4055d0f..d0cf51f 100644 --- a/cmd/certspotter/main.go +++ b/cmd/certspotter/main.go @@ -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 { diff --git a/helpers.go b/helpers.go index 964018b..b1cf70e 100644 --- a/helpers.go +++ b/helpers.go @@ -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:]