Skip to content

Commit

Permalink
Merge pull request #14 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.0.2
  • Loading branch information
andyone authored Sep 25, 2016
2 parents 685c678 + 8ea5782 commit 480ae88
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ before_install:
- go get -v pkg.re/essentialkaos/sslscan.v1

script:
- go build sslscan_client.go
- go build sslcli.go
6 changes: 3 additions & 3 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

const (
APP = "SSLScan Client"
VER = "1.0.1"
VER = "1.0.2"
DESC = "Command-line client for the SSL Labs API"
)

Expand Down Expand Up @@ -274,7 +274,7 @@ func check(host string) string {
func showServerMessage() {
serverMessage := strings.Join(api.Info.Messages, " ")

fmtc.Printf("\n{s}%s{!}\n\n", fmtutil.Wrap(serverMessage, "", 80))
fmtc.Printf("\n{s-}%s{!}\n\n", fmtutil.Wrap(serverMessage, "", 80))
}

// quietCheck check some host without any output to console
Expand Down Expand Up @@ -346,7 +346,7 @@ func getColoredGrades(endpoints []*sslscan.EndpointInfo) string {
var result string

for _, endpoint := range endpoints {
result += getColoredGrade(endpoint.Grade) + "{s}/" + endpoint.IPAdress + "{!} "
result += getColoredGrade(endpoint.Grade) + "{s-}/" + endpoint.IPAdress + "{!} "
}

return result
Expand Down
24 changes: 12 additions & 12 deletions cli/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func printCertificateInfo(details *sslscan.EndpointDetails) {
if len(details.Cert.AltNames) > 0 {
if len(details.Cert.AltNames) > 5 {
fmtc.Printf(
" %-24s {s}|{!} %s {s}(+%d more){!}\n",
" %-24s {s}|{!} %s {s-}(+%d more){!}\n",
"Alternative names",
strings.Join(details.Cert.AltNames[:4], " "),
len(details.Cert.AltNames)-4,
Expand All @@ -126,7 +126,7 @@ func printCertificateInfo(details *sslscan.EndpointDetails) {
fmtc.Printf(" %-24s {s}|{!} ", "Issuer")

if details.Cert.Issues&64 == 64 {
fmtc.Printf("%s {s}(Self-signed){!}\n", details.Cert.IssuerLabel)
fmtc.Printf("%s {s-}(Self-signed){!}\n", details.Cert.IssuerLabel)
} else {
fmtc.Printf("%s\n", details.Cert.IssuerLabel)
}
Expand Down Expand Up @@ -279,10 +279,10 @@ func printCipherSuitesInfo(details *sslscan.EndpointDetails) map[int]int {

switch {
case suite.DHStrength != 0:
fmtc.Printf("{s}(DH %d bits){!} "+tag+"\n",
fmtc.Printf("{s-}(DH %d bits){!} "+tag+"\n",
suite.DHStrength)
case suite.ECDHBits != 0:
fmtc.Printf("{s}(ECDH %d bits ~ %d bits RSA){!} "+tag+"\n",
fmtc.Printf("{s-}(ECDH %d bits ~ %d bits RSA){!} "+tag+"\n",
suite.ECDHBits, suite.ECDHStrength)
default:
fmtc.Println(tag)
Expand All @@ -302,7 +302,7 @@ func printHandshakeSimulationInfo(details *sslscan.EndpointDetails, suiteIndex m
continue
}

tag := "{s}No FS{!}"
tag := "{s-}No FS{!}"
suite := details.Suites.List[suiteIndex[sim.SuiteID]]

if strings.Contains(suite.Name, "DHE_") {
Expand Down Expand Up @@ -481,7 +481,7 @@ func printProtocolDetailsInfo(details *sslscan.EndpointDetails) {
fmtc.Printf(" %-40s {s}|{!} ", "Next Protocol Negotiation")

if details.SupportsNPN {
fmtc.Printf("Yes {s}(%s){!}\n", details.NPNProtocols)
fmtc.Printf("Yes {s-}(%s){!}\n", details.NPNProtocols)
} else {
fmtc.Println("No")
}
Expand Down Expand Up @@ -510,7 +510,7 @@ func printProtocolDetailsInfo(details *sslscan.EndpointDetails) {
fmtc.Printf(" %-40s {s}|{!} ", "Strict Transport Security (HSTS)")

if details.HSTSPolicy != nil && details.HSTSPolicy.Status == sslscan.HSTS_STATUS_PRESENT {
fmtc.Printf("{g}Yes{!} {s}(%s){!}\n", details.HSTSPolicy.Header)
fmtc.Printf("{g}Yes{!} {s-}(%s){!}\n", details.HSTSPolicy.Header)

if len(details.HSTSPreloads) != 0 {
fmtc.Printf(" %-40s {s}|{!} ", "HSTS Preloading")
Expand All @@ -535,18 +535,18 @@ func printProtocolDetailsInfo(details *sslscan.EndpointDetails) {

if details.HPKPPolicy.IncludeSubDomains {
fmtc.Printf(
"{s}(max-age=%d; includeSubdomains){!}\n",
"{s-}(max-age=%d; includeSubdomains){!}\n",
details.HPKPPolicy.MaxAge,
)
} else {
fmtc.Printf(
"{s}(max-age=%d){!}\n",
"{s-}(max-age=%d){!}\n",
details.HPKPPolicy.MaxAge,
)
}

for _, pin := range getPinsFromPolicy(details.HPKPPolicy) {
fmtc.Printf(" %-40s {s}|{!} {s}%s{!}\n", "", pin)
fmtc.Printf(" %-40s {s}|{!} {s-}%s{!}\n", "", pin)
}
default:
fmtc.Println("No")
Expand Down Expand Up @@ -580,7 +580,7 @@ func printMiscellaneousInfo(info *sslscan.EndpointInfo) {
testDate := time.Unix(info.Details.HostStartTime/1000, 0)

fmtc.Printf(
" %-24s {s}|{!} %s {s}(%s ago){!}\n", "Test date",
" %-24s {s}|{!} %s {s-}(%s ago){!}\n", "Test date",
timeutil.Format(testDate, "%Y/%m/%d %H:%M:%S"),
timeutil.PrettyDuration(time.Since(testDate)),
)
Expand Down Expand Up @@ -737,7 +737,7 @@ func getHSTSPreloadingMarkers(preloads []*sslscan.HSTSPreload) string {
if preload.Status == sslscan.HSTS_STATUS_PRESENT {
result = append(result, "{g}"+preload.Source+"{!}")
} else {
result = append(result, "{s}"+preload.Source+"{!}")
result = append(result, "{s-}"+preload.Source+"{!}")
}
}

Expand Down
File renamed without changes.

0 comments on commit 480ae88

Please sign in to comment.