914530
From 7055435e29e1d30e691611afc78921a60d0f3efa Mon Sep 17 00:00:00 2001
914530
From: Alexander Bergmann <abergmann@suse.com>
914530
Date: Mon, 23 Sep 2019 10:05:03 +0200
914530
Subject: [PATCH] Add new STIG Viewer URI public.cyber.mil and be backward
914530
 compatible in maint-1.2
914530
914530
---
914530
 src/XCCDF/result.c | 6 ++++--
914530
 1 file changed, 4 insertions(+), 2 deletions(-)
914530
914530
diff --git a/src/XCCDF/result.c b/src/XCCDF/result.c
914530
index 74c644d6a..f389813d5 100644
914530
--- a/src/XCCDF/result.c
914530
+++ b/src/XCCDF/result.c
914530
@@ -47,7 +47,8 @@
914530
 #include "source/oscap_source_priv.h"
914530
 
914530
 // References containing STIG Rule IDs can be found by their href attribute, it must match the following url
914530
-static const char *DISA_STIG_VIEWER_HREF = "http://iase.disa.mil/stigs/Pages/stig-viewing-guidance.aspx";
914530
+static const char *DISA_STIG_VIEWER_HREF[] = { "http://iase.disa.mil/stigs/Pages/stig-viewing-guidance.aspx",
914530
+					       "https://public.cyber.mil/stigs/srg-stig-tools/" };
914530
 
914530
 // constants
914530
 static const xccdf_numeric XCCDF_SCORE_MAX_DAFAULT = 100.0f;
914530
@@ -1096,7 +1097,8 @@ xmlNode *xccdf_rule_result_to_dom(struct xccdf_rule_result *result, xmlDoc *doc,
914530
 		struct oscap_reference_iterator *references = xccdf_item_get_references(XRULE(item));
914530
 		while (oscap_reference_iterator_has_more(references)) {
914530
 			struct oscap_reference *ref = oscap_reference_iterator_next(references);
914530
-			if (strcmp(oscap_reference_get_href(ref), DISA_STIG_VIEWER_HREF) == 0) {
914530
+			if (strcmp(oscap_reference_get_href(ref), DISA_STIG_VIEWER_HREF[0]) == 0 ||
914530
+			    strcmp(oscap_reference_get_href(ref), DISA_STIG_VIEWER_HREF[1]) == 0) {
914530
 				stig_rule_id = oscap_reference_get_title(ref);
914530
 				break;
914530
 			}