checker: move hasPKIXUsage from report.go to rule.go
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2026-05-16 13:07:32 +08:00
commit 655ab5bb26
2 changed files with 11 additions and 11 deletions

View file

@ -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
// live chain. The (usage, selector, matching) triplet is taken from the
// user's first existing record so the suggestion stays consistent with

View file

@ -269,6 +269,17 @@ func indexProbes(related []sdk.RelatedObservation) map[string]*tls.TLSProbe {
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 {
if len(s) > 12 {
return s[:12] + "…"