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.
This commit is contained in:
Mario Limonciello 2018-08-24 11:35:02 -05:00 committed by Richard Hughes
parent 6d794e2de6
commit 7d35278cb6

View File

@ -113,6 +113,7 @@ fu_install_task_check_requirements (FuInstallTask *self,
const gchar *version_lowest; const gchar *version_lowest;
gboolean matches_guid = FALSE; gboolean matches_guid = FALSE;
gint vercmp; gint vercmp;
g_autoptr(GError) error_local = NULL;
g_return_val_if_fail (FU_IS_INSTALL_TASK (self), FALSE); g_return_val_if_fail (FU_IS_INSTALL_TASK (self), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@ -236,7 +237,17 @@ fu_install_task_check_requirements (FuInstallTask *self,
} }
/* verify */ /* 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;
} }
/** /**