- while (!(err = gpgme_op_keylist_next (ctx, &key))) {
- unsigned int flags = KEYFLAG_ISX509;
-
- if (key_check_cap (key, KEY_CAP_CAN_ENCRYPT))
- flags |= KEYFLAG_CANENCRYPT;
- if (key_check_cap (key, KEY_CAP_CAN_SIGN))
- flags |= KEYFLAG_CANSIGN;
-
- for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) {
- k = p_new(crypt_key_t, 1);
- k->kobj = key;
- k->idx = idx;
- k->uid = uid->uid;
- k->flags = flags;
- *kend = k;
- kend = &k->next;
- }
- }
- if (gpg_err_code (err) != GPG_ERR_EOF)
- mutt_error (_("gpgme_op_keylist_next failed: %s"), gpgme_strerror (err));
- gpgme_op_keylist_end (ctx);
- }
-
- gpgme_release (ctx);
- p_delete(&pattern);
- return db;
-}
-
-/* Add the string STR to the list HINTS. This list is later used to
- match addresses. */
-static string_list_t *crypt_add_string_to_hints (string_list_t * hints, const char *str)
-{
- char *scratch;
- char *t;
-
- if ((scratch = m_strdup(str)) == NULL)
- return hints;
-
- for (t = strtok (scratch, " ,.:\"()<>\n"); t;
- t = strtok (NULL, " ,.:\"()<>\n")) {
- if (m_strlen(t) > 3)
- hints = mutt_add_list(hints, t);
- }
-
- p_delete(&scratch);
- return hints;