Debian Codegraph @

src/OVAL/probes/unix/linux/fwupdsecattr_probe.c

raw symbols SCIP
1 /**
2 * @file fwupdsecattr_probe.c
3 * @brief firmware security attribute probe
4 * @author "Kate Hsuan" <[email protected]>
5 *
6 * 2022/11/28 [email protected]
7 * This probe can fetch firmware information from fwupd for testing and
8 * it is defined in 5.11.3.
9 *
10 */
11
12 /*
13 * Copyright 2022 Red Hat Inc., Durham, North Carolina.
14 * All Rights Reserved.
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 *
30 * Authors:
31 * "Kate Hsuan" <[email protected]>
32 */
33
34 /*
35 * fwupdsecattr probe:
36 *
37 * fwupdsecattr_object(string stream-id)
38 *
39 * fwupdsecattr_state(string security-attr)
40 */
41
42 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`!
43 #include <config.h>cxx . . $ `<file>/build/config.h`/
44 #endif
45
46 #include <stdio.h>
47 #include <string.h>
48 #include <errno.h>
49 #include <assert.h>
50 #include <sys/types.h>
51 #include <sys/stat.h>
52 #include <fcntl.h>
53 #include <regex.h>
54 #include <dbus/dbus.h>
55
56 /* SEAP */
57 #include "_seap.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/_seap.h`/
58 #include <probe-api.h>cxx . . $ `<file>/src/OVAL/probes/public/probe-api.h`/
59 #include <probe/probe.h>cxx . . $ `<file>/src/OVAL/probes/probe/probe.h`/
60 #include <probe/option.h>cxx . . $ `<file>/src/OVAL/probes/probe/option.h`/
61 #include "probe/entcmp.h"cxx . . $ `<file>/src/OVAL/probes/probe/entcmp.h`/
62 #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/
63
64 #include "oval_dbus.h"cxx . . $ `<file>/src/OVAL/probes/unix/linux/oval_dbus.h`/
65 #include "fwupdsecattr_probe.h"cxx . . $ `<file>/src/OVAL/probes/unix/linux/fwupdsecattr_probe.h`/
66
67
68 static struct cachehedcxx . . $ cachehed# hsi_result_cachecxx . . $ hsi_result_cache.;
69
70 static void hsicache_callbackcxx . . $ hsicache_callback(2ae3250752bf8d86).(char *name, const uint32_tcxx . . $ uint32_t# value)
71 {
72 struct secattr_cachecxx . . $ secattr_cache# *entry;
73
74 if (name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
75 return;
76
77 entry = (struct secattr_cachecxx . . $ secattr_cache# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(struct secattr_cachecxx . . $ secattr_cache#));
78 if (entry == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
79 dEcxx . . $ `src/common/debug_priv.h:63:9`!("Out of memory when creating fwupd cache.");
80 return;
81 }
82 entry->namecxx . . $ secattr_cache#name. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(name);
83 entry->hsi_resultcxx . . $ secattr_cache#hsi_result. = value;
84 dDcxx . . $ `src/common/debug_priv.h:64:9`!("HSI cache add name: %s value: %d\n", entry->name, entry->hsi_result);
85 LIST_INSERT_HEADcxx . . $ `<external>/2546723208511035544/queue.h:120:9`!(&hsi_result_cache, entry, entries);
86 }
87
88 static uint32_tcxx . . $ uint32_t# hsicache_getcxx . . $ hsicache_get(c61c63047ce273de).(const char *key)
89 {
90 struct secattr_cachecxx . . $ secattr_cache# *next;
91
92 LIST_FOREACHcxx . . $ `<external>/2546723208511035544/queue.h:134:9`!(next, &hsi_result_cache, entries) {
93 dDcxx . . $ `src/common/debug_priv.h:64:9`!("HSI search key: %s (name: %s value: %d)\n", key, next->name, next->hsi_result);
94 if (!strncmpcxx . . $ strncmp(fd278af2f295fa2e).(next->namecxx . . $ secattr_cache#name., key, strlencxx . . $ strlen(751346f8406fd082).(next->namecxx . . $ secattr_cache#name.))) {
95 return next->hsi_resultcxx . . $ secattr_cache#hsi_result.;
96 }
97 }
98
99 dWcxx . . $ `src/common/debug_priv.h:62:9`!("HSI key not found: %s\n", key);
100 return UINT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:118:10`!;
101 }
102
103 static int get_all_security_attributescxx . . $ get_all_security_attributes(b80ce27e012f3484).(DBusConnectioncxx . . $ DBusConnection# *conn, void(*callback)(char *name, const uint32_tcxx . . $ uint32_t# value), void *cbarg)
104 {
105 int ret = 1;
106 DBusMessagecxx . . $ DBusMessage# *msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
107 DBusPendingCallcxx . . $ DBusPendingCall# *pending = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
108 char *property_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
109 char *appstream_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
110 uint32_tcxx . . $ uint32_t# hsi_flags = 0;
111
112 msg = dbus_message_new_method_callcxx . . $ dbus_message_new_method_call(a937a8c9de1028ff).(
113 "org.freedesktop.fwupd",
114 "/",
115 "org.freedesktop.fwupd",
116 "GetHostSecurityAttrs"
117 );
118 if (msg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
119 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to create dbus_message via dbus_message_new_method_call!");
120 goto cleanup;
121 }
122
123 DBusMessageItercxx . . $ DBusMessageIter# args, property_iter;
124 _DBusBasicValuecxx . . $ _DBusBasicValue# value;
125
126 if (!dbus_connection_send_with_replycxx . . $ dbus_connection_send_with_reply(ab3797bd4df020e).(conn, msg, &pending, -1)) {
127 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to send message via D-Bus!");
128 goto cleanup;
129 }
130 if (pending == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
131 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Invalid D-Bus pending call!");
132 goto cleanup;
133 }
134
135 dbus_connection_flushcxx . . $ dbus_connection_flush(5ffe6e60e141c747).(conn);
136 dbus_message_unrefcxx . . $ dbus_message_unref(ef6f40ad6aaa7be8).(msg); msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
137
138 dbus_pending_call_blockcxx . . $ dbus_pending_call_block(f8094f87eabead78).(pending);
139 msg = dbus_pending_call_steal_replycxx . . $ dbus_pending_call_steal_reply(5c89f41a44f43d9f).(pending);
140 if (msg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
141 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to steal D-Bus pending call reply.");
142 goto cleanup;
143 }
144 dbus_pending_call_unrefcxx . . $ dbus_pending_call_unref(f8094f87eabead78).(pending); pending = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
145
146 if (!dbus_message_iter_initcxx . . $ dbus_message_iter_init(ffe71547a19cf1fb).(msg, &args)) {
147 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to initialize iterator over received D-Bus message.");
148 goto cleanup;
149 }
150
151 if (dbus_message_get_typecxx . . $ dbus_message_get_type(a39774ac8f271178).(msg) == DBUS_MESSAGE_TYPE_ERRORcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:240:9`!) {
152 dbus_message_iter_get_basiccxx . . $ dbus_message_iter_get_basic(5a06ffdfd9031a8).(&args, &value);
153 dWcxx . . $ `src/common/debug_priv.h:62:9`!("Received an error from D-Bus (%s): %s", dbus_message_get_error_name(msg), value.str);
154 goto cleanup;
155 }
156
157 if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&args) != DBUS_TYPE_ARRAYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:122:9`! && dbus_message_iter_get_element_typecxx . . $ dbus_message_iter_get_element_type(f50db427ad27749a).(&args) != DBUS_TYPE_DICT_ENTRYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:145:9`!) {
158 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected array of dict_entry argument in reply. Instead received: %s.", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&args)));
159 goto cleanup;
160 }
161
162 // The variant format is a{sv}
163 dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&args, &property_iter);
164 do {
165 DBusMessageItercxx . . $ DBusMessageIter# array_entry, dict_entry, value_variant;
166
167 /* Process array */
168 if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&property_iter) != DBUS_TYPE_ARRAYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:122:9`!) {
169 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected property_iter is an array but receiving a %s", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&property_iter)));
170 goto cleanup;
171 }
172 dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&property_iter, &array_entry);
173
174 if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&array_entry) != DBUS_TYPE_DICT_ENTRYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:145:9`!) {
175 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected array_entry is a dict but receiving a %s", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&array_entry)));
176 goto cleanup;
177 }
178
179 do {
180 dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&array_entry, &dict_entry);
181
182 if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&dict_entry) != DBUS_TYPE_STRINGcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:104:9`!) {
183 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected dict_entry is a string but receiving a %s", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&dict_entry)));
184 goto cleanup;
185 }
186
187 dbus_message_iter_get_basiccxx . . $ dbus_message_iter_get_basic(5a06ffdfd9031a8).(&dict_entry, &value);
188 property_name = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(value.strcxx . . $ $anonymous_type_4cbcdbc067a1c97e_1#str.);
189 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Element key: %s", property_name);
190
191 if (dbus_message_iter_nextcxx . . $ dbus_message_iter_next(e45094e8c4b79815).(&dict_entry) == falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!) {
192 dWcxx . . $ `src/common/debug_priv.h:62:9`!("Expected another field in dict_entry.");
193 freecxx . . $ free(5d22bdacc48458e8).(property_name);
194 goto cleanup;
195 }
196
197 if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&dict_entry) != DBUS_TYPE_VARIANTcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:126:9`!) {
198 dWcxx . . $ `src/common/debug_priv.h:62:9`!("Expected variant as value in dict_entry. Instead received: %s.", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&dict_entry)));
199 freecxx . . $ free(5d22bdacc48458e8).(property_name);
200 goto cleanup;
201 }
202
203 dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&dict_entry, &value_variant);
204
205 const int arg_type = dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&value_variant);
206
207 switch (arg_type) {
208 case DBUS_TYPE_UINT32cxx . . $ `<external>/9999628393408380398/dbus-protocol.h:88:9`!:
209 if(!strncmpcxx . . $ strncmp(fd278af2f295fa2e).(property_name, "HsiResult", strlencxx . . $ strlen(751346f8406fd082).("HsiResult"))) {
210 _DBusBasicValuecxx . . $ _DBusBasicValue# hsiresult_value;
211 dbus_message_iter_get_basiccxx . . $ dbus_message_iter_get_basic(5a06ffdfd9031a8).(&value_variant, &hsiresult_value);
212 hsi_flags = hsiresult_value.u32cxx . . $ $anonymous_type_4cbcdbc067a1c97e_1#u32.;
213 }
214 break;
215 case DBUS_TYPE_STRINGcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:104:9`!:
216 if(!strncmpcxx . . $ strncmp(fd278af2f295fa2e).(property_name, "AppstreamId", strlencxx . . $ strlen(751346f8406fd082).("AppstreamId"))) {
217 freecxx . . $ free(5d22bdacc48458e8).(appstream_name);
218 appstream_name = oval_dbus_value_to_stringcxx . . $ oval_dbus_value_to_string(c8641a873d86c3b).(&value_variant);
219 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Element string: %s", appstream_name);
220 }
221 break;
222 }
223 freecxx . . $ free(5d22bdacc48458e8).(property_name);
224 } while (dbus_message_iter_nextcxx . . $ dbus_message_iter_next(e45094e8c4b79815).(&array_entry));
225 callback(appstream_name, hsi_flags);
226 freecxx . . $ free(5d22bdacc48458e8).(appstream_name);
227 appstream_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
228 } while (dbus_message_iter_nextcxx . . $ dbus_message_iter_next(e45094e8c4b79815).(&property_iter));
229
230 dbus_message_unrefcxx . . $ dbus_message_unref(ef6f40ad6aaa7be8).(msg); msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
231 ret = 0;
232
233 cleanup:
234 if (pending != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
235 dbus_pending_call_unrefcxx . . $ dbus_pending_call_unref(f8094f87eabead78).(pending);
236
237 if (msg != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
238 dbus_message_unrefcxx . . $ dbus_message_unref(ef6f40ad6aaa7be8).(msg);
239
240 freecxx . . $ free(5d22bdacc48458e8).(appstream_name);
241
242 return ret;
243 }
244
245 /**
246 * fwupd_security_attr_result_to_string:
247 * @result: security attribute result, e.g. %FWUPD_SECURITY_ATTR_RESULT_ENABLED
248 *
249 * Returns the printable string for the result enum.
250 *
251 * Returns: string, or %NULL
252 **/
253 static const char *
254 fwupd_security_attr_result_to_stringcxx . . $ fwupd_security_attr_result_to_string(9c55a702c88399f2).(FwupdSecurityAttrResultcxx . . $ FwupdSecurityAttrResult# result)
255 {
256 if (result == FWUPD_SECURITY_ATTR_RESULT_VALIDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_VALID.)
257 return "valid";
258 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_VALIDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_VALID.)
259 return "not-valid";
260 if (result == FWUPD_SECURITY_ATTR_RESULT_ENABLEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_ENABLED.)
261 return "enabled";
262 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED.)
263 return "not-enabled";
264 if (result == FWUPD_SECURITY_ATTR_RESULT_LOCKEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_LOCKED.)
265 return "locked";
266 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_LOCKEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_LOCKED.)
267 return "not-locked";
268 if (result == FWUPD_SECURITY_ATTR_RESULT_ENCRYPTEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_ENCRYPTED.)
269 return "encrypted";
270 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_ENCRYPTEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_ENCRYPTED.)
271 return "not-encrypted";
272 if (result == FWUPD_SECURITY_ATTR_RESULT_TAINTEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_TAINTED.)
273 return "tainted";
274 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_TAINTEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_TAINTED.)
275 return "not-tainted";
276 if (result == FWUPD_SECURITY_ATTR_RESULT_FOUNDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_FOUND.)
277 return "found";
278 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_FOUNDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_FOUND.)
279 return "not-found";
280 if (result == FWUPD_SECURITY_ATTR_RESULT_SUPPORTEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_SUPPORTED.)
281 return "supported";
282 if (result == FWUPD_SECURITY_ATTR_RESULT_NOT_SUPPORTEDcxx . . $ FWUPD_SECURITY_ATTR_RESULT_NOT_SUPPORTED.)
283 return "not-supported";
284 if (result == FWUPD_SECURITY_ATTR_RESULT_UNKNOWNcxx . . $ FWUPD_SECURITY_ATTR_RESULT_UNKNOWN.) {
285 dDcxx . . $ `src/common/debug_priv.h:64:9`!("Got FWUPD_SECURITY_ATTR_RESULT_UNKNOWN\n");
286 return "unknown";
287 }
288 dWcxx . . $ `src/common/debug_priv.h:62:9`!("Unknown/invalid FwupdSecurityAttrResult value: %d\n", result);
289 return "invalid-hsi-result";
290 }
291
292 int fwupdsecattr_probe_maincxx . . $ fwupdsecattr_probe_main(470536d3ffacaf10).(probe_ctxcxx . . $ probe_ctx# *ctx, void *arg)
293 {
294 SEXP_tcxx . . $ SEXP_t# *val, *item, *ent, *probe_in;
295 char *stream_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
296 const char *hsi_result_str;
297 uint64_tcxx . . $ uint64_t# hsi_result = UINT64_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:119:10`!;
298
299 probe_in = probe_ctx_getobjectcxx . . $ probe_ctx_getobject(4299b6b53fa804a5).(ctx);
300 if (probe_in == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
301 return PROBE_ENOOBJcxx . . $ `src/OVAL/probes/public/probe-common.h:21:9`!;
302
303 ent = probe_obj_getentcxx . . $ probe_obj_getent(7907a01f2ff841f3).(probe_in, "stream_id", 1);
304 if (ent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
305 return PROBE_ENOENTcxx . . $ `src/OVAL/probes/public/probe-common.h:20:9`!;
306
307 val = probe_ent_getvalcxx . . $ probe_ent_getval(2f7f980afaaae0f0).(ent);
308 if (val == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
309 SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ent);
310 return PROBE_ENOVALcxx . . $ `src/OVAL/probes/public/probe-common.h:10:9`!;
311 }
312
313 stream_id = SEXP_string_cstrcxx . . $ SEXP_string_cstr(c831a2fa12818dfe).(val);
314 SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(val);
315 SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ent);
316
317 if (LIST_EMPTYcxx . . $ `<external>/2546723208511035544/queue.h:142:9`!(&hsi_result_cache)) {
318 DBusErrorcxx . . $ DBusError# dbus_error;
319 DBusConnectioncxx . . $ DBusConnection# *dbus_conn;
320
321 dbus_error_initcxx . . $ dbus_error_init(b79b632916b634d5).(&dbus_error);
322 dbus_conn = oval_connect_dbuscxx . . $ oval_connect_dbus(f89cc4e9350282f7).();
323
324 if (dbus_conn == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
325 dbus_error_freecxx . . $ dbus_error_free(b79b632916b634d5).(&dbus_error);
326 SEXP_tcxx . . $ SEXP_t# *msg = probe_msg_creatcxx . . $ probe_msg_creat(c07e3aa4e7ab9719).(OVAL_MESSAGE_LEVEL_INFOcxx . . $ OVAL_MESSAGE_LEVEL_INFO., "D-Bus connection failed, could not identify fwupd.");
327 probe_cobj_set_flagcxx . . $ probe_cobj_set_flag(644bab5dffe689c).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), SYSCHAR_FLAG_ERRORcxx . . $ SYSCHAR_FLAG_ERROR.);
328 probe_cobj_add_msgcxx . . $ probe_cobj_add_msg(ef7ee42b5817e0be).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), msg);
329 SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(msg);
330 goto exit;
331 }
332
333 int res = get_all_security_attributescxx . . $ get_all_security_attributes(b80ce27e012f3484).(dbus_conn, hsicache_callbackcxx . . $ hsicache_callback(2ae3250752bf8d86)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
334 oval_disconnect_dbuscxx . . $ oval_disconnect_dbus(5ffe6e60e141c747).(dbus_conn);
335
336 if (res) {
337 dbus_error_freecxx . . $ dbus_error_free(b79b632916b634d5).(&dbus_error);
338 SEXP_tcxx . . $ SEXP_t# *msg = probe_msg_creatcxx . . $ probe_msg_creat(c07e3aa4e7ab9719).(OVAL_MESSAGE_LEVEL_INFOcxx . . $ OVAL_MESSAGE_LEVEL_INFO., "The fwupd service is not properly installed or configured.");
339 probe_cobj_set_flagcxx . . $ probe_cobj_set_flag(644bab5dffe689c).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), SYSCHAR_FLAG_ERRORcxx . . $ SYSCHAR_FLAG_ERROR.);
340 probe_cobj_add_msgcxx . . $ probe_cobj_add_msg(ef7ee42b5817e0be).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), msg);
341 SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(msg);
342 goto exit;
343 }
344 }
345
346 hsi_result = hsicache_getcxx . . $ hsicache_get(c61c63047ce273de).(stream_id);
347
348 if (hsi_result == UINT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:118:10`!) {
349 item = probe_item_createcxx . . $ probe_item_create(36b16a6622050a9c).(OVAL_LINUX_FWUPDSECATTRcxx . . $ OVAL_LINUX_FWUPDSECATTR., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
350 "security_attr", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., "not-found",
351 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
352 probe_item_setstatuscxx . . $ probe_item_setstatus(112b785eb420e6c0).(item, SYSCHAR_STATUS_NOT_COLLECTEDcxx . . $ SYSCHAR_STATUS_NOT_COLLECTED.);
353 probe_item_collectcxx . . $ probe_item_collect(11bb80e0c30650d7).(ctx, item);
354 goto exit;
355 }
356
357 hsi_result_str = fwupd_security_attr_result_to_stringcxx . . $ fwupd_security_attr_result_to_string(9c55a702c88399f2).(hsi_result);
358 item = probe_item_createcxx . . $ probe_item_create(36b16a6622050a9c).(OVAL_LINUX_FWUPDSECATTRcxx . . $ OVAL_LINUX_FWUPDSECATTR., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
359 "security_attr", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., hsi_result_str,
360 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
361 probe_item_collectcxx . . $ probe_item_collect(11bb80e0c30650d7).(ctx, item);
362
363 exit:
364 freecxx . . $ free(5d22bdacc48458e8).(stream_id);
365 return 0;
366 }