Skip to content

Commit 2557e7f

Browse files
committed
Fixed gofmt concerns
Signed-off-by: Daniel Jolly <[email protected]>
1 parent f71756a commit 2557e7f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

prober/tcp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ func ProbeTCP(ctx context.Context, target string, module config.Module, registry
9898
},
9999
[]string{"fingerprint_sha256", "subject", "issuer", "subjectalternative"},
100100
)
101-
101+
102102
probeSSLLastKeyBits := prometheus.NewGaugeVec(
103103
prometheus.GaugeOpts{
104104
Name: "probe_ssl_last_chain_key_bits",
105-
Help: "Contains SSL leaf certificate information",
105+
Help: "Contains SSL leaf key information and size in bits",
106106
},
107107
[]string{"type", "fingerprint_sha256"},
108108
)

prober/tls.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
package prober
1515

1616
import (
17+
"crypto/ecdsa"
18+
"crypto/rsa"
1719
"crypto/sha256"
1820
"crypto/tls"
19-
"crypto/rsa"
20-
"crypto/ecdsa"
2121
"encoding/hex"
2222
"strings"
2323
"time"
@@ -92,17 +92,17 @@ func getTLSCipher(state *tls.ConnectionState) string {
9292

9393
func getTLSKeyTypeAndSize(state *tls.ConnectionState) (string, int) {
9494
cert := state.PeerCertificates[0]
95-
if key, ok := cert.PublicKey.(*ecdsa.PublicKey); ok {
96-
return "ec", key.Curve.Params().BitSize
97-
}
98-
if key, ok := cert.PublicKey.(*rsa.PublicKey); ok {
99-
return "rsa", key.N.BitLen()
100-
}
95+
if key, ok := cert.PublicKey.(*ecdsa.PublicKey); ok {
96+
return "ec", key.Curve.Params().BitSize
97+
}
98+
if key, ok := cert.PublicKey.(*rsa.PublicKey); ok {
99+
return "rsa", key.N.BitLen()
100+
}
101101
return "", 0
102102
}
103103

104104
func getTLSKeyFingerprint(state *tls.ConnectionState) string {
105105
cert := state.PeerCertificates[0]
106106
fingerprint := sha256.Sum256(cert.RawSubjectPublicKeyInfo)
107107
return hex.EncodeToString(fingerprint[:])
108-
}
108+
}

0 commit comments

Comments
 (0)