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"
39 #define CVRF_NS BAD_CAST "http://www.icasi.org/CVRF/schema/cvrf/1.1"
40 #define PROD_NS BAD_CAST "http://www.icasi.org/CVRF/schema/prod/1.1"
41 #define VULN_NS BAD_CAST "http://www.icasi.org/CVRF/schema/vuln/1.1"
52 CVRF_DOC_PUBLISHER_UNKNOWN = 0,
53 CVRF_DOC_PUBLISHER_VENDOR,
54 CVRF_DOC_PUBLISHER_DISCOVERER,
55 CVRF_DOC_PUBLISHER_COORDINATOR,
56 CVRF_DOC_PUBLISHER_USER,
57 CVRF_DOC_PUBLISHER_OTHER,
58 } cvrf_doc_publisher_type_t;
81 cvrf_doc_publisher_type_t cvrf_doc_publisher_type_parse(xmlTextReaderPtr reader);
89 cvrf_doc_publisher_type_t cvrf_involvement_party_parse(xmlTextReaderPtr reader);
96 const char *cvrf_doc_publisher_type_get_text(cvrf_doc_publisher_type_t
type);
103 CVRF_DOC_STATUS_UNKNOWN = 0,
104 CVRF_DOC_STATUS_DRAFT,
105 CVRF_DOC_STATUS_INTERIM,
106 CVRF_DOC_STATUS_FINAL,
107 } cvrf_doc_status_type_t;
122 cvrf_doc_status_type_t cvrf_doc_status_type_parse(xmlTextReaderPtr reader);
129 const char *cvrf_doc_status_type_get_text(cvrf_doc_status_type_t
type);
136 CVRF_NOTE_UNKNOWN = 0,
139 CVRF_NOTE_DESCRIPTION,
142 CVRF_NOTE_LEGAL_DISCLAIMER,
159 cvrf_note_type_t cvrf_note_type_parse(xmlTextReaderPtr reader);
166 const char *cvrf_note_type_get_text(cvrf_note_type_t
type);
173 CVRF_REFERENCE_UNKNOWN = 0,
174 CVRF_REFERENCE_EXTERNAL,
176 } cvrf_reference_type_t;
191 cvrf_reference_type_t cvrf_reference_type_parse(xmlTextReaderPtr reader);
198 const char *cvrf_reference_type_get_text(cvrf_reference_type_t
type);
205 CVRF_BRANCH_UNKNOWN = 0,
207 CVRF_BRANCH_PRODUCT_FAMILY,
208 CVRF_BRANCH_PRODUCT_NAME,
209 CVRF_BRANCH_PRODUCT_VERSION,
210 CVRF_BRANCH_PATCH_LEVEL,
211 CVRF_BRANCH_SERVICE_PACK,
212 CVRF_BRANCH_ARCHITECTURE,
213 CVRF_BRANCH_LANGUAGE,
215 CVRF_BRANCH_SPECIFICATION,
216 } cvrf_branch_type_t;
231 cvrf_branch_type_t cvrf_branch_type_parse(xmlTextReaderPtr reader);
238 const char *cvrf_branch_type_get_text(cvrf_branch_type_t
type);
248 CVRF_RELATIONSHIP_UNKNOWN = 0,
249 CVRF_RELATIONSHIP_DEFAULT_COMPONENT,
250 CVRF_RELATIONSHIP_OPTIONAL_COMPONENT,
251 CVRF_RELATIONSHIP_EXTERNAL_COMPONENT,
252 CVRF_RELATIONSHIP_INSTALLED_ON,
253 CVRF_RELATIONSHIP_INSTALLED_WITH,
254 } cvrf_relationship_type_t;
269 cvrf_relationship_type_t cvrf_relationship_type_parse(xmlTextReaderPtr reader);
276 const char *cvrf_relationship_type_get_text(cvrf_relationship_type_t
type);
283 CVRF_INVOLVEMENT_UNKNOWN = 0,
284 CVRF_INVOLVEMENT_OPEN,
285 CVRF_INVOLVEMENT_DISPUTED,
286 CVRF_INVOLVEMENT_IN_PROGRESS,
287 CVRF_INVOLVEMENT_COMPLETED,
288 CVRF_INVOLVEMENT_CONTACT_ATTEMPTED,
289 CVRF_INVOLVEMENT_NOT_CONTACTED,
290 } cvrf_involvement_status_type_t;
305 cvrf_involvement_status_type_t cvrf_involvement_status_type_parse(xmlTextReaderPtr reader);
312 const char *cvrf_involvement_status_type_get_text(cvrf_involvement_status_type_t
type);
321 CVRF_PRODUCT_STATUS_UNKNOWN = 0,
322 CVRF_PRODUCT_STATUS_FIRST_AFFECTED,
323 CVRF_PRODUCT_STATUS_KNOWN_AFFECTED,
324 CVRF_PRODUCT_STATUS_KNOWN_NOT_AFFECTED,
325 CVRF_PRODUCT_STATUS_FIRST_FIXED,
326 CVRF_PRODUCT_STATUS_FIXED,
327 CVRF_PRODUCT_STATUS_RECOMMENDED,
328 CVRF_PRODUCT_STATUS_LAST_AFFECTED,
329 } cvrf_product_status_type_t;
345 cvrf_product_status_type_t cvrf_product_status_type_parse(xmlTextReaderPtr reader);
352 const char *cvrf_product_status_type_get_text(cvrf_product_status_type_t product_status_type);
360 CVRF_THREAT_UNKNOWN = 0,
362 CVRF_THREAT_EXPLOIT_STATUS,
363 CVRF_THREAT_TARGET_SET,
364 } cvrf_threat_type_t;
379 cvrf_threat_type_t cvrf_threat_type_parse(xmlTextReaderPtr reader);
386 const char *cvrf_threat_type_get_text(cvrf_threat_type_t threat_type);
393 CVRF_REMEDIATION_UNKNOWN = 0,
394 CVRF_REMEDIATION_WORKAROUND,
395 CVRF_REMEDIATION_MITIGATION,
396 CVRF_REMEDIATION_VENDOR_FIX,
397 CVRF_REMEDIATION_NONE_AVAILABLE,
398 CVRF_REMEDIATION_WILL_NOT_FIX,
399 } cvrf_remediation_type_t;
414 cvrf_remediation_type_t cvrf_remediation_type_parse(xmlTextReaderPtr reader);
421 const char *cvrf_remediation_type_get_text(cvrf_remediation_type_t remediation_type);
432 CVRF_ITEM_UNKNOWN = 0,
433 CVRF_DOCUMENT_PUBLISHER,
434 CVRF_DOCUMENT_TRACKING,
437 CVRF_DOCUMENT_REFERENCE,
445 CVRF_VULNERABILITY_CWE,
460 const char *cvrf_item_type_get_text(cvrf_item_type_t type);
467 cvrf_item_type_t cvrf_item_type_from_text(
const char *item);
473 bool cvrf_is_valid_item_type(
const char *item);
480 const char *cvrf_item_type_get_container(cvrf_item_type_t type);
488 bool cvrf_item_type_has_container(cvrf_item_type_t type);
507 struct cvrf_score_set *cvrf_score_set_parse(xmlTextReaderPtr reader);
514 struct cvrf_threat *cvrf_threat_parse(xmlTextReaderPtr reader);
556 struct cvrf_group *cvrf_group_parse(xmlTextReaderPtr reader);
570 struct cvrf_branch *cvrf_branch_parse(xmlTextReaderPtr reader);
591 struct cvrf_reference *cvrf_reference_parse(xmlTextReaderPtr reader);
598 struct cvrf_note *cvrf_note_parse(xmlTextReaderPtr reader);
605 struct cvrf_revision *cvrf_revision_parse(xmlTextReaderPtr reader);
627 struct cvrf_document *cvrf_document_parse(xmlTextReaderPtr reader);
634 struct cvrf_model *cvrf_model_parse(xmlTextReaderPtr reader);
651 void cvrf_element_add_container(
struct oscap_list *list, cvrf_item_type_t cvrf_type, xmlNode *parent);
660 void cvrf_element_add_stringlist(
struct oscap_stringlist *list,
const char *tag_name, xmlNode *parent);
669 void cvrf_element_add_attribute(
const char *attr_name,
const char *attr_value, xmlNode *element);
678 void cvrf_element_add_child(
const char *elm_name,
const char *elm_value, xmlNode *parent);
686 xmlNode *cvrf_element_to_dom(
const char *elm_name,
const char *elm_value);
850 xmlNode *cvrf_model_to_dom(
struct cvrf_model *model, xmlDocPtr doc, xmlNode *parent,
void *user_args);
859 xmlNode *cvrf_index_to_dom(
struct cvrf_index *index, xmlDocPtr doc, xmlNode *parent,
void *user_args);
861 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:2233
xmlNode * cvrf_threat_to_dom(const struct cvrf_threat *threat)
Parent: Threats container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1714
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:1787
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:59
xmlNode * cvrf_group_to_dom(const struct cvrf_group *group)
Parent: CVRF ProductGroups container.
Definition: cvrf_priv.c:1910
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:2014
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:2271
xmlNode * cvrf_product_status_to_dom(const struct cvrf_product_status *stat)
Parent: ProductStatuses container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1745
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:1967
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:1880
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:2195
Definition: oscap_source.c:62
xmlNode * cvrf_involvement_to_dom(const struct cvrf_involvement *involve)
Parent: Involvements container in a CVRF Vulnerability element.
Definition: cvrf_priv.c:1768
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:2106
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:1675
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:2078
xmlNode * cvrf_vulnerability_to_dom(const struct cvrf_vulnerability *vuln)
Parent: CVRF Model root node.
Definition: cvrf_priv.c:1845
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:2048
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:65
xmlNode * cvrf_relationship_to_dom(const struct cvrf_relationship *relation)
Parent: CVRF ProductTree element.
Definition: cvrf_priv.c:1932
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:2137
cvrf_note_type_t cvrf_note_get_note_type(const struct cvrf_note *note)
Definition: cvrf_priv.c:905
Definition: cvrf_priv.c:215