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
00046 struct cvss_entry;
00047
00061 const char* cvss_entry_get_score(const struct cvss_entry * entry);
00068 const char* cvss_entry_get_AV(const struct cvss_entry * entry);
00075 const char* cvss_entry_get_AC(const struct cvss_entry * entry);
00082 const char* cvss_entry_get_authentication(const struct cvss_entry * entry);
00089 const char* cvss_entry_get_imp_confidentiality(const struct cvss_entry * entry);
00096 const char* cvss_entry_get_imp_integrity(const struct cvss_entry * entry);
00103 const char* cvss_entry_get_imp_availability(const struct cvss_entry * entry);
00110 const char* cvss_entry_get_source(const struct cvss_entry * entry);
00117 const char* cvss_entry_get_generated(const struct cvss_entry * entry);
00118
00124 const char * cvss_model_supported(void);
00125
00142 bool cvss_entry_set_score(struct cvss_entry *entry, const char *new_score);
00150 bool cvss_entry_set_AV(struct cvss_entry *entry, const char *new_AV);
00158 bool cvss_entry_set_AC(struct cvss_entry *entry, const char *new_AC);
00166 bool cvss_entry_set_authentication(struct cvss_entry *entry, const char *new_authentication);
00174 bool cvss_entry_set_imp_confidentiality(struct cvss_entry *entry, const char *new_item);
00182 bool cvss_entry_set_imp_integrity(struct cvss_entry *entry, const char *new_item);
00190 bool cvss_entry_set_imp_availability(struct cvss_entry *entry, const char *new_item);
00198 bool cvss_entry_set_source(struct cvss_entry *entry, const char *new_source);
00206 bool cvss_entry_set_generated(struct cvss_entry *entry, const char *new_generated);
00207
00222 struct cvss_entry * cvss_entry_new(void);
00223
00238 void cvss_entry_free(struct cvss_entry * entry);
00239
00242
00243
00244 typedef enum {
00245 AV_LOCAL,
00246 AV_ADJACENT_NETWORK,
00247 AV_NETWORK
00248 } cvss_access_vector_t;
00249
00251
00254 typedef enum {
00255 AC_HIGH,
00256 AC_MEDIUM,
00257 AC_LOW
00258 } cvss_access_complexity_t;
00259
00261
00264 typedef enum {
00265 AU_NONE,
00266 AU_SINGLE_INSTANCE,
00267 AU_MULTIPLE_INSTANCE
00268 } cvss_authentication_t;
00269
00271
00274 typedef enum {
00275 CI_NONE,
00276 CI_PARTIAL,
00277 CI_COMPLETE
00278 } cvss_conf_impact_t;
00279
00281
00284 typedef enum {
00285 II_NONE,
00286 II_PARTIAL,
00287 II_COMPLETE
00288 } cvss_integ_impact_t;
00289
00291
00294 typedef enum {
00295 AI_NONE,
00296 AI_PARTIAL,
00297 AI_COMPLETE
00298 } cvss_avail_impact_t;
00299
00301
00304 typedef enum {
00305 EX_UNPROVEN,
00306 EX_PROOF_OF_CONCEPT,
00307 EX_FUNCTIONAL,
00308 EX_HIGH,
00309 EX_NOT_DEFINED
00310 } cvss_exploitability_t;
00311
00313
00316 typedef enum {
00317 RL_OFFICIAL_FIX,
00318 RL_TEMPORARY_FIX,
00319 RL_WORKAROUND,
00320 RL_UNAVAILABLE,
00321 RL_NOT_DEFINED
00322 } cvss_remediation_level_t;
00323
00325
00329 typedef enum {
00330 RC_UNCONFIRMED,
00331 RC_UNCORROBORATED,
00332 RC_CONFIRMED,
00333 RC_NOT_DEFINED
00334 } cvss_report_confidence_t;
00335
00337
00340 typedef enum {
00341 CD_NONE,
00342 CD_LOW,
00343 CD_LOW_MEDIUM,
00344 CD_MEDIUM_HIGH,
00345 CD_HIGH,
00346 CD_NOT_DEFINED
00347 } cvss_collateral_damage_potential_t;
00348
00350
00354 typedef enum {
00355 TD_NONE,
00356 TD_LOW,
00357 TD_MEDIUM,
00358 TD_HIGH,
00359 TD_NOT_DEFINED
00360 } cvss_target_distribution_t;
00361
00363
00367 typedef enum {
00368 CR_LOW,
00369 CR_MEDIUM,
00370 CR_HIGH,
00371 CR_NOT_DEFINED
00372 } cvss_conf_req_t;
00373
00375
00379 typedef enum {
00380 IR_LOW,
00381 IR_MEDIUM,
00382 IR_HIGH,
00383 IR_NOT_DEFINED
00384 } cvss_integ_req_t;
00385
00387
00391 typedef enum {
00392 AR_LOW,
00393 AR_MEDIUM,
00394 AR_HIGH,
00395 AR_NOT_DEFINED
00396 } cvss_avail_req_t;
00397
00404 int cvss_base_score(cvss_access_vector_t ave, cvss_access_complexity_t ace, cvss_authentication_t aue,
00405 cvss_conf_impact_t cie, cvss_integ_impact_t iie, cvss_avail_impact_t aie,
00406 double *base_score,
00407 double *impact_score,
00408 double *exploitability_score);
00409
00414 int cvss_temp_score(cvss_exploitability_t exe, cvss_remediation_level_t rle,
00415 cvss_report_confidence_t rce, double base_score,
00416 double *temporal_score);
00417
00427 int cvss_env_score(cvss_collateral_damage_potential_t cde, cvss_target_distribution_t tde,
00428 cvss_conf_req_t cre, cvss_integ_req_t ire,
00429 cvss_avail_req_t are, double *enviromental_score,
00430 cvss_access_vector_t ave, cvss_access_complexity_t ace,
00431 cvss_authentication_t aue, cvss_conf_impact_t cie,
00432 cvss_integ_impact_t iie, cvss_avail_impact_t aie,
00433 cvss_exploitability_t exe, cvss_remediation_level_t rle,
00434 cvss_report_confidence_t rce);
00439 int cvss_base_score_struct(const struct cvss_entry * entry,
00440 double *base_score,
00441 double *impact_score,
00442 double *exploitability_score);
00443
00445 #endif