26 #include <libxml/xmlreader.h> 27 #include <libxml/tree.h> 28 #include <libxml/xpath.h> 29 #include <libxml/parser.h> 30 #include <libxml/xpathInternals.h> 32 #include "../common/list.h" 33 #include "../common/elements.h" 38 #define CVRF_NS BAD_CAST "http://www.icasi.org/CVRF/schema/cvrf/1.1" 39 #define PROD_NS BAD_CAST "http://www.icasi.org/CVRF/schema/prod/1.1" 40 #define VULN_NS BAD_CAST "http://www.icasi.org/CVRF/schema/vuln/1.1" 51 CVRF_DOC_PUBLISHER_UNKNOWN = 0,
52 CVRF_DOC_PUBLISHER_VENDOR,
53 CVRF_DOC_PUBLISHER_DISCOVERER,
54 CVRF_DOC_PUBLISHER_COORDINATOR,
55 CVRF_DOC_PUBLISHER_USER,
56 CVRF_DOC_PUBLISHER_OTHER,
57 } cvrf_doc_publisher_type_t;
80 cvrf_doc_publisher_type_t cvrf_doc_publisher_type_parse(xmlTextReaderPtr reader);
88 cvrf_doc_publisher_type_t cvrf_involvement_party_parse(xmlTextReaderPtr reader);
95 const char *cvrf_doc_publisher_type_get_text(cvrf_doc_publisher_type_t
type);
102 CVRF_DOC_STATUS_UNKNOWN = 0,
103 CVRF_DOC_STATUS_DRAFT,
104 CVRF_DOC_STATUS_INTERIM,
105 CVRF_DOC_STATUS_FINAL,
106 } cvrf_doc_status_type_t;
121 cvrf_doc_status_type_t cvrf_doc_status_type_parse(xmlTextReaderPtr reader);
128 const char *cvrf_doc_status_type_get_text(cvrf_doc_status_type_t
type);
135 CVRF_NOTE_UNKNOWN = 0,
138 CVRF_NOTE_DESCRIPTION,
141 CVRF_NOTE_LEGAL_DISCLAIMER,
158 cvrf_note_type_t cvrf_note_type_parse(xmlTextReaderPtr reader);
165 const char *cvrf_note_type_get_text(cvrf_note_type_t
type);
172 CVRF_REFERENCE_UNKNOWN = 0,
173 CVRF_REFERENCE_EXTERNAL,
175 } cvrf_reference_type_t;
190 cvrf_reference_type_t cvrf_reference_type_parse(xmlTextReaderPtr reader);
197 const char *cvrf_reference_type_get_text(cvrf_reference_type_t
type);
204 CVRF_BRANCH_UNKNOWN = 0,
206 CVRF_BRANCH_PRODUCT_FAMILY,
207 CVRF_BRANCH_PRODUCT_NAME,
208 CVRF_BRANCH_PRODUCT_VERSION,
209 CVRF_BRANCH_PATCH_LEVEL,
210 CVRF_BRANCH_SERVICE_PACK,
211 CVRF_BRANCH_ARCHITECTURE,
212 CVRF_BRANCH_LANGUAGE,
214 CVRF_BRANCH_SPECIFICATION,
215 } cvrf_branch_type_t;
230 cvrf_branch_type_t cvrf_branch_type_parse(xmlTextReaderPtr reader);
237 const char *cvrf_branch_type_get_text(cvrf_branch_type_t
type);
247 CVRF_RELATIONSHIP_UNKNOWN = 0,
248 CVRF_RELATIONSHIP_DEFAULT_COMPONENT,
249 CVRF_RELATIONSHIP_OPTIONAL_COMPONENT,
250 CVRF_RELATIONSHIP_EXTERNAL_COMPONENT,
251 CVRF_RELATIONSHIP_INSTALLED_ON,
252 CVRF_RELATIONSHIP_INSTALLED_WITH,
253 } cvrf_relationship_type_t;
268 cvrf_relationship_type_t cvrf_relationship_type_parse(xmlTextReaderPtr reader);
275 const char *cvrf_relationship_type_get_text(cvrf_relationship_type_t
type);
282 CVRF_INVOLVEMENT_UNKNOWN = 0,
283 CVRF_INVOLVEMENT_OPEN,
284 CVRF_INVOLVEMENT_DISPUTED,
285 CVRF_INVOLVEMENT_IN_PROGRESS,
286 CVRF_INVOLVEMENT_COMPLETED,
287 CVRF_INVOLVEMENT_CONTACT_ATTEMPTED,
288 CVRF_INVOLVEMENT_NOT_CONTACTED,
289 } cvrf_involvement_status_type_t;
304 cvrf_involvement_status_type_t cvrf_involvement_status_type_parse(xmlTextReaderPtr reader);
311 const char *cvrf_involvement_status_type_get_text(cvrf_involvement_status_type_t
type);
320 CVRF_PRODUCT_STATUS_UNKNOWN = 0,
321 CVRF_PRODUCT_STATUS_FIRST_AFFECTED,
322 CVRF_PRODUCT_STATUS_KNOWN_AFFECTED,
323 CVRF_PRODUCT_STATUS_KNOWN_NOT_AFFECTED,
324 CVRF_PRODUCT_STATUS_FIRST_FIXED,
325 CVRF_PRODUCT_STATUS_FIXED,
326 CVRF_PRODUCT_STATUS_RECOMMENDED,
327 CVRF_PRODUCT_STATUS_LAST_AFFECTED,
328 } cvrf_product_status_type_t;
344 cvrf_product_status_type_t cvrf_product_status_type_parse(xmlTextReaderPtr reader);
351 const char *cvrf_product_status_type_get_text(cvrf_product_status_type_t product_status_type);
359 CVRF_THREAT_UNKNOWN = 0,
361 CVRF_THREAT_EXPLOIT_STATUS,
362 CVRF_THREAT_TARGET_SET,
363 } cvrf_threat_type_t;
378 cvrf_threat_type_t cvrf_threat_type_parse(xmlTextReaderPtr reader);
385 const char *cvrf_threat_type_get_text(cvrf_threat_type_t threat_type);
392 CVRF_REMEDIATION_UNKNOWN = 0,
393 CVRF_REMEDIATION_WORKAROUND,
394 CVRF_REMEDIATION_MITIGATION,
395 CVRF_REMEDIATION_VENDOR_FIX,
396 CVRF_REMEDIATION_NONE_AVAILABLE,
397 CVRF_REMEDIATION_WILL_NOT_FIX,
398 } cvrf_remediation_type_t;
413 cvrf_remediation_type_t cvrf_remediation_type_parse(xmlTextReaderPtr reader);
420 const char *cvrf_remediation_type_get_text(cvrf_remediation_type_t remediation_type);
431 CVRF_ITEM_UNKNOWN = 0,
432 CVRF_DOCUMENT_PUBLISHER,
433 CVRF_DOCUMENT_TRACKING,
436 CVRF_DOCUMENT_REFERENCE,
444 CVRF_VULNERABILITY_CWE,
459 const char *cvrf_item_type_get_text(cvrf_item_type_t type);
466 cvrf_item_type_t cvrf_item_type_from_text(
const char *item);
472 bool cvrf_is_valid_item_type(
const char *item);
479 const char *cvrf_item_type_get_container(cvrf_item_type_t type);
487 bool cvrf_item_type_has_container(cvrf_item_type_t type);
506 struct cvrf_score_set *cvrf_score_set_parse(xmlTextReaderPtr reader);
513 struct cvrf_threat *cvrf_threat_parse(xmlTextReaderPtr reader);
555 struct cvrf_group *cvrf_group_parse(xmlTextReaderPtr reader);
569 struct cvrf_branch *cvrf_branch_parse(xmlTextReaderPtr reader);
590 struct cvrf_reference *cvrf_reference_parse(xmlTextReaderPtr reader);
597 struct cvrf_note *cvrf_note_parse(xmlTextReaderPtr reader);
604 struct cvrf_revision *cvrf_revision_parse(xmlTextReaderPtr reader);
626 struct cvrf_document *cvrf_document_parse(xmlTextReaderPtr reader);
633 struct cvrf_model *cvrf_model_parse(xmlTextReaderPtr reader);
650 void cvrf_element_add_container(
struct oscap_list *list, cvrf_item_type_t cvrf_type, xmlNode *parent);
659 void cvrf_element_add_stringlist(
struct oscap_stringlist *list,
const char *tag_name, xmlNode *parent);
668 void cvrf_element_add_attribute(
const char *attr_name,
const char *attr_value, xmlNode *element);
677 void cvrf_element_add_child(
const char *elm_name,
const char *elm_value, xmlNode *parent);
685 xmlNode *cvrf_element_to_dom(
const char *elm_name,
const char *elm_value);
849 xmlNode *cvrf_model_to_dom(
struct cvrf_model *model, xmlDocPtr doc, xmlNode *parent,
void *user_args);
858 xmlNode *cvrf_index_to_dom(
struct cvrf_index *index, xmlDocPtr doc, xmlNode *parent,
void *user_args);
860 bool cvrf_product_vulnerability_fixed(
struct cvrf_vulnerability *vuln,
const char *product);
Definition: cvrf_priv.c:361
xmlNode * cvrf_doc_publisher_to_dom(struct cvrf_doc_publisher *publisher)
Parent: CVRF Model root node.
Definition: cvrf_priv.c:2227
xmlNode * cvrf_threat_to_dom(const struct cvrf_threat *threat)
Parent: Threats container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1712
cvrf_branch_type_t cvrf_branch_get_branch_type(struct cvrf_branch *branch)
Definition: cvrf_priv.c:695
xmlNode * cvrf_vulnerability_cwe_to_dom(const struct cvrf_vulnerability_cwe *vuln_cwe)
Parent: Vulnerability element.
Definition: cvrf_priv.c:1785
cvrf_product_status_type_t cvrf_product_status_get_type(struct cvrf_product_status *stat)
Definition: cvrf_priv.c:282
Interface to Common Vulnerability Reporting Framework.
A collection of strings.
Definition: oscap_text.h:60
xmlNode * cvrf_group_to_dom(const struct cvrf_group *group)
Parent: CVRF ProductGroups container.
Definition: cvrf_priv.c:1908
Definition: cvrf_priv.c:1235
Definition: cvrf_enumeration.c:241
Definition: cvrf_priv.c:553
Definition: cvrf_priv.c:315
Definition: cvrf_priv.c:633
Definition: cvrf_priv.c:132
Definition: cvrf_priv.c:398
xmlNode * cvrf_product_tree_to_dom(struct cvrf_product_tree *tree)
Parent: CVRF Model root node.
Definition: cvrf_priv.c:2011
xmlNode * cvrf_document_to_dom(struct cvrf_document *document)
Creates a list of xmlNode siblings of all document elements, all of which will be added as a child li...
Definition: cvrf_priv.c:2265
xmlNode * cvrf_product_status_to_dom(const struct cvrf_product_status *stat)
Parent: ProductStatuses container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1743
Definition: cvrf_priv.c:682
xmlNode * cvrf_branch_to_dom(struct cvrf_branch *branch)
Parent: CVRF ProductTree element or another Branch element.
Definition: cvrf_priv.c:1965
cvrf_doc_publisher_type_t cvrf_involvement_get_party(struct cvrf_involvement *involve)
Definition: cvrf_priv.c:326
Definition: cvrf_priv.c:1309
cvrf_reference_type_t cvrf_reference_get_reference_type(struct cvrf_reference *reference)
Definition: cvrf_priv.c:1123
Definition: cvrf_priv.c:589
Definition: cvrf_priv.c:1115
xmlNode * cvrf_product_name_to_dom(struct cvrf_product_name *full_name)
Parent: CVRF ProductTree, Branch, Relationship, or Group element.
Definition: cvrf_priv.c:1878
Definition: cvrf_priv.c:838
Definition: cvrf_priv.c:1065
xmlNode * cvrf_doc_tracking_to_dom(struct cvrf_doc_tracking *tracking)
Parent: CVRF Model root node.
Definition: cvrf_priv.c:2190
Definition: oscap_source.c:65
xmlNode * cvrf_involvement_to_dom(const struct cvrf_involvement *involve)
Parent: Involvements container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1766
Definition: cvrf_priv.c:946
xmlNode * cvrf_note_to_dom(struct cvrf_note *note)
Parent: Notes or DocumentNotes container (of root node or Vulnerability node, respectively) ...
Definition: cvrf_priv.c:2102
xmlNode * cvrf_score_set_to_dom(const struct cvrf_score_set *score_set)
Parent: CVSSScoreSets container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1673
cvrf_relationship_type_t cvrf_relationship_get_relation_type(struct cvrf_relationship *relation)
Definition: cvrf_priv.c:643
xmlNode * cvrf_reference_to_dom(struct cvrf_reference *ref)
Parent: References or DocumentReferences container.
Definition: cvrf_priv.c:2075
xmlNode * cvrf_vulnerability_to_dom(const struct cvrf_vulnerability *vuln)
Parent: CVRF Model root node.
Definition: cvrf_priv.c:1843
cvrf_involvement_status_type_t cvrf_involvement_get_status_type(struct cvrf_involvement *involve)
Definition: cvrf_priv.c:322
Definition: cvrf_priv.c:750
Definition: cvrf_priv.c:893
Definition: cvrf_priv.c:987
Definition: cvrf_priv.c:1159
xmlNode * cvrf_acknowledgment_to_dom(struct cvrf_acknowledgment *ack)
Parent: Acknowledgements container.
Definition: cvrf_priv.c:2045
cvrf_doc_publisher_type_t cvrf_doc_publisher_get_type(struct cvrf_doc_publisher *publisher)
Definition: cvrf_priv.c:1075
Definition: cvrf_priv.c:274
oscap_source_type_t type
Internal type of the oscap_source.
Definition: oscap_source.c:68
xmlNode * cvrf_relationship_to_dom(const struct cvrf_relationship *relation)
Parent: CVRF ProductTree element.
Definition: cvrf_priv.c:1930
cvrf_doc_status_type_t cvrf_doc_tracking_get_status(struct cvrf_doc_tracking *tracking)
Definition: cvrf_priv.c:1008
cvrf_threat_type_t cvrf_threat_get_threat_type(struct cvrf_threat *threat)
Definition: cvrf_priv.c:225
xmlNode * cvrf_revision_to_dom(struct cvrf_revision *revision)
Parent: RevisionHistory container in CVRF DocumentTracking element.
Definition: cvrf_priv.c:2133
cvrf_note_type_t cvrf_note_get_note_type(const struct cvrf_note *note)
Definition: cvrf_priv.c:905
Definition: cvrf_priv.c:215