Debian Codegraph @

src/source/signature.c

raw symbols SCIP
1 /*
2 * Copyright 2021 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 * Author:
20 * Jan Černý <[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 <stdlib.h>
28 #include <string.h>
29 #include <assert.h>
30
31 #include <libxml/tree.h>
32 #include <libxml/xmlmemory.h>
33 #include <libxml/parser.h>
34
35 #include <libxslt/xslt.h>
36 #include <libxslt/security.h>
37
38 #include <xmlsec/xmlsec.h>
39 #include <xmlsec/xmltree.h>
40 #include <xmlsec/xmldsig.h>
41 #include <xmlsec/crypto.h>
42
43 #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/
44 #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/
45 #include "oscap_source.h"cxx . . $ `<file>/src/source/public/oscap_source.h`/
46 #include "oscap_source_priv.h"cxx . . $ `<file>/src/source/oscap_source_priv.h`/
47 #include "signature_priv.h"cxx . . $ `<file>/src/source/signature_priv.h`/
48
49 struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# {
50 const char *pubkey_pemcxx . . $ oscap_signature_ctx#pubkey_pem.; // path to the public key file in PEM format
51 const char *pubkey_cert_pemcxx . . $ oscap_signature_ctx#pubkey_cert_pem.; // path to the public key certificate file in PEM format
52 };
53
54 struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *oscap_signature_ctx_newcxx . . $ oscap_signature_ctx_new(e089c8d275a25cc5).()
55 {
56 struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *ctx = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(struct oscap_signature_ctxcxx . . $ oscap_signature_ctx#));
57 ctx->pubkey_pemcxx . . $ oscap_signature_ctx#pubkey_pem. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
58 ctx->pubkey_cert_pemcxx . . $ oscap_signature_ctx#pubkey_cert_pem. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
59 return ctx;
60 }
61
62 void oscap_signature_ctx_set_pubkey_pemcxx . . $ oscap_signature_ctx_set_pubkey_pem(509379dc2461682b).(struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *ctx, const char *path)
63 {
64 ctx->pubkey_pemcxx . . $ oscap_signature_ctx#pubkey_pem. = path;
65 }
66
67 void oscap_signature_ctx_set_pubkey_cert_pemcxx . . $ oscap_signature_ctx_set_pubkey_cert_pem(509379dc2461682b).(struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *ctx, const char *path)
68 {
69 ctx->pubkey_cert_pemcxx . . $ oscap_signature_ctx#pubkey_cert_pem. = path;
70 }
71
72 void oscap_signature_ctx_freecxx . . $ oscap_signature_ctx_free(62bc863e75211872).(struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *ctx)
73 {
74 freecxx . . $ free(5d22bdacc48458e8).(ctx);
75 }
76
77 static int _mark_sds_id_elementscxx . . $ _mark_sds_id_elements(57df01901802f030).(xmlDocPtrcxx . . $ xmlDocPtr# doc)
78 {
79 /* Adds id attibutes of ds:component and ds:data-stream to the list
80 * of globally known id attributes.
81 */
82 xmlNodePtrcxx . . $ xmlNodePtr# root = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
83 xmlNodePtrcxx . . $ xmlNodePtr# node = root->childrencxx . . $ _xmlNode#children.;
84 for (; node != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; node = node->nextcxx . . $ _xmlNode#next.) {
85 if (node->typecxx . . $ _xmlNode#type. != XML_ELEMENT_NODEcxx . . $ XML_ELEMENT_NODE.)
86 continue;
87 const char *name = (const char *)node->namecxx . . $ _xmlNode#name.;
88 if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "component") && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "data-stream"))
89 continue;
90 xmlAttrPtrcxx . . $ xmlAttrPtr# id_attr = xmlHasPropcxx . . $ xmlHasProp(b74e98cace1a33d3).(node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "id");
91 if (id_attr == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || id_attr->childrencxx . . $ _xmlAttr#children. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
92 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Element \"%s\" doesn't have an id attribute\n", name);
93 return -1;
94 }
95 xmlCharcxx . . $ xmlChar# *id_attr_value = xmlNodeListGetStringcxx . . $ xmlNodeListGetString(a2de33c63125b8c).(node->doccxx . . $ _xmlNode#doc., id_attr->childrencxx . . $ _xmlAttr#children., 1);
96 if (id_attr_value == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
97 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Attribute \"id\" in element \"%s\" has no value\n", name);
98 return -1;
99 }
100 /* check that we don't have same ID already */
101 xmlAttrPtrcxx . . $ xmlAttrPtr# tmp_attr = xmlGetIDcxx . . $ xmlGetID(57d318ff3208c43f).(node->doccxx . . $ _xmlNode#doc., id_attr_value);
102 if (tmp_attr == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
103 xmlAddIDcxx . . $ xmlAddID(afd404778bd5fcb9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, node->doccxx . . $ _xmlNode#doc., id_attr_value, id_attr);
104 } else if (tmp_attr != id_attr) {
105 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Duplicate ID attribute \"%s\"\n", id_attr_value);
106 xmlFreecxx . . $ xmlFree.(id_attr_value);
107 return -1;
108 }
109 xmlFreecxx . . $ xmlFree.(id_attr_value);
110 }
111 return 0;
112 }
113
114 static int _oscap_signature_validate_doccxx . . $ _oscap_signature_validate_doc(c0bc12c6ea6aec17).(xmlDocPtrcxx . . $ xmlDocPtr# doc, oscap_document_type_tcxx . . $ oscap_document_type_t# scap_type, struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *ctx, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! enforce_signature)
115 {
116 int res = -1;
117 xmlNodePtrcxx . . $ xmlNodePtr# node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
118 xmlSecDSigCtxPtrcxx . . $ xmlSecDSigCtxPtr# dsigCtx = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
119 xmlSecKeysMngrPtrcxx . . $ xmlSecKeysMngrPtr# mngr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
120 xsltSecurityPrefsPtrcxx . . $ xsltSecurityPrefsPtr# xsltSecPrefs = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
121
122 dIcxx . . $ `src/common/debug_priv.h:61:9`!("Validating XML signature.");
123
124 /* Init libxslt */
125 /* disable everything */
126 xsltSecPrefs = xsltNewSecurityPrefscxx . . $ xsltNewSecurityPrefs(e951dd18394470b4).();
127 xsltSetSecurityPrefscxx . . $ xsltSetSecurityPrefs(442aae32804e7cf8).(xsltSecPrefs, XSLT_SECPREF_READ_FILEcxx . . $ XSLT_SECPREF_READ_FILE., xsltSecurityForbidcxx . . $ xsltSecurityForbid(ea3d213d4af5adf3).);
128 xsltSetSecurityPrefscxx . . $ xsltSetSecurityPrefs(442aae32804e7cf8).(xsltSecPrefs, XSLT_SECPREF_WRITE_FILEcxx . . $ XSLT_SECPREF_WRITE_FILE., xsltSecurityForbidcxx . . $ xsltSecurityForbid(ea3d213d4af5adf3).);
129 xsltSetSecurityPrefscxx . . $ xsltSetSecurityPrefs(442aae32804e7cf8).(xsltSecPrefs, XSLT_SECPREF_CREATE_DIRECTORYcxx . . $ XSLT_SECPREF_CREATE_DIRECTORY., xsltSecurityForbidcxx . . $ xsltSecurityForbid(ea3d213d4af5adf3).);
130 xsltSetSecurityPrefscxx . . $ xsltSetSecurityPrefs(442aae32804e7cf8).(xsltSecPrefs, XSLT_SECPREF_READ_NETWORKcxx . . $ XSLT_SECPREF_READ_NETWORK., xsltSecurityForbidcxx . . $ xsltSecurityForbid(ea3d213d4af5adf3).);
131 xsltSetSecurityPrefscxx . . $ xsltSetSecurityPrefs(442aae32804e7cf8).(xsltSecPrefs, XSLT_SECPREF_WRITE_NETWORKcxx . . $ XSLT_SECPREF_WRITE_NETWORK., xsltSecurityForbidcxx . . $ xsltSecurityForbid(ea3d213d4af5adf3).);
132 xsltSetDefaultSecurityPrefscxx . . $ xsltSetDefaultSecurityPrefs(4b8e159e9615051f).(xsltSecPrefs);
133
134 /* Init xmlsec library */
135 if (xmlSecInitcxx . . $ xmlSecInit(b126dc7c1de90089).() < 0) {
136 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Xmlsec initialization failed.");
137 return(-1);
138 }
139
140 /* Check loaded library version */
141 if (xmlSecCheckVersioncxx . . $ `<external>/9566695899407814863/xmlsec.h:144:9`!() != 1) {
142 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Loaded xmlsec library version is not compatible.");
143 return(-1);
144 }
145
146 /* Init crypto library */
147 if (xmlSecCryptoAppInitcxx . . $ `<external>/6052529034707299502/symbols.h:208:9`!(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) < 0) {
148 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Crypto initialization failed.");
149 return(-1);
150 }
151
152 /* Init xmlsec-crypto library */
153 if (xmlSecCryptoInitcxx . . $ `<external>/6052529034707299502/symbols.h:27:9`!() < 0) {
154 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Xmlsec-crypto initialization failed.");
155 return(-1);
156 }
157
158 /* find Signature node */
159 xmlNodePtrcxx . . $ xmlNodePtr# root = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
160 node = xmlSecFindNodecxx . . $ xmlSecFindNode(df99c0813e0374a0).(root, xmlSecNodeSignaturecxx . . $ xmlSecNodeSignature., xmlSecDSigNscxx . . $ xmlSecDSigNs.);
161 if (node == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
162 if (enforce_signature) {
163 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Signature not found");
164 goto cleanup;
165 }
166 /* Non-fatal error, datastreams without signatures are accepted */
167 dIcxx . . $ `src/common/debug_priv.h:61:9`!("Signature node not found");
168 res = 0;
169 goto cleanup;
170 }
171
172 /* Adds id attibutes of ds:component and ds:data-stream as general id
173 * attributes
174 */
175 if (scap_type == OSCAP_DOCUMENT_SDScxx . . $ OSCAP_DOCUMENT_SDS. && _mark_sds_id_elementscxx . . $ _mark_sds_id_elements(57df01901802f030).(doc) < 0) {
176 goto cleanup;
177 }
178
179 /* create and initialize keys manager */
180 mngr = xmlSecKeysMngrCreatecxx . . $ xmlSecKeysMngrCreate(845ba5ce4cb7e5af).();
181 if (mngr == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
182 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "failed to create keys manager");
183 goto cleanup;
184 }
185 if (xmlSecCryptoAppDefaultKeysMngrInitcxx . . $ `<external>/6052529034707299502/symbols.h:210:9`!(mngr) < 0) {
186 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "failed to initialize keys manager");
187 goto cleanup;
188 }
189
190 /* create signature context */
191 dsigCtx = xmlSecDSigCtxCreatecxx . . $ xmlSecDSigCtxCreate(df541c2157985fb0).(mngr);
192 if (dsigCtx == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
193 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "failed to create signature context");
194 goto cleanup;
195 }
196
197 /* XMLSec 1.3 API Change: Enable KeyValue reading in the signature context */
198 xmlSecKeyDataIdcxx . . $ xmlSecKeyDataId# kv_data_id = xmlSecKeyDataIdListFindByNamecxx . . $ xmlSecKeyDataIdListFindByName(c658e410530d88bb).(xmlSecKeyDataIdsGetcxx . . $ xmlSecKeyDataIdsGet(3fceb1f819e77a6f).(), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "key-value", xmlSecKeyDataUsageAnycxx . . $ `<external>/11068381510022684017/keysdata.h:116:9`!);
199 xmlSecKeyDataIdcxx . . $ xmlSecKeyDataId# rsa_data_id = xmlSecKeyDataIdListFindByNamecxx . . $ xmlSecKeyDataIdListFindByName(c658e410530d88bb).(xmlSecKeyDataIdsGetcxx . . $ xmlSecKeyDataIdsGet(3fceb1f819e77a6f).(), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "rsa", xmlSecKeyDataUsageAnycxx . . $ `<external>/11068381510022684017/keysdata.h:116:9`!);
200
201 res = xmlSecPtrListAddcxx . . $ xmlSecPtrListAdd(cb3fbabc2ebedca1).(&(dsigCtx->keyInfoReadCtxcxx . . $ _xmlSecDSigCtx#keyInfoReadCtx..enabledKeyDatacxx . . $ _xmlSecKeyInfoCtx#enabledKeyData.), (const xmlSecPtrcxx . . $ xmlSecPtr#)kv_data_id);
202 if (res < 0) {
203 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "failed to enable key data: key-value");
204 goto cleanup;
205 }
206 res = xmlSecPtrListAddcxx . . $ xmlSecPtrListAdd(cb3fbabc2ebedca1).(&(dsigCtx->keyInfoReadCtxcxx . . $ _xmlSecDSigCtx#keyInfoReadCtx..enabledKeyDatacxx . . $ _xmlSecKeyInfoCtx#enabledKeyData.), (const xmlSecPtrcxx . . $ xmlSecPtr#)rsa_data_id);
207 if (res < 0) {
208 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "failed to enable key data: rsa");
209 goto cleanup;
210 }
211
212 /* Verify signature */
213 if (xmlSecDSigCtxVerifycxx . . $ xmlSecDSigCtxVerify(6393e139efebf4bd).(dsigCtx, node) < 0) {
214 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Signature verification failed");
215 goto cleanup;
216 }
217
218 if (dsigCtx->statuscxx . . $ _xmlSecDSigCtx#status. == xmlSecDSigStatusSucceededcxx . . $ xmlSecDSigStatusSucceeded.) {
219 dIcxx . . $ `src/common/debug_priv.h:61:9`!("Signature is OK");
220 res = 0;
221 } else {
222 dIcxx . . $ `src/common/debug_priv.h:61:9`!("Signature is invalid.");
223 res = 1;
224 }
225
226 /* compare good/bad references */
227 int good = 0;
228 xmlSecDSigReferenceCtxPtrcxx . . $ xmlSecDSigReferenceCtxPtr# dsigRefCtx;
229 int size = xmlSecPtrListGetSizecxx . . $ xmlSecPtrListGetSize(9c8a4895e31d1346).(&(dsigCtx->signedInfoReferencescxx . . $ _xmlSecDSigCtx#signedInfoReferences.));
230 for (int i = good = 0; i < size; i++) {
231 dsigRefCtx = (xmlSecDSigReferenceCtxPtrcxx . . $ xmlSecDSigReferenceCtxPtr#)xmlSecPtrListGetItemcxx . . $ xmlSecPtrListGetItem(58c9accf38ae05e).(&(dsigCtx->signedInfoReferencescxx . . $ _xmlSecDSigCtx#signedInfoReferences.), i);
232 if(dsigRefCtx == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
233 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Reference ctx is null");
234 goto cleanup;
235 }
236 if (dsigRefCtx->statuscxx . . $ _xmlSecDSigReferenceCtx#status. == xmlSecDSigStatusSucceededcxx . . $ xmlSecDSigStatusSucceeded.)
237 good++;
238 }
239 dIcxx . . $ `src/common/debug_priv.h:61:9`!("SignedInfo references (ok/all): %d/%d", good, size);
240 if (good != size) {
241 res = 1;
242 }
243
244 /* compare good/bad manifests */
245 size = xmlSecPtrListGetSizecxx . . $ xmlSecPtrListGetSize(9c8a4895e31d1346).(&(dsigCtx->manifestReferencescxx . . $ _xmlSecDSigCtx#manifestReferences.));
246 for (int i = good = 0; i < size; i++) {
247 dsigRefCtx = (xmlSecDSigReferenceCtxPtrcxx . . $ xmlSecDSigReferenceCtxPtr#)xmlSecPtrListGetItemcxx . . $ xmlSecPtrListGetItem(58c9accf38ae05e).(&(dsigCtx->manifestReferencescxx . . $ _xmlSecDSigCtx#manifestReferences.), i);
248 if (dsigRefCtx == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
249 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Reference ctx is null");
250 goto cleanup;
251 }
252 if (dsigRefCtx->statuscxx . . $ _xmlSecDSigReferenceCtx#status. == xmlSecDSigStatusSucceededcxx . . $ xmlSecDSigStatusSucceeded.)
253 good++;
254 }
255 dIcxx . . $ `src/common/debug_priv.h:61:9`!("Manifests references (ok/all): %d/%d", good, size);
256 if (good != size) {
257 res = 1;
258 }
259 if (res == 0) {
260 printfcxx . . $ printf(581fddd72a8db8fc).("XML signature is valid.\n");
261 }
262
263 cleanup:
264 /* cleanup */
265 if (dsigCtx != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
266 xmlSecDSigCtxDestroycxx . . $ xmlSecDSigCtxDestroy(bfd64886f644bd97).(dsigCtx);
267
268 /* destroy keys manager */
269 if (mngr != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
270 xmlSecKeysMngrDestroycxx . . $ xmlSecKeysMngrDestroy(99198593ac23b03b).(mngr);
271
272 /* Shutdown xmlsec-crypto library */
273 xmlSecCryptoShutdowncxx . . $ `<external>/6052529034707299502/symbols.h:28:9`!();
274
275 /* Shutdown crypto library */
276 xmlSecCryptoAppShutdowncxx . . $ `<external>/6052529034707299502/symbols.h:209:9`!();
277
278 /* Shutdown xmlsec library */
279 xmlSecShutdowncxx . . $ xmlSecShutdown(b126dc7c1de90089).();
280
281 /* Shutdown libxslt/libxml */
282 xsltFreeSecurityPrefscxx . . $ xsltFreeSecurityPrefs(4b8e159e9615051f).(xsltSecPrefs);
283
284 /* Unset the default XSLT security settings to prevent
285 * blockage of other oscap XSLT features (generate guide etc.)
286 */
287 xsltSetDefaultSecurityPrefscxx . . $ xsltSetDefaultSecurityPrefs(4b8e159e9615051f).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
288
289 return res;
290 }
291
292 int oscap_signature_validatecxx . . $ oscap_signature_validate(765ad4676bbc989a).(struct oscap_sourcecxx . . $ oscap_source# *source, struct oscap_signature_ctxcxx . . $ oscap_signature_ctx# *ctx, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! enforce_signature)
293 {
294 int ret = 0;
295 oscap_document_type_tcxx . . $ oscap_document_type_t# scap_type = oscap_source_get_scap_typecxx . . $ oscap_source_get_scap_type(1b623b3fe9f5b871).(source);
296 const char *origin = oscap_source_readable_origincxx . . $ oscap_source_readable_origin(1485dc36ee4b63be).(source);
297
298 if (scap_type == OSCAP_DOCUMENT_UNKNOWNcxx . . $ OSCAP_DOCUMENT_UNKNOWN.) {
299 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Unrecognized document type for: %s", origin);
300 ret = -1;
301 } else if (scap_type == OSCAP_DOCUMENT_SDScxx . . $ OSCAP_DOCUMENT_SDS.) {
302 xmlDocPtrcxx . . $ xmlDocPtr# doc = oscap_source_get_xmlDoccxx . . $ oscap_source_get_xmlDoc(51aac4e66711e6e6).(source);
303 ret = _oscap_signature_validate_doccxx . . $ _oscap_signature_validate_doc(c0bc12c6ea6aec17).(doc, scap_type, ctx, enforce_signature);
304 } else {
305 const char *type_name = oscap_document_type_to_stringcxx . . $ oscap_document_type_to_string(1cec73a42285d610).(scap_type);
306 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Unsupported document type %s for XML signature validation: %s", type_name, origin);
307 ret = -1;
308 }
309 return ret;
310 }