From c1982a2eaf4599e1ee7b822373262e8151bfc099 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 7 Feb 2022 11:52:56 -0500 Subject: cvss: add unknown severity --- cvss/severity.go | 1 + cvss/severity_string.go | 5 +++-- cvss/severity_test.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'cvss') diff --git a/cvss/severity.go b/cvss/severity.go index 88df96a..7c836f7 100644 --- a/cvss/severity.go +++ b/cvss/severity.go @@ -13,4 +13,5 @@ const ( Medium // Medium High // High Critical // Critical + Unknown // Unknown ) diff --git a/cvss/severity_string.go b/cvss/severity_string.go index 8155fa2..2f349b1 100644 --- a/cvss/severity_string.go +++ b/cvss/severity_string.go @@ -13,11 +13,12 @@ func _() { _ = x[Medium-2] _ = x[High-3] _ = x[Critical-4] + _ = x[Unknown-5] } -const _Severity_name = "NoneLowMediumHighCritical" +const _Severity_name = "NoneLowMediumHighCriticalUnknown" -var _Severity_index = [...]uint8{0, 4, 7, 13, 17, 25} +var _Severity_index = [...]uint8{0, 4, 7, 13, 17, 25, 32} func (i Severity) String() string { if i >= Severity(len(_Severity_index)-1) { diff --git a/cvss/severity_test.go b/cvss/severity_test.go index 632736d..41fff06 100644 --- a/cvss/severity_test.go +++ b/cvss/severity_test.go @@ -12,6 +12,7 @@ func TestSeverityString(t *testing.T) { { Medium, "Medium" }, { High, "High" }, { Critical, "Critical" }, + { Unknown, "Unknown" }, { Severity(255), "Severity(255)" }, } -- cgit v1.2.3