checker: move hasPKIXUsage from report.go to rule.go
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e75c97b52b
commit
655ab5bb26
2 changed files with 11 additions and 11 deletions
|
|
@ -164,17 +164,6 @@ func sevRank(s string) int {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hasPKIXUsage reports whether any TLSA record at this target demands PKIX
|
|
||||||
// validation (usage 0 or 1).
|
|
||||||
func hasPKIXUsage(t TargetResult) bool {
|
|
||||||
for _, r := range t.Records {
|
|
||||||
if r.Usage == UsagePKIXTA || r.Usage == UsagePKIXEE {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// proposedTLSA renders a ready-to-paste replacement RR computed from the
|
// proposedTLSA renders a ready-to-paste replacement RR computed from the
|
||||||
// live chain. The (usage, selector, matching) triplet is taken from the
|
// live chain. The (usage, selector, matching) triplet is taken from the
|
||||||
// user's first existing record so the suggestion stays consistent with
|
// user's first existing record so the suggestion stays consistent with
|
||||||
|
|
|
||||||
|
|
@ -269,6 +269,17 @@ func indexProbes(related []sdk.RelatedObservation) map[string]*tls.TLSProbe {
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hasPKIXUsage reports whether any TLSA record at this target demands PKIX
|
||||||
|
// validation (usage 0 or 1).
|
||||||
|
func hasPKIXUsage(t TargetResult) bool {
|
||||||
|
for _, r := range t.Records {
|
||||||
|
if r.Usage == UsagePKIXTA || r.Usage == UsagePKIXEE {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func truncHex(s string) string {
|
func truncHex(s string) string {
|
||||||
if len(s) > 12 {
|
if len(s) > 12 {
|
||||||
return s[:12] + "…"
|
return s[:12] + "…"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue