Blame SOURCES/openscap-1.2.18-stig_viewer_uri.patch

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