diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-01-31 18:57:26 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-01-31 18:57:26 -0500 |
commit | fb9b138f5c75e040d4421ef71b0990c01f889939 (patch) | |
tree | 5cf58de7b0589a1a850a30943ce2b2a61f01df13 /internal/cvss | |
parent | e24e4810ac1138418a9636ee94e9473df8876063 (diff) | |
download | cvez-fb9b138f5c75e040d4421ef71b0990c01f889939.tar.bz2 cvez-fb9b138f5c75e040d4421ef71b0990c01f889939.zip |
internal/cvss: disable badKey (unused)
Diffstat (limited to 'internal/cvss')
-rw-r--r-- | internal/cvss/badkey.go | 35 | ||||
-rw-r--r-- | internal/cvss/v2key.go | 36 | ||||
-rw-r--r-- | internal/cvss/v3key.go | 52 |
3 files changed, 62 insertions, 61 deletions
diff --git a/internal/cvss/badkey.go b/internal/cvss/badkey.go index 5078074..d4bc845 100644 --- a/internal/cvss/badkey.go +++ b/internal/cvss/badkey.go @@ -1,19 +1,20 @@ package cvss -import "fmt" - -// Bad metric key error. -type badKey struct { - version Version - key string -} - -// Create new bad key error. -func newBadKey(version Version, key string) error { - return &badKey { version, key } -} - -// Return printable error string -func (e badKey) Error() string { - return fmt.Sprintf("invalid CVSS %s metric key: %s", e.version, e.key) -} +// disabled for now (unused) +// import "fmt" +// +// // Bad metric key error. +// type badKey struct { +// version Version +// key string +// } +// +// // Create new bad key error. +// func newBadKey(version Version, key string) error { +// return &badKey { version, key } +// } +// +// // Return printable error string +// func (e badKey) Error() string { +// return fmt.Sprintf("invalid CVSS %s metric key: %s", e.version, e.key) +// } diff --git a/internal/cvss/v2key.go b/internal/cvss/v2key.go index e3d6aa2..26ee200 100644 --- a/internal/cvss/v2key.go +++ b/internal/cvss/v2key.go @@ -45,24 +45,24 @@ var v2Keys = map[v2Key]struct { v2AvailabilityRequirement: { "Availability Requirement", Environmental }, } -// v2 metric key IDs lut -var v2KeyIds = map[string]v2Key { - "AV": v2AccessVector, - "AC": v2AccessComplexity, - "Au": v2Authentication, - "C": v2ConfidentialityImpact, - "I": v2IntegrityImpact, - "A": v2AvailabilityImpact, - "E": v2Exploitability, - "RL": v2RemediationLevel, - "RC": v2ReportConfidence, - "CDP": v2CollateralDamagePotential, - "TD": v2TargetDistribution, - "CR": v2ConfidentialityRequirement, - "IR": v2IntegrityRequirement, - "AR": v2AvailabilityRequirement, -} - +// // v2 metric key IDs lut +// var v2KeyIds = map[string]v2Key { +// "AV": v2AccessVector, +// "AC": v2AccessComplexity, +// "Au": v2Authentication, +// "C": v2ConfidentialityImpact, +// "I": v2IntegrityImpact, +// "A": v2AvailabilityImpact, +// "E": v2Exploitability, +// "RL": v2RemediationLevel, +// "RC": v2ReportConfidence, +// "CDP": v2CollateralDamagePotential, +// "TD": v2TargetDistribution, +// "CR": v2ConfidentialityRequirement, +// "IR": v2IntegrityRequirement, +// "AR": v2AvailabilityRequirement, +// } +// // // Get metric key from string. // func getV2KeyFromString(s string) (v2Key, error) { // k, ok := v2KeyIds[s] diff --git a/internal/cvss/v3key.go b/internal/cvss/v3key.go index d54a086..f1f32cd 100644 --- a/internal/cvss/v3key.go +++ b/internal/cvss/v3key.go @@ -61,32 +61,32 @@ var v3Keys = map[v3Key]struct { v3ModifiedAvailability: { "Modified Availability", Environmental }, } -// metric key IDs lut -var v3KeyIds = map[string]v3Key { - "AV": v3AttackVector, - "AC": v3AttackComplexity, - "PR": v3PrivilegesRequired, - "UI": v3UserInteraction, - "S": v3Scope, - "C": v3Confidentiality, - "I": v3Integrity, - "A": v3Availability, - "E": v3ExploitCodeMaturity, - "RL": v3RemediationLevel, - "RC": v3ReportConfidence, - "CR": v3ConfidentialityRequirement, - "IR": v3IntegrityRequirement, - "AR": v3AvailabilityRequirement, - "MAV": v3ModifiedAttackVector, - "MAC": v3ModifiedAttackComplexity, - "MPR": v3ModifiedPrivilegesRequired, - "MUI": v3ModifiedUserInteraction, - "MS": v3ModifiedScope, - "MC": v3ModifiedConfidentiality, - "MI": v3ModifiedIntegrity, - "MA": v3ModifiedAvailability, -} - +// // metric key IDs lut +// var v3KeyIds = map[string]v3Key { +// "AV": v3AttackVector, +// "AC": v3AttackComplexity, +// "PR": v3PrivilegesRequired, +// "UI": v3UserInteraction, +// "S": v3Scope, +// "C": v3Confidentiality, +// "I": v3Integrity, +// "A": v3Availability, +// "E": v3ExploitCodeMaturity, +// "RL": v3RemediationLevel, +// "RC": v3ReportConfidence, +// "CR": v3ConfidentialityRequirement, +// "IR": v3IntegrityRequirement, +// "AR": v3AvailabilityRequirement, +// "MAV": v3ModifiedAttackVector, +// "MAC": v3ModifiedAttackComplexity, +// "MPR": v3ModifiedPrivilegesRequired, +// "MUI": v3ModifiedUserInteraction, +// "MS": v3ModifiedScope, +// "MC": v3ModifiedConfidentiality, +// "MI": v3ModifiedIntegrity, +// "MA": v3ModifiedAvailability, +// } +// // // Get metric key from string. // func getV3KeyFromString(s string) (v3Key, error) { // k, ok := v3KeyIds[s] |