Commit 5acad939 authored by Brendan Cully's avatar Brendan Cully

Check S/MIME signing ID exists before attempting to use it.

Closes #3069. Also make (s)ign automatically ask for a key if no
default is defined.
parent 8eb2a56e
2008-06-25 22:43 -0700 Brendan Cully <[email protected]> (e2780a423d96)
2008-06-25 23:13 -0700 Brendan Cully <[email protected]> (d2134eced31b)
* init.h: Make $move default to no instead of ask-no. Closes #2945.
* doc/manual.xml.head: Document difference between index and pager
search. Closes #2886.
* commands.c, copy.c, crypt-gpgme.c, handler.c, mbox.c, pgp.c: Make
mutt_copy_message distinguish between fatal and non-fatal errors.
......
......@@ -1386,6 +1386,12 @@ BODY *smime_sign_message (BODY *a )
pid_t thepid;
char *intermediates = smime_get_field_from_db(NULL, SmimeDefaultKey, 1, 1);
if (!SmimeDefaultKey)
{
mutt_error _("Can't sign: No key specified. Use Sign As.");
return NULL;
}
if (!intermediates)
{
mutt_message(_("Warning: Intermediate certificate not found."));
......@@ -2023,12 +2029,17 @@ int smime_send_menu (HEADER *msg, int *redraw)
case 2: /* (s)ign */
if(!SmimeDefaultKey)
mutt_message _("Can't sign: No key specified. Use Sign As.");
else
{
msg->security |= SIGN;
msg->security &= ~ENCRYPT;
*redraw = REDRAW_FULL;
if ((p = smime_ask_for_key (_("Sign as: "), NULL, 0)))
mutt_str_replace (&SmimeDefaultKey, p);
else
break;
}
msg->security |= SIGN;
msg->security &= ~ENCRYPT;
break;
case 4: /* sign (a)s */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment