From e340e726a32e54bb32deb64564371dc86137d567 Mon Sep 17 00:00:00 2001 From: Pierre Magne Date: Thu, 14 Apr 2022 11:55:26 +0200 Subject: [PATCH 1/3] fetchIPAddresses after finding a certificate, not for every certificate --- lib/lib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.go b/lib/lib.go index c049a55..13ce163 100644 --- a/lib/lib.go +++ b/lib/lib.go @@ -38,6 +38,7 @@ func CertCheckWorker(r string, homoglyph *map[string]string, msgChan chan []byte if !IsMatchingCert(homoglyph, result, reg) { continue } + result.Addresses = fetchIPAddresses(result.Domain) bufferChan <- result } } @@ -59,7 +60,6 @@ func ParseResultCertificate(msg []byte) (*model.Result, error) { Addresses: []string{}, } - r.Addresses = fetchIPAddresses(r.Domain) return r, nil } From c2c71395b362789d5a87838c723c90e01766b02e Mon Sep 17 00:00:00 2001 From: Pierre Magne Date: Thu, 14 Apr 2022 14:01:08 +0200 Subject: [PATCH 2/3] fix tests --- lib/lib_test.go | 1 - res/cert_idn.json | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/lib_test.go b/lib/lib_test.go index b58537e..0728faa 100644 --- a/lib/lib_test.go +++ b/lib/lib_test.go @@ -80,7 +80,6 @@ var _ = Describe("Handler", func() { Expect(result.IDN).Should(Equal("")) Expect(result.SAN).Should(Equal([]string{"baden-mueller.de", "www.baden-mueller.de"})) Expect(result.Issuer).Should(Equal("Let's Encrypt")) - Expect(result.Addresses).Should(Equal([]string{"23.236.62.147"})) Expect(err).ToNot(HaveOccurred()) }) }) diff --git a/res/cert_idn.json b/res/cert_idn.json index acdc2a2..302189d 100644 --- a/res/cert_idn.json +++ b/res/cert_idn.json @@ -64,6 +64,15 @@ "subjectAltName": "DNS:www.baden-mueller.de, DNS:xn--badn-mullr-msiec.de", "subjectKeyIdentifier": "4F:11:F2:CC:31:BC:1E:B8:29:2F:15:A9:C0:9A:51:C3:05:A4:48:C0" }, + "issuer":{ + "C": "US", + "CN": "Let's Encrypt Authority X3", + "L": null, + "O": "Let's Encrypt", + "OU": null, + "ST": null, + "aggregated": "/C=US/CN=Let's Encrypt Authority X3/O=Let's Encrypt" + }, "fingerprint": "64:BF:49:41:3B:7A:FD:5D:C1:04:D9:44:64:9D:1C:25:13:A2:49:86", "not_after": 1598120268, "not_before": 1590344268, From bc522d58586f93c9ff6b2c8c98ddb635a50dec6f Mon Sep 17 00:00:00 2001 From: Pierre Magne Date: Thu, 14 Apr 2022 14:01:46 +0200 Subject: [PATCH 3/3] fix tests --- res/cert.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/res/cert.json b/res/cert.json index 4fd76a5..08c6d5c 100644 --- a/res/cert.json +++ b/res/cert.json @@ -64,6 +64,15 @@ "subjectAltName": "DNS:www.baden-mueller.de, DNS:baden-mueller.de", "subjectKeyIdentifier": "4F:11:F2:CC:31:BC:1E:B8:29:2F:15:A9:C0:9A:51:C3:05:A4:48:C0" }, + "issuer": { + "C": "US", + "CN": "Let's Encrypt Authority X3", + "L": null, + "O": "Let's Encrypt", + "OU": null, + "ST": null, + "aggregated": "/C=US/CN=Let's Encrypt Authority X3/O=Let's Encrypt" + }, "fingerprint": "64:BF:49:41:3B:7A:FD:5D:C1:04:D9:44:64:9D:1C:25:13:A2:49:86", "not_after": 1598120268, "not_before": 1590344268,