ata: Add signed-payload for Phison devices

This commit is contained in:
Richard Hughes 2022-03-18 12:16:29 +00:00
parent 84a13af360
commit 5a3010f525

View File

@ -446,6 +446,15 @@ fu_ata_device_parse_id(FuAtaDevice *self, const guint8 *buf, gsize sz, GError **
fu_device_add_instance_id(device, name);
}
/* for Phison this is per-chipset -- which is specified in the version prefix */
if (g_strcmp0(fu_device_get_vendor(device), "Phison") == 0 &&
fu_device_get_version(device) != NULL) {
if (g_str_has_prefix(fu_device_get_version(device), "SB"))
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UNSIGNED_PAYLOAD);
else if (g_str_has_prefix(fu_device_get_version(device), "SH"))
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_SIGNED_PAYLOAD);
}
return TRUE;
}