From 5a3010f5256a5d2ee93e7787cacb219b3e6fac16 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 18 Mar 2022 12:16:29 +0000 Subject: [PATCH] ata: Add signed-payload for Phison devices --- plugins/ata/fu-ata-device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/ata/fu-ata-device.c b/plugins/ata/fu-ata-device.c index 679732e41..fd7240ec4 100644 --- a/plugins/ata/fu-ata-device.c +++ b/plugins/ata/fu-ata-device.c @@ -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; }