00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _CVSSCALC_H_
00038 #define _CVSSCALC_H_
00039
00040 #include <stdbool.h>
00041
00042 struct cvss_entry;
00043
00044 struct cvss_entry * cvss_entry_new(void);
00045 void cvss_entry_free(struct cvss_entry * entry);
00046
00047 const char* cvss_entry_get_score(const struct cvss_entry * entry);
00048 const char* cvss_entry_get_AV(const struct cvss_entry * entry);
00049 const char* cvss_entry_get_AC(const struct cvss_entry * entry);
00050 const char* cvss_entry_get_authentication(const struct cvss_entry * entry);
00051 const char* cvss_entry_get_imp_confidentiality(const struct cvss_entry * entry);
00052 const char* cvss_entry_get_imp_integrity(const struct cvss_entry * entry);
00053 const char* cvss_entry_get_imp_availability(const struct cvss_entry * entry);
00054 const char* cvss_entry_get_source(const struct cvss_entry * entry);
00055 const char* cvss_entry_get_generated(const struct cvss_entry * entry);
00056
00057 bool cvss_entry_set_score(struct cvss_entry *entry, const char *new_score);
00058 bool cvss_entry_set_AV(struct cvss_entry *entry, const char *new_AV);
00059 bool cvss_entry_set_AC(struct cvss_entry *entry, const char *new_AC);
00060 bool cvss_entry_set_authentication(struct cvss_entry *entry, const char *new_authentication);
00061 bool cvss_entry_set_imp_confidentiality(struct cvss_entry *entry, const char *new_item);
00062 bool cvss_entry_set_imp_integrity(struct cvss_entry *entry, const char *new_item);
00063 bool cvss_entry_set_imp_availability(struct cvss_entry *entry, const char *new_item);
00064 bool cvss_entry_set_source(struct cvss_entry *entry, const char *new_source);
00065 bool cvss_entry_set_generated(struct cvss_entry *entry, const char *new_generated);
00066
00068
00069 typedef enum {
00070 AV_LOCAL,
00071 AV_ADJACENT_NETWORK,
00072 AV_NETWORK
00073 } cvss_access_vector_t;
00074
00076
00079 typedef enum {
00080 AC_HIGH,
00081 AC_MEDIUM,
00082 AC_LOW
00083 } cvss_access_complexity_t;
00084
00086
00089 typedef enum {
00090 AU_NONE,
00091 AU_SINGLE_INSTANCE,
00092 AU_MULTIPLE_INSTANCE
00093 } cvss_authentication_t;
00094
00096
00099 typedef enum {
00100 CI_NONE,
00101 CI_PARTIAL,
00102 CI_COMPLETE
00103 } cvss_conf_impact_t;
00104
00106
00109 typedef enum {
00110 II_NONE,
00111 II_PARTIAL,
00112 II_COMPLETE
00113 } cvss_integ_impact_t;
00114
00116
00119 typedef enum {
00120 AI_NONE,
00121 AI_PARTIAL,
00122 AI_COMPLETE
00123 } cvss_avail_impact_t;
00124
00126
00129 typedef enum {
00130 EX_UNPROVEN,
00131 EX_PROOF_OF_CONCEPT,
00132 EX_FUNCTIONAL,
00133 EX_HIGH,
00134 EX_NOT_DEFINED
00135 } cvss_exploitability_t;
00136
00138
00141 typedef enum {
00142 RL_OFFICIAL_FIX,
00143 RL_TEMPORARY_FIX,
00144 RL_WORKAROUND,
00145 RL_UNAVAILABLE,
00146 RL_NOT_DEFINED
00147 } cvss_remediation_level_t;
00148
00150
00154 typedef enum {
00155 RC_UNCONFIRMED,
00156 RC_UNCORROBORATED,
00157 RC_CONFIRMED,
00158 RC_NOT_DEFINED
00159 } cvss_report_confidence_t;
00160
00162
00165 typedef enum {
00166 CD_NONE,
00167 CD_LOW,
00168 CD_LOW_MEDIUM,
00169 CD_MEDIUM_HIGH,
00170 CD_HIGH,
00171 CD_NOT_DEFINED
00172 } cvss_collateral_damage_potential_t;
00173
00175
00179 typedef enum {
00180 TD_NONE,
00181 TD_LOW,
00182 TD_MEDIUM,
00183 TD_HIGH,
00184 TD_NOT_DEFINED
00185 } cvss_target_distribution_t;
00186
00188
00192 typedef enum {
00193 CR_LOW,
00194 CR_MEDIUM,
00195 CR_HIGH,
00196 CR_NOT_DEFINED
00197 } cvss_conf_req_t;
00198
00200
00204 typedef enum {
00205 IR_LOW,
00206 IR_MEDIUM,
00207 IR_HIGH,
00208 IR_NOT_DEFINED
00209 } cvss_integ_req_t;
00210
00212
00216 typedef enum {
00217 AR_LOW,
00218 AR_MEDIUM,
00219 AR_HIGH,
00220 AR_NOT_DEFINED
00221 } cvss_avail_req_t;
00222
00229 int cvss_base_score(cvss_access_vector_t ave, cvss_access_complexity_t ace, cvss_authentication_t aue,
00230 cvss_conf_impact_t cie, cvss_integ_impact_t iie, cvss_avail_impact_t aie,
00231 double *base_score,
00232 double *impact_score,
00233 double *exploitability_score);
00234
00239 int cvss_temp_score(cvss_exploitability_t exe, cvss_remediation_level_t rle,
00240 cvss_report_confidence_t rce, double base_score,
00241 double *temporal_score);
00242
00252 int cvss_env_score(cvss_collateral_damage_potential_t cde, cvss_target_distribution_t tde,
00253 cvss_conf_req_t cre, cvss_integ_req_t ire,
00254 cvss_avail_req_t are, double *enviromental_score,
00255 cvss_access_vector_t ave, cvss_access_complexity_t ace,
00256 cvss_authentication_t aue, cvss_conf_impact_t cie,
00257 cvss_integ_impact_t iie, cvss_avail_impact_t aie,
00258 cvss_exploitability_t exe, cvss_remediation_level_t rle,
00259 cvss_report_confidence_t rce);
00260
00261 #endif