diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-02-07 19:47:10 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-02-07 19:47:10 -0500 |
commit | 093cc60affd28717f762da672fc6ee8b48d67372 (patch) | |
tree | f2f0e660180e251bb68620410f1ab7b4ecddba90 /cvss/v31vector_test.go | |
parent | f34d8eb8d5de5fe22e13c6dd81b4949c5379522c (diff) | |
download | cvez-093cc60affd28717f762da672fc6ee8b48d67372.tar.bz2 cvez-093cc60affd28717f762da672fc6ee8b48d67372.zip |
cvss/v31vector.go: fix temporal score, add temporal score tests
Diffstat (limited to 'cvss/v31vector_test.go')
-rw-r--r-- | cvss/v31vector_test.go | 102 |
1 files changed, 99 insertions, 3 deletions
diff --git a/cvss/v31vector_test.go b/cvss/v31vector_test.go index 86fb8eb..519b18a 100644 --- a/cvss/v31vector_test.go +++ b/cvss/v31vector_test.go @@ -573,15 +573,111 @@ func TestV31VectorScores(t *testing.T) { }, { name: "initial I:H", val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", - exp: []float64 { 9.8, 9.8, 0.0 }, + exp: []float64 { 9.8, 0.0, 0.0 }, }, { name: "initial A:L", val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", - exp: []float64 { 5.3, 5.3, 0.0 }, + exp: []float64 { 5.3, 0.0, 0.0 }, }, { name: "AV:A", val: "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", - exp: []float64 { 6.3, 6.3, 0.0 }, + exp: []float64 { 6.3, 0.0, 0.0 }, + }, { + name: "AV:L", + val: "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", + exp: []float64 { 5.9, 0.0, 0.0 }, + }, { + name: "AV:P", + val: "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", + exp: []float64 { 4.3, 0.0, 0.0 }, + }, { + name: "AC:H", + val: "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L", + exp: []float64 { 5.6, 0.0, 0.0 }, + }, { + name: "PR:L", + val: "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L", + exp: []float64 { 6.3, 0.0, 0.0 }, + }, { + name: "PR:H", + val: "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L", + exp: []float64 { 4.7, 0.0, 0.0 }, + }, { + name: "UI:R", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L", + exp: []float64 { 6.3, 0.0, 0.0 }, + }, { + name: "S:C", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L", + exp: []float64 { 8.3, 0.0, 0.0 }, + }, { + name: "C:N", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L", + exp: []float64 { 6.5, 0.0, 0.0 }, + }, { + name: "C:H", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L", + exp: []float64 { 8.6, 0.0, 0.0 }, + }, { + name: "I:N", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L", + exp: []float64 { 6.5, 0.0, 0.0 }, + }, { + name: "I:H", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L", + exp: []float64 { 8.6, 0.0, 0.0 }, + }, { + name: "A:N", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N", + exp: []float64 { 6.5, 0.0, 0.0 }, + }, { + name: "A:H", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H", + exp: []float64 { 8.6, 0.0, 0.0 }, + }, { + name: "E:U", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:U", + exp: []float64 { 7.3, 6.7, 0.0 }, + }, { + name: "E:P", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:P", + exp: []float64 { 7.3, 6.9, 0.0 }, + }, { + name: "E:F", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:F", + exp: []float64 { 7.3, 7.1, 0.0 }, + }, { + name: "E:H", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:H", + exp: []float64 { 7.3, 7.3, 0.0 }, + }, { + name: "RL:O", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RL:O", + exp: []float64 { 7.3, 7.0, 0.0 }, + }, { + name: "RL:T", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RL:T", + exp: []float64 { 7.3, 7.1, 0.0 }, + }, { + name: "RL:W", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RL:W", + exp: []float64 { 7.3, 7.1, 0.0 }, + }, { + name: "RL:U", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RL:U", + exp: []float64 { 7.3, 7.3, 0.0 }, + }, { + name: "RC:U", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RC:U", + exp: []float64 { 7.3, 6.8, 0.0 }, + }, { + name: "RC:R", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RC:R", + exp: []float64 { 7.3, 7.1, 0.0 }, + }, { + name: "RC:C", + val: "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/RC:C", + exp: []float64 { 7.3, 7.3, 0.0 }, }} for _, test := range(tests) { |