{
#ifdef HAVE_SMIME
if (cur->security & APPLICATION_SMIME)
- {
- ADDRESS *t;
- int found = 0;
- for (t = cur->env->to; !found && t; t = t->next)
- if (mutt_addr_is_user (t))
- {
- found = 1;
- smime_getkeys (t->mailbox);
- }
- for (t = cur->env->cc; !found && t; t = t->next)
- if (mutt_addr_is_user (t))
- {
- found = 1;
- smime_getkeys (t->mailbox);
- }
- if (!found && (t = mutt_default_from()))
- {
- smime_getkeys (t->mailbox);
- rfc822_free_address (&t);
- }
- }
+ smime_getkeys (cur->env);
#endif
if(!crypt_valid_passphrase(cur->security))
return 0;
#ifdef HAVE_SMIME
if (hdr->security & APPLICATION_SMIME)
{
- if (hdr->env->to)
- smime_getkeys (hdr->env->to->mailbox);
+ if (hdr->env)
+ smime_getkeys (hdr->env);
if (mutt_is_application_smime(hdr->content))
secured = ! smime_decrypt_mime (msg->fp, &fp, hdr->content, &cur);
*/
static int SmimeFirstTime = 1; /* sucks... */
-void smime_getkeys (char *mailbox)
+void _smime_getkeys (char *mailbox)
{
char *k = smime_get_field_from_db (mailbox, NULL, 0, 0); /* XXX - or sohuld we ask? */
char buf[STRING];
NONULL (SmimeCertificates), SmimeSignAs);
}
+void smime_getkeys (ENVELOPE *env)
+{
+ ADDRESS *t;
+ int found = 0;
+ for (t = env->to; !found && t; t = t->next)
+ if (mutt_addr_is_user (t))
+ {
+ found = 1;
+ smime_getkeys (t->mailbox);
+ }
+ for (t = env->cc; !found && t; t = t->next)
+ if (mutt_addr_is_user (t))
+ {
+ found = 1;
+ smime_getkeys (t->mailbox);
+ }
+ if (!found && (t = mutt_default_from()))
+ {
+ _smime_getkeys (t->mailbox);
+ rfc822_free_address (&t);
+ }
+}
/* This routine attempts to find the keyids of the recipients of a message.
* It returns NULL if any of the keys can not be found.
char* smime_ask_for_key (char *, char *, short);
-void smime_getkeys (char *);
-
+void smime_getkeys (ENVELOPE *);
/* private ? */