aboutsummaryrefslogtreecommitdiff
path: root/cvss
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-07 11:52:56 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-07 11:52:56 -0500
commitc1982a2eaf4599e1ee7b822373262e8151bfc099 (patch)
treeef8af0785099130223ebe309a12e55f218da121c /cvss
parentf2cef211cda0d86ccd42e8aa411f9865a2a22cce (diff)
downloadcvez-c1982a2eaf4599e1ee7b822373262e8151bfc099.tar.bz2
cvez-c1982a2eaf4599e1ee7b822373262e8151bfc099.zip
cvss: add unknown severity
Diffstat (limited to 'cvss')
-rw-r--r--cvss/severity.go1
-rw-r--r--cvss/severity_string.go5
-rw-r--r--cvss/severity_test.go1
3 files changed, 5 insertions, 2 deletions
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)" },
}