lib/gpg: Print debug info when reading GPG keys
This commit adds debug output whenever libostree reads GPG keys, which can come from different locations in the file system. This is especially helpful in debugging "GPG signatures found, but none are in trusted keyring" errors, which in my case was caused by OSTree looking in /usr/local/share/ostree/trusted.gpg.d/ rather than /usr/share/ostree/trusted.gpg.d/. Closes: #1241 Approved by: cgwalters
This commit is contained in:
1 parent
be100e0ee2
commit
133e9ae733
3 files changed
+14
-3
No files matched your search
@@ -272,6 +272,9 @@ _ostree_gpg_verifier_add_keyring_file (OstreeGpgVerifier *self,
|
||||
{
|
||||
g_return_if_fail (G_IS_FILE (path));
|
||||
|
||||
g_autofree gchar *path_str = g_file_get_path (path);
|
||||
g_debug ("Adding GPG keyring file %s to verifier", path_str);
|
||||
|
||||
self->keyrings = g_list_append (self->keyrings, g_object_ref (path));
|
||||
}
|
||||
|
||||
@@ -280,8 +283,11 @@ _ostree_gpg_verifier_add_keyring_file (OstreeGpgVerifier *self,
|
||||
*/
|
||||
void
|
||||
_ostree_gpg_verifier_add_keyring_data (OstreeGpgVerifier *self,
|
||||
GBytes *keyring)
|
||||
GBytes *keyring,
|
||||
const char *data_source)
|
||||
{
|
||||
g_debug ("Adding GPG keyring data from %s to verifier", data_source);
|
||||
|
||||
g_ptr_array_add (self->keyring_data, g_bytes_ref (keyring));
|
||||
}
|
||||
|
||||
@@ -289,6 +295,8 @@ void
|
||||
_ostree_gpg_verifier_add_key_ascii_file (OstreeGpgVerifier *self,
|
||||
const char *path)
|
||||
{
|
||||
g_debug ("Adding GPG key ASCII file %s to verifier", path);
|
||||
|
||||
if (!self->key_ascii_files)
|
||||
self->key_ascii_files = g_ptr_array_new_with_free_func (g_free);
|
||||
g_ptr_array_add (self->key_ascii_files, g_strdup (path));
|
||||
@@ -319,6 +327,8 @@ _ostree_gpg_verifier_add_keyring_dir_at (OstreeGpgVerifier *self,
|
||||
&dfd_iter, error))
|
||||
return FALSE;
|
||||
|
||||
g_debug ("Adding GPG keyring dir %s to verifier", path);
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
struct dirent *dent;
|
||||
|
||||
Reference in new issue
Block a user