Commit Graph

41 Commits

Author SHA1 Message Date
Richard Hughes
63f4038328 Fix some trivial null-correctness spotted by Tartan 2022-12-15 17:27:22 +00:00
Richard Hughes
f970b3de23 Do not show HSI events where we changed the spec result value 2022-08-24 13:49:19 +01:00
Mario Limonciello
b7b0ce533d trivial: Unify ambiguity between bios-attrs and bios-settings
These are currently used interchangeably since there was indecisiveness
which to use as the feature was being developed.

As outward facing it will be named with "settings", change all uses
in the code to match this.
2022-08-24 07:20:01 -05:00
Richard Hughes
0beed2f138 Store the current BIOS value in a security attribute
We can't very-well ask the user to 'change it back' if we do not tell
them what it is set to already.
2022-08-01 15:45:43 +01:00
Richard Hughes
77006b75eb Set the target value on the security attribute
Semantically it is the desire of the security attribute, not the bios
attribute, i.e. you could imagine that a specific attribute would have
to be *foo or bar or baz* for HSI-1 and *only foo* for HSI-2

Also make it easier to add possible BIOS attribute target values in
plugin code.
2022-08-01 07:12:18 +01:00
Mario Limonciello
331d7bbd40 trivial: FwupdSecurityAttr: fix a symbol name 2022-07-29 12:41:59 -05:00
Mario Limonciello
aa1e321f6e Add support for including a FwupdBiosAttr ID in FwupdSecurityAttr
This can allow clients to let users correct problems found on their
systems.
2022-07-29 11:31:50 -05:00
Mario Limonciello
17c636686d trivial: libfwupd: move some duplicated code to fwupd-common
Several of the string/integer/time functions are duplicated in multiple
source files for no discernable reason.  Move them into fwupd-common
as private symbols instead.
2022-07-26 20:11:23 +01:00
Richard Hughes
a5749f4d23 Set the HSI levels in a central place
This means we don't need to worry about changing multiple
implementations if the HSI levels change for a specific ID.

It also means we can fake HSI results in the future without having
to also store the 'correct' level in the input file.
2022-07-15 20:21:22 +01:00
Richard Hughes
7b1204bce0 trivial: Fix outputting the new security attr flags to JSON 2022-07-14 15:43:19 +01:00
Richard Hughes
26e5ecb567 trivial: Add fwupd_security_attr_remove_flag() for future use 2022-07-14 14:48:51 +01:00
Richard Hughes
ae0c3fe38a Add 'action' resolution flags to each FwupdSecurityAttr
We tried to solve this by matching the org.fwupd.hsi AppStream ID, but
in some cases the resolution depends on what actually failed.

Add "the action the user is supposed to do" as flags so that the
front-end can translate this in the appropriate way, for instance,
using a different string for log events and HSI dialogs.
2022-07-14 14:47:44 +01:00
Richard Hughes
1ef23d1006 Add some FwupdSecurityAttr API for future use 2022-07-09 20:58:19 +01:00
Richard Hughes
b1a31dbfae Include the plugin name in the FwupdSecurityAttr GVariant 2022-07-01 10:55:56 +01:00
Mario Limonciello
2f086c2bbc Add a new security attribute flag of "missing data"
This attribute flag will be used to determine whether or not enough
data has been provided to make a security level calculation.
2022-04-03 09:06:00 -05:00
Richard Hughes
c4590f2f25 trivial: Add some missing g_return_val_if_fail() calls 2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
9f94dc97c4 trivial: Handle old JSON-Glib more gracefully
Fixes https://github.com/fwupd/fwupd/issues/4099
2021-12-16 19:29:49 +00:00
Richard Hughes
8120616c62 trivial: Add a fallback result for an HSI attribute
The fallback may represent the old state, or a state
that may be considered equivalent.
2021-11-01 06:58:44 +00:00
Richard Hughes
e9319699b4 trivial: Add fwupd_security_attr_copy() for future functionality 2021-10-29 13:09:45 +01:00
Richard Hughes
a085b4dd68 Add a 'created' property on the HSI security attribute 2021-10-28 17:25:40 +01:00
Richard Hughes
dbdd3740a3 Add support for loading the HSI result from a JSON blob
This is how we save it to the database, and we'll need to load old
records for future functionality.
2021-10-28 15:36:13 +01:00
Richard Hughes
95b82a1467 trivial: Add two missing _from_string() HSI helpers 2021-10-28 15:36:13 +01:00
Richard Hughes
164012b47b trivial: Ensure the plugin is loaded from the HSI attr variant 2021-10-28 15:36:13 +01:00
Richard Hughes
f56878ff88 Allow adding GUIDs to each HSI security attr
This indicates the GUID in some way contributed to the result decided.

