mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 14:22:13 +00:00
Test that GPG key import actually was successful (or didn't change a key already in the keyring)
This commit is contained in:
parent
9559bbe42d
commit
c5e8921dfd
@ -144,6 +144,19 @@ fu_keyring_add_public_key (FuKeyring *keyring, const gchar *filename, GError **e
|
||||
g_debug ("importing key %s [%i] %s",
|
||||
s->fpr, s->status, gpgme_strerror (s->result));
|
||||
}
|
||||
|
||||
/* make sure keys were really imported */
|
||||
if (result->imported + result->unchanged == 0) {
|
||||
ret = FALSE;
|
||||
g_debug("imported: %d, unchanged: %d, not_imported: %d", result->imported,
|
||||
result->unchanged,
|
||||
result->not_imported);
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INTERNAL,
|
||||
"Key import failed %s",
|
||||
filename);
|
||||
}
|
||||
out:
|
||||
gpgme_data_release (data);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user