| 1 | /* |
| 2 | * Copyright 2009--2014 Red Hat Inc., Durham, North Carolina. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | * Authors: |
| 20 | * Lukas Kuklinek <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 24 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 25 | #endif |
| 26 | |
| 27 | #include <string.h> |
| 28 | #include <time.h> |
| 29 | #include <ctype.h> |
| 30 | #include <math.h> |
| 31 | |
| 32 | #include "public/xccdf_benchmark.h"cxx . . $ `<file>/src/XCCDF/public/xccdf_benchmark.h`/ |
| 33 | |
| 34 | #include "elements.h"cxx . . $ `<file>/src/XCCDF/elements.h`/ |
| 35 | #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/ |
| 36 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 37 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 38 | #include "common/xmlns_priv.h"cxx . . $ `<file>/src/common/xmlns_priv.h`/ |
| 39 | #include "source/oscap_source_priv.h"cxx . . $ `<file>/src/source/oscap_source_priv.h`/ |
| 40 | #include "source/public/oscap_source.h"cxx . . $ `<file>/src/source/public/oscap_source.h`/ |
| 41 | |
| 42 | struct xccdf_version_infocxx . . $ xccdf_version_info# { |
| 43 | const char* versioncxx . . $ xccdf_version_info#version.; ///< MAJOR.MINOR, for example "1.1" or "1.2" |
| 44 | const char* namespace_uricxx . . $ xccdf_version_info#namespace_uri.; ///< XML namespace URI of that particular version |
| 45 | const char* cpe_versioncxx . . $ xccdf_version_info#cpe_version.; ///< CPE version used in that particular XCCDF version |
| 46 | }; |
| 47 | |
| 48 | const char* xccdf_version_info_get_versioncxx . . $ xccdf_version_info_get_version(1e170957141ea993).(const struct xccdf_version_infocxx . . $ xccdf_version_info#* v) |
| 49 | { |
| 50 | if (v == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 51 | return "unknown"; |
| 52 | |
| 53 | return v->versioncxx . . $ xccdf_version_info#version.; |
| 54 | } |
| 55 | |
| 56 | const char* xccdf_version_info_get_namespace_uricxx . . $ xccdf_version_info_get_namespace_uri(1e170957141ea993).(const struct xccdf_version_infocxx . . $ xccdf_version_info#* v) |
| 57 | { |
| 58 | if (v == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 59 | return "unknown"; |
| 60 | |
| 61 | return v->namespace_uricxx . . $ xccdf_version_info#namespace_uri.; |
| 62 | } |
| 63 | |
| 64 | const char* xccdf_version_info_get_cpe_versioncxx . . $ xccdf_version_info_get_cpe_version(1e170957141ea993).(const struct xccdf_version_infocxx . . $ xccdf_version_info#* v) |
| 65 | { |
| 66 | if (v == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 67 | return "unknown"; |
| 68 | |
| 69 | return v->cpe_versioncxx . . $ xccdf_version_info#cpe_version.; |
| 70 | } |
| 71 | |
| 72 | /// Map of XCCDF versions and their properties |
| 73 | static const struct xccdf_version_infocxx . . $ xccdf_version_info# XCCDF_VERSION_MAPcxx . . $ XCCDF_VERSION_MAP.[] = { |
| 74 | {"1.2", "http://checklists.nist.gov/xccdf/1.2", "2.3"}, |
| 75 | {"1.1", "http://checklists.nist.gov/xccdf/1.1", "2.0"}, |
| 76 | {"1.1", "http://open-scap.org/page/Xccdf-1.1-tailoring", "2.0"}, |
| 77 | {NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!} |
| 78 | }; |
| 79 | |
| 80 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *xccdf_version_info_findcxx . . $ xccdf_version_info_find(f9f562031eb5b14d).(const char *version) |
| 81 | { |
| 82 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *mapptr; |
| 83 | for (mapptr = XCCDF_VERSION_MAPcxx . . $ XCCDF_VERSION_MAP.; mapptr->versioncxx . . $ xccdf_version_info#version. != 0; ++mapptr) { |
| 84 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->versioncxx . . $ xccdf_version_info#version., version)) |
| 85 | return mapptr; |
| 86 | } |
| 87 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 88 | } |
| 89 | |
| 90 | static const struct xccdf_version_infocxx . . $ xccdf_version_info# *_namespace_get_xccdf_version_infocxx . . $ _namespace_get_xccdf_version_info(f9f562031eb5b14d).(const char *namespace_uri) |
| 91 | { |
| 92 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *mapptr; |
| 93 | for (mapptr = XCCDF_VERSION_MAPcxx . . $ XCCDF_VERSION_MAP.; mapptr->versioncxx . . $ xccdf_version_info#version. != 0; ++mapptr) { |
| 94 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->namespace_uricxx . . $ xccdf_version_info#namespace_uri., namespace_uri)) |
| 95 | return mapptr; |
| 96 | } |
| 97 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 98 | } |
| 99 | |
| 100 | const struct xccdf_version_infocxx . . $ xccdf_version_info#* xccdf_detect_version_parsercxx . . $ xccdf_detect_version_parser(7d21fc833ae00d0a).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 101 | { |
| 102 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *mapptr; |
| 103 | |
| 104 | const char* namespace_uri = (const char*)xmlTextReaderConstNamespaceUricxx . . $ xmlTextReaderConstNamespaceUri(60a5affeeceb06fd).(reader); |
| 105 | if (!namespace_uri) { |
| 106 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 107 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 108 | } |
| 109 | |
| 110 | mapptr = _namespace_get_xccdf_version_infocxx . . $ _namespace_get_xccdf_version_info(f9f562031eb5b14d).(namespace_uri); |
| 111 | if (mapptr == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 112 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "This is not known XCCDF namespace: %s.", namespace_uri); |
| 113 | return mapptr; |
| 114 | } |
| 115 | |
| 116 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_is_supported_namespacecxx . . $ xccdf_is_supported_namespace(8796ad3e3951bb1).(xmlNscxx . . $ xmlNs# *ns) |
| 117 | { |
| 118 | return ns != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && ns->hrefcxx . . $ _xmlNs#href. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && |
| 119 | _namespace_get_xccdf_version_infocxx . . $ _namespace_get_xccdf_version_info(f9f562031eb5b14d).((const char *) ns->hrefcxx . . $ _xmlNs#href.) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 120 | } |
| 121 | |
| 122 | char *xccdf_detect_version_privcxx . . $ xccdf_detect_version_priv(93c99f8009311dd0).(xmlTextReadercxx . . $ xmlTextReader# *reader) |
| 123 | { |
| 124 | while (xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader) == 1 && xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.); |
| 125 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *ver_info = xccdf_detect_version_parsercxx . . $ xccdf_detect_version_parser(7d21fc833ae00d0a).(reader); |
| 126 | if (ver_info == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 127 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 128 | } |
| 129 | return oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(xccdf_version_info_get_versioncxx . . $ xccdf_version_info_get_version(1e170957141ea993).(ver_info)); |
| 130 | } |
| 131 | |
| 132 | int |
| 133 | xccdf_version_cmpcxx . . $ xccdf_version_cmp(90211f1159e0810f).(const struct xccdf_version_infocxx . . $ xccdf_version_info# *actual, const char *desired) |
| 134 | { |
| 135 | /* Since the "unknown" value is strdup-ed during clone, we cannot just use common strcmp. |
| 136 | * We need to handle "unknown" version first. |
| 137 | */ |
| 138 | if (actual == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 139 | return -1; |
| 140 | if (oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(xccdf_version_info_get_versioncxx . . $ xccdf_version_info_get_version(1e170957141ea993).(actual), "unknown")) |
| 141 | return 1; |
| 142 | if (desired == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 143 | return 1; |
| 144 | if (oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(desired, "") || oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(desired, "unknown")) |
| 145 | return -1; |
| 146 | |
| 147 | #ifdef __USE_GNUcxx . . $ `<external>/18206667465210621810/features.h:430:10`! |
| 148 | return strverscmpcxx . . $ strverscmp(5ae29d726ae57f88).(xccdf_version_info_get_versioncxx . . $ xccdf_version_info_get_version(1e170957141ea993).(actual), desired); |
| 149 | #else |
| 150 | return strcmp(xccdf_version_info_get_version(actual), desired); |
| 151 | #endif |
| 152 | } |
| 153 | |
| 154 | struct xccdf_element_speccxx . . $ xccdf_element_spec# { |
| 155 | xccdf_element_tcxx . . $ xccdf_element_t# idcxx . . $ xccdf_element_spec#id.; ///< element ID |
| 156 | const char *nscxx . . $ xccdf_element_spec#ns.; ///< namespace URI |
| 157 | const char *namecxx . . $ xccdf_element_spec#name.; ///< element name |
| 158 | }; |
| 159 | |
| 160 | #define XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`! "http://checklists.nist.gov/xccdf" |
| 161 | #define XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`! "http://open-scap.org/page/Xccdf-1.1-tailoring" |
| 162 | |
| 163 | /// Mapping of the element names to the symbolic constants |
| 164 | static const struct xccdf_element_speccxx . . $ xccdf_element_spec# XCCDF_ELEMENT_MAPcxx . . $ XCCDF_ELEMENT_MAP.[] = { |
| 165 | {XCCDFE_BENCHMARKcxx . . $ XCCDFE_BENCHMARK., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "Benchmark"}, |
| 166 | {XCCDFE_GROUPcxx . . $ XCCDFE_GROUP., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "Group"}, |
| 167 | {XCCDFE_RULEcxx . . $ XCCDFE_RULE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "Rule"}, |
| 168 | {XCCDFE_VALUEcxx . . $ XCCDFE_VALUE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "Value"}, |
| 169 | {XCCDFE_PROFILEcxx . . $ XCCDFE_PROFILE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "Profile"}, |
| 170 | {XCCDFE_TESTRESULTcxx . . $ XCCDFE_TESTRESULT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "TestResult"}, |
| 171 | {XCCDFE_RESULT_BENCHMARKcxx . . $ XCCDFE_RESULT_BENCHMARK., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!, "benchmark"}, ///< this is also XCCDFE_BENCHMARK_REF |
| 172 | {XCCDFE_CHECKcxx . . $ XCCDFE_CHECK., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "check"}, |
| 173 | {XCCDFE_CHECK_IMPORTcxx . . $ XCCDFE_CHECK_IMPORT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "check-import"}, |
| 174 | {XCCDFE_CHECK_EXPORTcxx . . $ XCCDFE_CHECK_EXPORT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "check-export"}, |
| 175 | {XCCDFE_CHECK_CONTENTcxx . . $ XCCDFE_CHECK_CONTENT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "check-content"}, |
| 176 | {XCCDFE_CHECK_CONTENT_REFcxx . . $ XCCDFE_CHECK_CONTENT_REF., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "check-content-ref"}, |
| 177 | {XCCDFE_CHOICEScxx . . $ XCCDFE_CHOICES., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "choices"}, |
| 178 | {XCCDFE_CHOICEcxx . . $ XCCDFE_CHOICE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "choice"}, |
| 179 | {XCCDFE_COMPLEX_CHECKcxx . . $ XCCDFE_COMPLEX_CHECK., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "complex-check"}, |
| 180 | {XCCDFE_CONFLICTScxx . . $ XCCDFE_CONFLICTS., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "conflicts"}, |
| 181 | {XCCDFE_CPE_LISTcxx . . $ XCCDFE_CPE_LIST., XMLNS_CPE1Dcxx . . $ `src/common/xmlns_priv.h:32:9`!, "cpe-list"}, |
| 182 | {XCCDFE_DC_STATUScxx . . $ XCCDFE_DC_STATUS., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "dc-status"}, |
| 183 | {XCCDFE_DEFAULTcxx . . $ XCCDFE_DEFAULT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "default"}, |
| 184 | {XCCDFE_DESCRIPTIONcxx . . $ XCCDFE_DESCRIPTION., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "description"}, |
| 185 | {XCCDFE_FACTcxx . . $ XCCDFE_FACT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "fact"}, |
| 186 | {XCCDFE_FIXcxx . . $ XCCDFE_FIX., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "fix"}, |
| 187 | {XCCDFE_FIXTEXTcxx . . $ XCCDFE_FIXTEXT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "fixtext"}, |
| 188 | {XCCDFE_FRONT_MATTERcxx . . $ XCCDFE_FRONT_MATTER., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "front-matter"}, |
| 189 | {XCCDFE_IDENTcxx . . $ XCCDFE_IDENT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "ident"}, |
| 190 | {XCCDFE_IDENTITYcxx . . $ XCCDFE_IDENTITY., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "identity"}, |
| 191 | {XCCDFE_IMPACT_METRICcxx . . $ XCCDFE_IMPACT_METRIC., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "impact-metric"}, |
| 192 | {XCCDFE_INSTANCEcxx . . $ XCCDFE_INSTANCE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "instance"}, |
| 193 | {XCCDFE_LOWER_BOUNDcxx . . $ XCCDFE_LOWER_BOUND., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "lower-bound"}, |
| 194 | {XCCDFE_MATCHcxx . . $ XCCDFE_MATCH., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "match"}, |
| 195 | {XCCDFE_MESSAGEcxx . . $ XCCDFE_MESSAGE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "message"}, |
| 196 | {XCCDFE_METADATAcxx . . $ XCCDFE_METADATA., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "metadata"}, |
| 197 | {XCCDFE_MODELcxx . . $ XCCDFE_MODEL., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "model"}, |
| 198 | {XCCDFE_NEW_RESULTcxx . . $ XCCDFE_NEW_RESULT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "new-result"}, |
| 199 | {XCCDFE_NOTICEcxx . . $ XCCDFE_NOTICE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "notice"}, |
| 200 | {XCCDFE_OLD_RESULTcxx . . $ XCCDFE_OLD_RESULT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "old-result"}, |
| 201 | {XCCDFE_ORGANIZATIONcxx . . $ XCCDFE_ORGANIZATION., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "organization"}, |
| 202 | {XCCDFE_OVERRIDEcxx . . $ XCCDFE_OVERRIDE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "override"}, |
| 203 | {XCCDFE_PARAMcxx . . $ XCCDFE_PARAM., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "param"}, |
| 204 | {XCCDFE_PLAIN_TEXTcxx . . $ XCCDFE_PLAIN_TEXT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "plain-text"}, |
| 205 | {XCCDFE_PLATFORMcxx . . $ XCCDFE_PLATFORM., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "platform"}, |
| 206 | {XCCDFE_CPE2_PLATFORMSPECcxx . . $ XCCDFE_CPE2_PLATFORMSPEC., XMLNS_CPE2Lcxx . . $ `src/common/xmlns_priv.h:30:9`!, "platform-specification"}, |
| 207 | {XCCDFE_RESULT_PROFILEcxx . . $ XCCDFE_RESULT_PROFILE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "profile"}, |
| 208 | {XCCDFE_PROFILE_NOTEcxx . . $ XCCDFE_PROFILE_NOTE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "profile-note"}, |
| 209 | {XCCDFE_QUESTIONcxx . . $ XCCDFE_QUESTION., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "question"}, |
| 210 | {XCCDFE_RATIONALEcxx . . $ XCCDFE_RATIONALE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "rationale"}, |
| 211 | {XCCDFE_REAR_MATTERcxx . . $ XCCDFE_REAR_MATTER., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "rear-matter"}, |
| 212 | {XCCDFE_REFERENCEcxx . . $ XCCDFE_REFERENCE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "reference"}, |
| 213 | {XCCDFE_REFINE_RULEcxx . . $ XCCDFE_REFINE_RULE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "refine-rule"}, |
| 214 | {XCCDFE_REFINE_VALUEcxx . . $ XCCDFE_REFINE_VALUE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "refine-value"}, |
| 215 | {XCCDFE_REMARKcxx . . $ XCCDFE_REMARK., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "remark"}, |
| 216 | {XCCDFE_REQUIREScxx . . $ XCCDFE_REQUIRES., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "requires"}, |
| 217 | {XCCDFE_RESULTcxx . . $ XCCDFE_RESULT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "result"}, |
| 218 | {XCCDFE_RULE_RESULTcxx . . $ XCCDFE_RULE_RESULT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "rule-result"}, |
| 219 | {XCCDFE_SCOREcxx . . $ XCCDFE_SCORE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "score"}, |
| 220 | {XCCDFE_SELECTcxx . . $ XCCDFE_SELECT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "select"}, |
| 221 | {XCCDFE_SET_VALUEcxx . . $ XCCDFE_SET_VALUE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "set-value"}, |
| 222 | {XCCDFE_SIGNATUREcxx . . $ XCCDFE_SIGNATURE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "signature"}, |
| 223 | {XCCDFE_SOURCEcxx . . $ XCCDFE_SOURCE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "source"}, |
| 224 | {XCCDFE_STATUScxx . . $ XCCDFE_STATUS., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "status"}, |
| 225 | {XCCDFE_SUBcxx . . $ XCCDFE_SUB., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "sub"}, |
| 226 | {XCCDFE_TAILORINGcxx . . $ XCCDFE_TAILORING., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!, "Tailoring"}, |
| 227 | {XCCDFE_TARGETcxx . . $ XCCDFE_TARGET., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "target"}, |
| 228 | {XCCDFE_TARGET_ADDRESScxx . . $ XCCDFE_TARGET_ADDRESS., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "target-address"}, |
| 229 | {XCCDFE_TARGET_FACTScxx . . $ XCCDFE_TARGET_FACTS., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "target-facts"}, |
| 230 | {XCCDFE_TARGET_IDENTIFIERcxx . . $ XCCDFE_TARGET_IDENTIFIER., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "target-id-ref"}, |
| 231 | {XCCDFE_TITLEcxx . . $ XCCDFE_TITLE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "title"}, |
| 232 | {XCCDFE_UPPER_BOUNDcxx . . $ XCCDFE_UPPER_BOUND., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "upper-bound"}, |
| 233 | {XCCDFE_VALUE_VALcxx . . $ XCCDFE_VALUE_VAL., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "value"}, |
| 234 | {XCCDFE_VERSIONcxx . . $ XCCDFE_VERSION., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!, "version"}, |
| 235 | {XCCDFE_WARNINGcxx . . $ XCCDFE_WARNING., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "warning"}, |
| 236 | {0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!} |
| 237 | }; |
| 238 | |
| 239 | const char *xccdf_element_to_strcxx . . $ xccdf_element_to_str(d5bbaadd2048c040).(xccdf_element_tcxx . . $ xccdf_element_t# element) |
| 240 | { |
| 241 | for (const struct xccdf_element_speccxx . . $ xccdf_element_spec# *mapptr = XCCDF_ELEMENT_MAPcxx . . $ XCCDF_ELEMENT_MAP.; mapptr->idcxx . . $ xccdf_element_spec#id. != 0; ++mapptr) { |
| 242 | if (element == mapptr->idcxx . . $ xccdf_element_spec#id.) { |
| 243 | return mapptr->namecxx . . $ xccdf_element_spec#name.; |
| 244 | } |
| 245 | } |
| 246 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 247 | } |
| 248 | |
| 249 | xccdf_element_tcxx . . $ xccdf_element_t# xccdf_element_getcxx . . $ xccdf_element_get(a5dd71d24d1f6f1).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 250 | { |
| 251 | if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.) |
| 252 | return XCCDFE_ERRORcxx . . $ XCCDFE_ERROR.; |
| 253 | |
| 254 | const struct xccdf_element_speccxx . . $ xccdf_element_spec# *mapptr; |
| 255 | const char *name = (const char *)xmlTextReaderConstLocalNamecxx . . $ xmlTextReaderConstLocalName(60a5affeeceb06fd).(reader); |
| 256 | const char *nsuri = (const char *)xmlTextReaderConstNamespaceUricxx . . $ xmlTextReaderConstNamespaceUri(60a5affeeceb06fd).(reader); |
| 257 | |
| 258 | for (mapptr = XCCDF_ELEMENT_MAPcxx . . $ XCCDF_ELEMENT_MAP.; mapptr->idcxx . . $ xccdf_element_spec#id. != 0; ++mapptr) { |
| 259 | if (name && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->namecxx . . $ xccdf_element_spec#name., name) == 0) { |
| 260 | // element name exists and matches |
| 261 | |
| 262 | if (!nsuri && !mapptr->nscxx . . $ xccdf_element_spec#ns.) |
| 263 | // no namespace for the element and no namespace defined in the table |
| 264 | return mapptr->idcxx . . $ xccdf_element_spec#id.; |
| 265 | |
| 266 | if (nsuri && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->nscxx . . $ xccdf_element_spec#ns., nsuri) == 0) |
| 267 | // namespace exists and matches the table |
| 268 | return mapptr->idcxx . . $ xccdf_element_spec#id.; |
| 269 | |
| 270 | if (nsuri && (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->nscxx . . $ xccdf_element_spec#ns., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!) == 0 || strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->nscxx . . $ xccdf_element_spec#ns., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!) == 0) && |
| 271 | strncmpcxx . . $ strncmp(fd278af2f295fa2e).(XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, nsuri, strlencxx . . $ strlen(751346f8406fd082).(XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!)) == 0) |
| 272 | // Namespace exists and XCCDF version-less namespace prefix matches |
| 273 | // it. This is done to support multiple XCCDF versions. |
| 274 | // |
| 275 | // XSD schema will make sure there is no XCCDF version mixing in |
| 276 | // the document. The only thing we are solving here is making sure |
| 277 | // the element is some kind of an XCCDF element. |
| 278 | return mapptr->idcxx . . $ xccdf_element_spec#id.; |
| 279 | |
| 280 | if (nsuri && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mapptr->nscxx . . $ xccdf_element_spec#ns., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!) == 0 && |
| 281 | strcmpcxx . . $ strcmp(5ae29d726ae57f88).(XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!, nsuri) == 0) |
| 282 | // In case we are supposed to accept XCCDF tailoring extension |
| 283 | return mapptr->idcxx . . $ xccdf_element_spec#id.; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | return XCCDFE_UNMATCHEDcxx . . $ XCCDFE_UNMATCHED.; |
| 288 | } |
| 289 | |
| 290 | struct xccdf_attribute_speccxx . . $ xccdf_attribute_spec# { |
| 291 | xccdf_attribute_tcxx . . $ xccdf_attribute_t# idcxx . . $ xccdf_attribute_spec#id.; ///< element ID |
| 292 | const char *nscxx . . $ xccdf_attribute_spec#ns.; ///< namespace URI |
| 293 | const char *namecxx . . $ xccdf_attribute_spec#name.; ///< element name |
| 294 | }; |
| 295 | |
| 296 | static const struct xccdf_attribute_speccxx . . $ xccdf_attribute_spec# XCCDF_ATTRIBUTE_MAPcxx . . $ XCCDF_ATTRIBUTE_MAP.[] = { |
| 297 | {XCCDFA_ABSTRACTcxx . . $ XCCDFA_ABSTRACT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "abstract"}, |
| 298 | {XCCDFA_AUTHENTICATEDcxx . . $ XCCDFA_AUTHENTICATED., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "authenticated"}, |
| 299 | {XCCDFA_AUTHORITYcxx . . $ XCCDFA_AUTHORITY., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "authority"}, |
| 300 | {XCCDFA_CATEGORYcxx . . $ XCCDFA_CATEGORY., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "category"}, |
| 301 | {XCCDFA_CLUSTER_IDcxx . . $ XCCDFA_CLUSTER_ID., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "cluster-id"}, |
| 302 | {XCCDFA_COMPLEXITYcxx . . $ XCCDFA_COMPLEXITY., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "complexity"}, |
| 303 | {XCCDFA_CONTEXTcxx . . $ XCCDFA_CONTEXT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "context"}, |
| 304 | {XCCDFA_DATEcxx . . $ XCCDFA_DATE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "date"}, |
| 305 | {XCCDFA_DISRUPTIONcxx . . $ XCCDFA_DISRUPTION., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "disruption"}, |
| 306 | {XCCDFA_END_TIMEcxx . . $ XCCDFA_END_TIME., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "end-time"}, |
| 307 | {XCCDFA_EXPORT_NAMEcxx . . $ XCCDFA_EXPORT_NAME., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "export-name"}, |
| 308 | {XCCDFA_EXTENDScxx . . $ XCCDFA_EXTENDS., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "extends"}, |
| 309 | {XCCDFA_FIXREFcxx . . $ XCCDFA_FIXREF., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "fixref"}, |
| 310 | {XCCDFA_HIDDENcxx . . $ XCCDFA_HIDDEN., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "hidden"}, |
| 311 | {XCCDFA_HREFcxx . . $ XCCDFA_HREF., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!, "href"}, |
| 312 | {XCCDFA_IDcxx . . $ XCCDFA_ID., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "id"}, |
| 313 | {XCCDFA_IDREFcxx . . $ XCCDFA_IDREF., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "idref"}, |
| 314 | {XCCDFA_IIDcxx . . $ XCCDFA_IID., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "Id"}, |
| 315 | {XCCDFA_IMPORT_NAMEcxx . . $ XCCDFA_IMPORT_NAME., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "import-name"}, |
| 316 | {XCCDFA_IMPORT_XPATHcxx . . $ XCCDFA_IMPORT_XPATH., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "import-xpath"}, |
| 317 | {XCCDFA_INTERACTIVEcxx . . $ XCCDFA_INTERACTIVE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "interactive"}, |
| 318 | {XCCDFA_INTERFACEHINTcxx . . $ XCCDFA_INTERFACEHINT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "interfaceHint"}, |
| 319 | {XCCDFA_MAXIMUMcxx . . $ XCCDFA_MAXIMUM., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "maximum"}, |
| 320 | {XCCDFA_MULTICHECKcxx . . $ XCCDFA_MULTICHECK., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "multi-check"}, |
| 321 | {XCCDFA_MULTIPLEcxx . . $ XCCDFA_MULTIPLE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "multiple"}, |
| 322 | {XCCDFA_MUSTMATCHcxx . . $ XCCDFA_MUSTMATCH., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "mustMatch"}, |
| 323 | {XCCDFA_NAMEcxx . . $ XCCDFA_NAME., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "name"}, |
| 324 | {XCCDFA_NEGATEcxx . . $ XCCDFA_NEGATE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "negate"}, |
| 325 | {XCCDFA_NOTE_TAGcxx . . $ XCCDFA_NOTE_TAG., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "note-tag"}, |
| 326 | {XCCDFA_OPERATORcxx . . $ XCCDFA_OPERATOR., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "operator"}, |
| 327 | {XCCDFA_OVERRIDEcxx . . $ XCCDFA_OVERRIDE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "override"}, |
| 328 | {XCCDFA_PARENTCONTEXTcxx . . $ XCCDFA_PARENTCONTEXT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "parentContext"}, |
| 329 | {XCCDFA_PLATFORMcxx . . $ XCCDFA_PLATFORM., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "platform"}, |
| 330 | {XCCDFA_PRIVILEDGEDcxx . . $ XCCDFA_PRIVILEDGED., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "priviledged"}, |
| 331 | {XCCDFA_PROHIBITCHANGEScxx . . $ XCCDFA_PROHIBITCHANGES., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "prohibitChanges"}, |
| 332 | {XCCDFA_REBOOTcxx . . $ XCCDFA_REBOOT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "reboot"}, |
| 333 | {XCCDFA_RESOLVEDcxx . . $ XCCDFA_RESOLVED., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "resolved"}, |
| 334 | {XCCDFA_ROLEcxx . . $ XCCDFA_ROLE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "role"}, |
| 335 | {XCCDFA_SELECTEDcxx . . $ XCCDFA_SELECTED., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "selected"}, |
| 336 | {XCCDFA_SELECTORcxx . . $ XCCDFA_SELECTOR., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "selector"}, |
| 337 | {XCCDFA_SEVERITYcxx . . $ XCCDFA_SEVERITY., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "severity"}, |
| 338 | {XCCDFA_START_TIMEcxx . . $ XCCDFA_START_TIME., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "start-time"}, |
| 339 | {XCCDFA_STRATEGYcxx . . $ XCCDFA_STRATEGY., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "strategy"}, |
| 340 | {XCCDFA_STYLEcxx . . $ XCCDFA_STYLE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "style"}, |
| 341 | {XCCDFA_STYLE_HREFcxx . . $ XCCDFA_STYLE_HREF., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "style-href"}, |
| 342 | {XCCDFA_SYSTEMcxx . . $ XCCDFA_SYSTEM., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "system"}, |
| 343 | {XCCDFA_TAGcxx . . $ XCCDFA_TAG., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "tag"}, |
| 344 | {XCCDFA_TEST_SYSTEMcxx . . $ XCCDFA_TEST_SYSTEM., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "test-system"}, |
| 345 | {XCCDFA_TIMEcxx . . $ XCCDFA_TIME., XCCDF_OR_TAILORING_EXTENSION_XMLNScxx . . $ `src/XCCDF/elements.c:161:9`!, "time"}, |
| 346 | {XCCDFA_TYPEcxx . . $ XCCDFA_TYPE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "type"}, |
| 347 | {XCCDFA_UPDATEcxx . . $ XCCDFA_UPDATE., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "update"}, |
| 348 | {XCCDFA_URIcxx . . $ XCCDFA_URI., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "uri"}, |
| 349 | {XCCDFA_VALUE_IDcxx . . $ XCCDFA_VALUE_ID., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "value-id"}, |
| 350 | {XCCDFA_VERSIONcxx . . $ XCCDFA_VERSION., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "version"}, |
| 351 | {XCCDFA_WEIGHTcxx . . $ XCCDFA_WEIGHT., XCCDF_XMLNS_PREFIXcxx . . $ `src/XCCDF/elements.c:160:9`!, "weight"}, |
| 352 | {0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!} |
| 353 | }; |
| 354 | |
| 355 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_attribute_hascxx . . $ xccdf_attribute_has(5c4b5ba7d6a00a2).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr) |
| 356 | { |
| 357 | return xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, attr) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 358 | } |
| 359 | |
| 360 | const char *xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr) |
| 361 | { |
| 362 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! found = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 363 | const struct xccdf_attribute_speccxx . . $ xccdf_attribute_spec# *mapptr = XCCDF_ATTRIBUTE_MAPcxx . . $ XCCDF_ATTRIBUTE_MAP.; |
| 364 | |
| 365 | while (mapptr->idcxx . . $ xccdf_attribute_spec#id.) { |
| 366 | if (attr == mapptr->idcxx . . $ xccdf_attribute_spec#id.) { |
| 367 | found = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 368 | break; |
| 369 | } |
| 370 | ++mapptr; |
| 371 | } |
| 372 | |
| 373 | if (!found) |
| 374 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 375 | |
| 376 | if (xmlTextReaderMoveToAttributecxx . . $ xmlTextReaderMoveToAttribute(2924e7fbde4400b4).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! mapptr->namecxx . . $ xccdf_attribute_spec#name.) != 1) |
| 377 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 378 | // do not check the XML namespace for now... maybe a libxml bug? |
| 379 | // if (strcmp((const char*)xmlTextReaderConstNamespaceUri(reader), BAD_CAST mapptr->ns) != 0) return NULL; |
| 380 | |
| 381 | return (const char *)xmlTextReaderConstValuecxx . . $ xmlTextReaderConstValue(60a5affeeceb06fd).(reader); |
| 382 | } |
| 383 | |
| 384 | char *xccdf_attribute_copycxx . . $ xccdf_attribute_copy(861b5c6f59611beb).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr) |
| 385 | { |
| 386 | const char *ret = xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, attr); |
| 387 | return oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(ret); |
| 388 | } |
| 389 | |
| 390 | |
| 391 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_attribute_get_boolcxx . . $ xccdf_attribute_get_bool(5c4b5ba7d6a00a2).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr) |
| 392 | { |
| 393 | return oscap_string_to_enumcxx . . $ oscap_string_to_enum(851d6ce10579b7d8).(OSCAP_BOOL_MAPcxx . . $ OSCAP_BOOL_MAP., xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, attr)); |
| 394 | } |
| 395 | |
| 396 | float xccdf_attribute_get_floatcxx . . $ xccdf_attribute_get_float(ff0b6e2937c2a058).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr) |
| 397 | { |
| 398 | float res; |
| 399 | if (xccdf_attribute_hascxx . . $ xccdf_attribute_has(5c4b5ba7d6a00a2).(reader, attr) && sscanfcxx . . $ sscanf(5e8a2c12db2ea735).(xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, attr), "%f", &res) == 1) |
| 400 | return res; |
| 401 | else |
| 402 | return NANcxx . . $ `<external>/11263917310783833665/math.h:101:12`!; |
| 403 | } |
| 404 | |
| 405 | |
| 406 | void xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(int depth) |
| 407 | { |
| 408 | while (depth--) |
| 409 | printfcxx . . $ printf(581fddd72a8db8fc).(" "); |
| 410 | } |
| 411 | |
| 412 | void xccdf_print_max_textcxx . . $ xccdf_print_max_text(fd26ed0363f94f2c).(const struct oscap_textcxx . . $ oscap_text# *txt, int max, const char *ellipsis) |
| 413 | { |
| 414 | if (txt == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return; |
| 415 | |
| 416 | printfcxx . . $ printf(581fddd72a8db8fc).("[%c%c%c|%s] ", |
| 417 | oscap_text_get_is_htmlcxx . . $ oscap_text_get_is_html(b63bfab56583660c).(txt) ? 'h' : '-', |
| 418 | oscap_text_get_can_overridecxx . . $ oscap_text_get_can_override(b63bfab56583660c).(txt) ? (oscap_text_get_overridescxx . . $ oscap_text_get_overrides(b63bfab56583660c).(txt) ? 'O' : 'o') : '-', |
| 419 | oscap_text_get_can_substitutecxx . . $ oscap_text_get_can_substitute(b63bfab56583660c).(txt) ? 's' : '-', |
| 420 | oscap_text_get_langcxx . . $ oscap_text_get_lang(ba0993cb6b641422).(txt)); |
| 421 | xccdf_print_maxcxx . . $ xccdf_print_max(1e8c11a11d48e725).(oscap_text_get_textcxx . . $ oscap_text_get_text(ba0993cb6b641422).(txt), max, ellipsis); |
| 422 | } |
| 423 | |
| 424 | void xccdf_print_textlistcxx . . $ xccdf_print_textlist(87adaa5870f6d825).(struct oscap_text_iteratorcxx . . $ oscap_text_iterator# *txt, int depth, int max, const char *ellipsis) |
| 425 | { |
| 426 | if (txt == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return; |
| 427 | |
| 428 | printfcxx . . $ printf(581fddd72a8db8fc).("\n"); |
| 429 | |
| 430 | while (oscap_text_iterator_has_morecxx . . $ oscap_text_iterator_has_more(7616e6c9867966c1).(txt)) { |
| 431 | struct oscap_textcxx . . $ oscap_text# *text = oscap_text_iterator_nextcxx . . $ oscap_text_iterator_next(fef5008d25b58ff).(txt); |
| 432 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 433 | xccdf_print_max_textcxx . . $ xccdf_print_max_text(fd26ed0363f94f2c).(text, max, ellipsis); |
| 434 | printfcxx . . $ printf(581fddd72a8db8fc).("\n"); |
| 435 | } |
| 436 | |
| 437 | oscap_text_iterator_freecxx . . $ oscap_text_iterator_free(f60c6cfdbf1f29d7).(txt); |
| 438 | } |
| 439 | |
| 440 | void xccdf_print_maxcxx . . $ xccdf_print_max(1e8c11a11d48e725).(const char *str, int max, const char *ellipsis) |
| 441 | { |
| 442 | if (str) |
| 443 | while (isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*str)) |
| 444 | ++str; |
| 445 | int len = strlencxx . . $ strlen(751346f8406fd082).("(null)");; |
| 446 | char buf[32]; |
| 447 | if (str) |
| 448 | len = strlencxx . . $ strlen(751346f8406fd082).(str); |
| 449 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%%.%ds", max); |
| 450 | printfcxx . . $ printf(581fddd72a8db8fc).(buf, str); |
| 451 | if (len > max) |
| 452 | printfcxx . . $ printf(581fddd72a8db8fc).("%s", ellipsis); |
| 453 | } |
| 454 | |
| 455 | xmlNscxx . . $ xmlNs# *lookup_xccdf_nscxx . . $ lookup_xccdf_ns(145fb009c13e3a1).(xmlDoccxx . . $ xmlDoc# *doc, xmlNodecxx . . $ xmlNode# *parent, const struct xccdf_version_infocxx . . $ xccdf_version_info# *version_info) |
| 456 | { |
| 457 | assertcxx . . $ `/usr/include/assert.h:50:10`!(parent != NULL); |
| 458 | |
| 459 | xmlNscxx . . $ xmlNs# *ns_xccdf = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, parent, |
| 460 | (const xmlCharcxx . . $ xmlChar# *)xccdf_version_info_get_namespace_uricxx . . $ xccdf_version_info_get_namespace_uri(1e170957141ea993).(version_info)); |
| 461 | if (ns_xccdf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 462 | ns_xccdf = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(parent, |
| 463 | (const xmlCharcxx . . $ xmlChar# *) xccdf_version_info_get_namespace_uricxx . . $ xccdf_version_info_get_namespace_uri(1e170957141ea993).(version_info), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 464 | } |
| 465 | return ns_xccdf; |
| 466 | } |