about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-03-24 00:47:13 +0000
committerJames Booth <boothj5@gmail.com>2015-03-24 00:47:13 +0000
commit551f7df1f765e6a495b9d73603f76805f6609130 (patch)
tree63b8bd2903ac8db3ef863876ebcf45a5d840aa5b /src/command
parentb87130b601f3e3905bb002f62fe2e11db112a939 (diff)
downloadprofani-tty-551f7df1f765e6a495b9d73603f76805f6609130.tar.gz
Added signature verification, /pgp fps command
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c1
-rw-r--r--src/command/commands.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c
index 8e709601..994c1155 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -1579,6 +1579,7 @@ cmd_init(void)
 
     pgp_ac = autocomplete_new();
     autocomplete_add(pgp_ac, "keys");
+    autocomplete_add(pgp_ac, "fps");
     autocomplete_add(pgp_ac, "libver");
 }
 
diff --git a/src/command/commands.c b/src/command/commands.c
index 0dc19e41..5b73954b 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -4093,6 +4093,22 @@ cmd_pgp(gchar **args, struct cmd_help_t help)
             cons_show("No keys found");
         }
         g_slist_free_full(keys, (GDestroyNotify)p_gpg_free_key);
+    } else if (g_strcmp0(args[0], "fps") == 0) {
+        GHashTable *fingerprints = p_gpg_fingerprints();
+        GList *jids = g_hash_table_get_keys(fingerprints);
+        if (jids) {
+            cons_show("Received PGP fingerprints:");
+            GList *curr = jids;
+            while (curr) {
+                char *jid = curr->data;
+                char *fingerprint = g_hash_table_lookup(fingerprints, jid);
+                cons_show("  %s: %s", jid, fingerprint);
+                curr = g_list_next(curr);
+            }
+        } else {
+            cons_show("No PGP fingerprints received.");
+        }
+        g_list_free(jids);
     } else if (g_strcmp0(args[0], "libver") == 0) {
         const char *libver = p_gpg_libver();
         if (libver) {
='n203' href='#n203'>203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226