It also allows us to match the submitted HSI results back to a firmware
stream on the LVFS, which allows us to allow vendors to see a subset of
results for uploaded devices.
2021-09-03 22:03:28 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
9829103be9 trivial: Add some generic helpers for building JSON 2021-07-15 20:34:07 +01:00
Richard Hughes
a02c1073f2 trivial: Fix up some of the developer docs
And add some missing content as requried.
2021-06-11 09:39:03 +01:00
Mario Limonciello
1e17457b16 Allow building the documentation with gi-docgen and gtk-doc
Until gi-docgen is declared stable support either of them.
This effectively means that hand builds and CI builds will use
gi-docgen, but distro builds use gtk-doc-tools.
2021-06-09 22:21:53 +01:00
Richard Hughes
20ef071b3c trivial: Style fixes to lots of gtk-doc 2021-05-10 14:35:10 +01:00
Richard Hughes
d42bd85059 trivial: Do not use the deprecated allow-none introspection argument
It's been deprecated since 2014... oops.

https://blogs.gnome.org/desrt/2014/05/27/allow-none-is-dead-long-live-nullable/
2021-04-19 14:46:42 +01:00
Richard Hughes
382524d82f trivial: Fix potential crash when doing crazy things
Fix the asan crash when feeding the value back into itself, e.g

    fu_firmware_set_version (firmware, fu_firmware_get_version (firmware));
2021-01-28 14:13:59 +00:00
Richard Hughes
a14de30153 trivial: Require <string.h> for strlen() and memcpy() 2020-12-14 16:49:03 +00:00
Mario Limonciello
fbd3508655 trivial: correct some documentation typos 2020-09-17 13:51:59 -05:00
Richard Hughes
7b57ce226b libfwupd: Allow storing metadata on the security attr 2020-07-01 20:10:39 +01:00
Richard Hughes
dc805b41f1 trivial: Remove unused variables 2020-07-01 20:10:39 +01:00
Richard Hughes
19a60e62bc trivial: Check for the _UNKNOWN enum when mashalling to GVariant 2020-06-17 18:37:27 +01:00
Richard Hughes
b246bcaecb Allow client tools to translate the HSI attributes and results
To do this, rely on the AppStream ID to map to a translated string (providing a
fallback for clients that do not care) and switch the free-form result string
into a set of enumerated values that can be translated.

This fixes some of the problems where some things have to be enabled to "pass"
and other attributes have to be some other state. For cases where we want the
user to "do" something, provide a URL to a wiki page that we update out-of-band
of fwupd releases.
2020-05-18 17:03:49 +01:00
Richard Hughes
0613b3cdf3 trivial: Fix the docstring for fwupd_security_attr_set_name() 2020-05-15 16:17:27 +01:00
Richard Hughes
cae111d1de Save the plugin that created the FwupdSecurityAttr
This is really useful for debugging.
2020-05-15 16:17:27 +01:00
Richard Hughes
173acd2e07 Add FwupdSecurityAttr to libfwupd
This will be used to store security attributes about platform security.
2020-05-11 17:52:41 +01:00