Skip to content

Commit 128d4e7

Browse files
committed
UI improvements
1 parent ff1c1eb commit 128d4e7

2 files changed

Lines changed: 13 additions & 42 deletions

File tree

cli/cli.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ func check(host string) (string, bool) {
347347
expiryMessage := getExpiryMessage(ap, maxLeftToExpiry)
348348

349349
if len(info.Endpoints) == 1 {
350-
fmtc.TPrintf("{*}%s{!} "+getColoredGrade(info.Endpoints[0].Grade)+expiryMessage+"\n", host)
350+
fmtc.TPrintf("{*}%s{!} {s-}→{!} "+getColoredGrade(info.Endpoints[0].Grade)+expiryMessage+"\n", host)
351351
} else {
352-
fmtc.TPrintf("{*}%s{!} "+getColoredGrades(info.Endpoints)+expiryMessage+"\n", host)
352+
fmtc.TPrintf("{*}%s{!} {s-}→{!} "+getColoredGrades(info.Endpoints)+expiryMessage+"\n", host)
353353
}
354354

355355
if options.GetB(OPT_DETAILED) {
@@ -491,7 +491,7 @@ func getColoredGrades(endpoints []*sslscan.EndpointInfo) string {
491491
var result string
492492

493493
for _, endpoint := range endpoints {
494-
result += getColoredGrade(endpoint.Grade) + "{s-}/" + endpoint.IPAddress + "{!} "
494+
result += getColoredGrade(endpoint.Grade) + "{s}/" + endpoint.IPAddress + "{!} "
495495
}
496496

497497
return result

cli/details.go

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ func printProtocolInfo(protocol string, supportedProtocols map[string]bool) {
550550
fmtc.Println("{y}No{!}")
551551
}
552552
case protocol == "TLS 1.0", protocol == "TLS 1.1":
553-
fmtc.Printf("{y}%s{!}\n", printBool(supportedProtocols[protocol]))
553+
if supportedProtocols[protocol] {
554+
fmtc.Println("{y}Yes{!}")
555+
} else {
556+
fmtc.Println("No")
557+
}
554558
case protocol == "SSL 3.0" && supportedProtocols[protocol]:
555559
fmtc.Printf("{r}%s (INSECURE){!}\n", printBool(supportedProtocols[protocol]))
556560
case protocol == "SSL 2.0" && supportedProtocols[protocol]:
@@ -1099,28 +1103,16 @@ func printEndpointNamedGroups(namedGroups *sslscan.NamedGroups) {
10991103
return
11001104
}
11011105

1102-
groups := getNamedGroups(namedGroups)
1106+
var groups []string
11031107

1104-
for i := 0; i < len(groups); i++ {
1105-
switch i {
1106-
case 0:
1107-
// skip
1108-
default:
1109-
fmtc.NewLine()
1110-
fmtc.Printf(" %-40s {s}|{!} ", "")
1111-
}
1112-
1113-
fmtc.Printf(strings.Join(groups[i], ", "))
1114-
1115-
if i != len(groups)-1 {
1116-
fmtc.Printf(",")
1117-
}
1108+
for _, group := range namedGroups.List {
1109+
groups = append(groups, group.Name)
11181110
}
11191111

1112+
fmtc.Print(strings.Join(groups, ", "))
1113+
11201114
if namedGroups.Preference {
11211115
fmtc.Printf(" {s-}(server preferred order){!}\n")
1122-
} else {
1123-
fmtc.Printf("\n")
11241116
}
11251117
}
11261118

@@ -1366,27 +1358,6 @@ func getProtocols(protocols []*sslscan.Protocol) map[string]bool {
13661358
return supported
13671359
}
13681360

1369-
// getNamedGroups returns slice of slices with named groups
1370-
func getNamedGroups(groups *sslscan.NamedGroups) [][]string {
1371-
var result [][]string
1372-
var buf []string
1373-
1374-
for _, group := range groups.List {
1375-
buf = append(buf, group.Name)
1376-
1377-
if len(buf) == 3 {
1378-
result = append(result, buf)
1379-
buf = nil
1380-
}
1381-
}
1382-
1383-
if buf != nil {
1384-
result = append(result, buf)
1385-
}
1386-
1387-
return result
1388-
}
1389-
13901361
// getPinsFromPolicy returns slice with all pins in policy
13911362
func getPinsFromPolicy(policy *sslscan.HPKPPolicy) []string {
13921363
var pins []string

0 commit comments

Comments
 (0)