From 2b210874607d7c9690650fb60d90262a83484890 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sat, 1 Apr 2023 10:39:21 +0200 Subject: Rewrite wildcard SANs --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index fcd8bbf..569d9fe 100644 --- a/main.go +++ b/main.go @@ -237,7 +237,7 @@ func workGenerator(ctx context.Context, opts options.Options, fp *os.File, quest select { case <-ctx.Done(): return nextLine, false - case questionCh <- qna.Question{Domain: scanner.Text()}: + case questionCh <- qna.Question{Domain: trimWildcard(scanner.Text())}: nextLine++ readCount++ case <-metrics.C: @@ -259,3 +259,10 @@ func workGenerator(ctx context.Context, opts options.Options, fp *os.File, quest } return nextLine, true } + +func trimWildcard(san string) string { + if len(san) >= 2 && san[:2] == "*." { + return san[2:] + } + return san +} -- cgit v1.2.3