- m_fclose(&fp);
- mutt_clear_error ();
- snprintf (cmd, sizeof (cmd), _("Key ID: 0x%s"), crypt_keyid (key));
- mutt_do_pager (cmd, tempfile, 0, NULL);
-}
-
-/* Implementation of `findkeys'. */
-
-/* Convert string_list_t into a pattern string suitable to be passed to GPGME.
- We need to convert spaces in an item into a '+' and '%' into
- "%25". */
-static char *list_to_pattern (string_list_t * list)
-{
- string_list_t *l;
- char *pattern, *p;
- const char *s;
- ssize_t n;
-
- n = 0;
- for (l = list; l; l = l->next) {
- for (s = l->data; *s; s++) {
- if (*s == '%')
- n += 2;
- n++;
- }
- n++; /* delimiter or end of string */
- }
- n++; /* make sure to allocate at least one byte */
- pattern = p = p_new(char, n);
- for (l = list; l; l = l->next) {
- s = l->data;
- if (*s) {
- if (l != list)
- *p++ = ' ';
- for (s = l->data; *s; s++) {
- if (*s == '%') {
- *p++ = '%';
- *p++ = '2';
- *p++ = '5';
- }
- else if (*s == '+') {
- *p++ = '%';
- *p++ = '2';
- *p++ = 'B';
- }
- else if (*s == ' ')
- *p++ = '+';
- else
- *p++ = *s;
- }
- }
- }
- *p = 0;
- return pattern;
-}
-
-/* Return a list of keys which are candidates for the selection.
- Select by looking at the HINTS list. */
-static crypt_key_t *get_candidates (string_list_t * hints, unsigned int app,
- int secret)
-{
- crypt_key_t *db, *k, **kend;
- char *pattern;
- gpgme_error_t err;
- gpgme_ctx_t ctx;
- gpgme_key_t key;
- int idx;
- gpgme_user_id_t uid = NULL;
-
- pattern = list_to_pattern (hints);
- if (!pattern)
- return NULL;
-
- err = gpgme_new (&ctx);
- if (err) {
- mutt_error (_("gpgme_new failed: %s"), gpgme_strerror (err));
- p_delete(&pattern);
- return NULL;
- }
+ m_fclose(&fp);
+ mutt_clear_error ();
+ snprintf (cmd, sizeof (cmd), _("Key ID: 0x%s"), crypt_keyid (key));
+ mutt_do_pager (cmd, tempfile, 0, NULL);
+}