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.
This commit is contained in:
Mario Limonciello 2022-04-01 12:05:28 -05:00 committed by Mario Limonciello
parent 0df2b57ae9
commit 2f086c2bbc
2 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,8 @@ fwupd_security_attr_flag_to_string(FwupdSecurityAttrFlags flag)
return "success";
if (flag == FWUPD_SECURITY_ATTR_FLAG_OBSOLETED)
return "obsoleted";
if (flag == FWUPD_SECURITY_ATTR_FLAG_MISSING_DATA)
return "missing-data";
if (flag == FWUPD_SECURITY_ATTR_FLAG_RUNTIME_UPDATES)
return "runtime-updates";
if (flag == FWUPD_SECURITY_ATTR_FLAG_RUNTIME_ATTESTATION)
@ -86,6 +88,8 @@ fwupd_security_attr_flag_from_string(const gchar *flag)
return FWUPD_SECURITY_ATTR_FLAG_SUCCESS;
if (g_strcmp0(flag, "obsoleted") == 0)
return FWUPD_SECURITY_ATTR_FLAG_OBSOLETED;
if (g_strcmp0(flag, "missing-data") == 0)
return FWUPD_SECURITY_ATTR_FLAG_MISSING_DATA;
if (g_strcmp0(flag, "runtime-updates") == 0)
return FWUPD_SECURITY_ATTR_FLAG_RUNTIME_UPDATES;
if (g_strcmp0(flag, "runtime-attestation") == 0)

View File

@ -32,6 +32,7 @@ struct _FwupdSecurityAttrClass {
* @FWUPD_SECURITY_ATTR_FLAG_NONE: No flags set
* @FWUPD_SECURITY_ATTR_FLAG_SUCCESS: Success
* @FWUPD_SECURITY_ATTR_FLAG_OBSOLETED: Obsoleted by another attribute
* @FWUPD_SECURITY_ATTR_FLAG_MISSING_DATA: Missing data
* @FWUPD_SECURITY_ATTR_FLAG_RUNTIME_UPDATES: Suffix `U`
* @FWUPD_SECURITY_ATTR_FLAG_RUNTIME_ATTESTATION: Suffix `A`
* @FWUPD_SECURITY_ATTR_FLAG_RUNTIME_ISSUE: Suffix `!`
@ -42,6 +43,7 @@ typedef enum {
FWUPD_SECURITY_ATTR_FLAG_NONE = 0,
FWUPD_SECURITY_ATTR_FLAG_SUCCESS = 1 << 0,
FWUPD_SECURITY_ATTR_FLAG_OBSOLETED = 1 << 1,
FWUPD_SECURITY_ATTR_FLAG_MISSING_DATA = 1 << 2,
FWUPD_SECURITY_ATTR_FLAG_RUNTIME_UPDATES = 1 << 8,
FWUPD_SECURITY_ATTR_FLAG_RUNTIME_ATTESTATION = 1 << 9,
FWUPD_SECURITY_ATTR_FLAG_RUNTIME_ISSUE = 1 << 10,