aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-01 10:39:21 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-01 10:39:21 +0200
commit2b210874607d7c9690650fb60d90262a83484890 (patch)
tree0958bc6b07c73e7cf5e9b2a348ea74c0ff881292
parent897970aa3fc100e0ed5fd6ddcea6bd9867c029d3 (diff)
Rewrite wildcard SANs
-rw-r--r--.main.go.swpbin20480 -> 0 bytes
-rw-r--r--main.go9
2 files changed, 8 insertions, 1 deletions
diff --git a/.main.go.swp b/.main.go.swp
deleted file mode 100644
index 36e0a39..0000000
--- a/.main.go.swp
+++ /dev/null
Binary files differ
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
+}