UPSTREAM: fu-engine: Don't fail get-details if compiled without GPG/PKCS7

Similar to commit 7d35278 regarding the install option with a daemon compiled without
GPG, but now, if you also have a daemon compiled without GPG, and if you have downloaded a
CAB file from LVFS and ran get-details, it would fail to display the contents
of the associated CAB file.

This allows it to still display the contents of the CAB file, and
a warning will be displayed in the logs.

BUG=chromium:857263
TEST=fwupdmgr get-details <cab file> does not show "Not compiled with GPG support"
and running "/usr/libexec/fwupd/fwupd -v" for the get-details option shows that
the verification step is ignored for the CAB file

(cherry-picked from commit 980f2d95519a163fe49797259e94e2b29a3c341d
https://github.com/hughsie/fwupd.git master)

Signed-off-by: Salud Lemus <saludlemus@google.com>

Change-Id: I2ce3d4da96a3a48ed3e9a38477ca6270b3537a22
Reviewed-on: https://chromium-review.googlesource.com/1191929
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Salud Lemus <saludlemus@google.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
diff --git a/src/fu-engine.c b/src/fu-engine.c
index da1f2e1..028006f 100644
--- a/src/fu-engine.c
+++ b/src/fu-engine.c
@@ -1852,6 +1852,7 @@
 	GPtrArray *provides;
 	g_autoptr(FwupdDevice) dev = NULL;
 	g_autoptr(FwupdRelease) rel = NULL;
+	g_autoptr(GError) error_local = NULL;
 
 	dev = fwupd_device_new ();
 	provides = as_app_get_provides (app);
@@ -1892,8 +1893,20 @@
 
 	/* verify trust */
 	release = as_app_get_release_default (app);
-	if (!fu_keyring_get_release_trust_flags (release, &trust_flags, error))
-		return NULL;
+	if (!fu_keyring_get_release_trust_flags (release,
+						 &trust_flags,
+						 &error_local)) {
+		if (g_error_matches (error_local,
+				     FWUPD_ERROR,
+				     FWUPD_ERROR_NOT_SUPPORTED)) {
+			g_warning ("Ignoring verification: %s",
+				   error_local->message);
+		} else {
+			g_propagate_error (error,
+					   g_steal_pointer (&error_local));
+			return NULL;
+		}
+	}
 
 	/* possibly convert the version from 0x to dotted */
 	fu_engine_vendor_quirk_release_version (self, app);