From 7d35278cb637f03354ca589849dcf51dc0c07dbf Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Fri, 24 Aug 2018 11:35:02 -0500 Subject: [PATCH] fu-install-task: Don't fail update installation if compiled without GPG/PKCS7 Currently if you download a CAB file from LVFS and try to install it on a daemon compiled without GPG it will fail to install since LVFS has signed it. You had to make an intentional decision to disable GPG. Allow this scenario to work just as if the CAB file were unsigned, but save a warning in the logs that it happened. --- src/fu-install-task.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/fu-install-task.c b/src/fu-install-task.c index 6bc56f2d5..222e6ff50 100644 --- a/src/fu-install-task.c +++ b/src/fu-install-task.c @@ -113,6 +113,7 @@ fu_install_task_check_requirements (FuInstallTask *self, const gchar *version_lowest; gboolean matches_guid = FALSE; gint vercmp; + g_autoptr(GError) error_local = NULL; g_return_val_if_fail (FU_IS_INSTALL_TASK (self), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -236,7 +237,17 @@ fu_install_task_check_requirements (FuInstallTask *self, } /* verify */ - return fu_keyring_get_release_trust_flags (release, &self->trust_flags, error); + if (!fu_keyring_get_release_trust_flags (release, &self->trust_flags, &error_local)) { + if (g_error_matches (error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) { + g_warning ("Ignoring verification for %s: %s", + fu_device_get_name (self->device), + error_local->message); + } else { + g_propagate_error (error, g_steal_pointer (&error_local)); + return FALSE; + } + } + return TRUE; } /**