summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo.c
diff options
context:
space:
mode:
authorDan Nicholson <nicholson@endlessm.com>2019-08-26 11:15:25 -0600
committerDan Nicholson <dbn@endlessos.org>2021-07-15 15:50:04 -0600
commit27dc5d7d389956befd9f2de7a956073899c264de (patch)
tree22cd7e1725cf8a4a7d41c33129145b08b480121f /src/libostree/ostree-repo.c
parent4fa403aee500df058a7d3ee2b6b1db4300ad7a92 (diff)
downloadostree-27dc5d7d389956befd9f2de7a956073899c264de.tar.gz
lib/repo: Include WKD update URLs in GPG key listing
If the key UID contains a valid email address, include the GPG WKD update URLs in GVariant returned by ostree_repo_remote_get_gpg_keys().
Diffstat (limited to 'src/libostree/ostree-repo.c')
-rw-r--r--src/libostree/ostree-repo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index b20aa617..5bd76e91 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -2439,6 +2439,16 @@ ostree_repo_remote_get_gpg_keys (OstreeRepo *self,
for (gpgme_user_id_t uid = key->uids; uid != NULL; uid = uid->next)
{
+ /* Get WKD update URLs if address set */
+ g_autofree char *advanced_url = NULL;
+ g_autofree char *direct_url = NULL;
+ if (uid->address != NULL)
+ {
+ if (!ot_gpg_wkd_urls (uid->address, &advanced_url, &direct_url,
+ error))
+ return FALSE;
+ }
+
g_auto(GVariantDict) uid_dict = OT_VARIANT_BUILDER_INITIALIZER;
g_variant_dict_init (&uid_dict, NULL);
g_variant_dict_insert_value (&uid_dict, "uid",
@@ -2453,6 +2463,10 @@ ostree_repo_remote_get_gpg_keys (OstreeRepo *self,
g_variant_new_boolean (uid->revoked));
g_variant_dict_insert_value (&uid_dict, "invalid",
g_variant_new_boolean (uid->invalid));
+ g_variant_dict_insert_value (&uid_dict, "advanced_url",
+ g_variant_new ("ms", advanced_url));
+ g_variant_dict_insert_value (&uid_dict, "direct_url",
+ g_variant_new ("ms", direct_url));
g_variant_builder_add (&uids_builder, "(@a{sv})",
g_variant_dict_end (&uid_dict));
}