#endif
#include "mutt.h"
+#include "enter.h"
+#include "handler.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "smime.h"
smime_void_passphrase ();
- if (mutt_get_field_unbuffered (_("Enter SMIME passphrase:"), SmimePass,
+ if (mutt_get_field_unbuffered (_("Enter S/MIME passphrase:"), SmimePass,
sizeof (SmimePass), M_PASS) == 0) {
SmimeExptime = time (NULL) + SmimeTimeout;
return (1);
}
/* Read Entries */
cur = 0;
- Table = safe_calloc (cert_num, sizeof (smime_id));
+ Table = mem_calloc (cert_num, sizeof (smime_id));
while (!feof (index)) {
numFields =
fscanf (index, MUTT_FORMAT (STRING) " %x.%i " MUTT_FORMAT (STRING),
}
}
if (hash) {
- fname = safe_malloc (13); /* Hash + '.' + Suffix + \0 */
+ fname = mem_malloc (13); /* Hash + '.' + Suffix + \0 */
sprintf (fname, "%.8x.%i", Table[cur].hash, Table[cur].suffix);
}
else
fname = NULL;
mutt_menuDestroy (&menu);
- FREE (&Table);
+ mem_free (&Table);
set_option (OPTNEEDREDRAW);
if (fname)
/* the key used last time. */
if (*SmimeKeyToUse &&
!str_casecmp (k, SmimeKeyToUse + str_len (SmimeKeys) + 1)) {
- FREE (&k);
+ mem_free (&k);
return;
}
else
if (str_casecmp (k, SmimeDefaultKey))
smime_void_passphrase ();
- FREE (&k);
+ mem_free (&k);
return;
}
}
if (!keyID) {
mutt_message (_("No (valid) certificate found for %s."), q->mailbox);
- FREE (&keylist);
+ mem_free (&keylist);
rfc822_free_address (&tmp);
rfc822_free_address (&addr);
return NULL;
}
keylist_size += str_len (keyID) + 2;
- safe_realloc (&keylist, keylist_size);
+ mem_realloc (&keylist, keylist_size);
sprintf (keylist + keylist_used, "%s\n", keyID); /* __SPRINTF_CHECKED__ */
keylist_used = str_len (keylist);
if (copy && buffer && num) {
(*num) = count;
- *buffer = safe_calloc (sizeof (char *), count);
+ *buffer = mem_calloc (sizeof (char *), count);
count = 0;
rewind (fpout);
while ((fgets (email, sizeof (email), fpout))) {
*(email + str_len (email) - 1) = '\0';
- (*buffer)[count] = safe_calloc (1, str_len (email) + 1);
+ (*buffer)[count] = mem_calloc (1, str_len (email) + 1);
strncpy ((*buffer)[count], email, str_len (email));
count++;
}
mutt_wait_filter (thepid);
mutt_unlink (certfile);
- FREE (&certfile);
+ mem_free (&certfile);
}
fflush (fpout);
else
retval = 0;
mutt_unlink (certfile);
- FREE (&certfile);
+ mem_free (&certfile);
}
else
mutt_any_key_to_continue (_("no certfile"));
if (linelen && !str_casecmp (line, "verification successful"))
badsig = 0;
- FREE (&line);
+ mem_free (&line);
}
}
line = mutt_read_line (line, &linelen, smimeerr, &lineno);
if (linelen && !str_casecmp (line, "verification successful"))
m->goodsig = 1;
- FREE (&line);
+ mem_free (&line);
}
else {
m->goodsig = p->goodsig;
}
-void smime_application_smime_handler (BODY * m, STATE * s)
+int smime_application_smime_handler (BODY * m, STATE * s)
{
-
- smime_handle_entity (m, s, NULL);
-
+ return smime_handle_entity (m, s, NULL) ? 0 : -1;
}
int smime_send_menu (HEADER * msg, int *redraw)
case 3: /* encrypt (w)ith */
msg->security |= ENCRYPT;
switch (mutt_multi_choice (_("1: DES, 2: Triple-DES, 3: RC2-40,"
- " 4: RC2-64, 5: RC2-128, or (f)orget it? "),
- _("12345f"))) {
+ " 4: RC2-64, 5: RC2-128, 6: AES128,"
+ " 7: AES192, 8: AES256, or (f)orget it? "),
+ _("12345678f"))) {
case 1:
str_replace (&SmimeCryptAlg, "des");
break;
case 5:
str_replace (&SmimeCryptAlg, "rc2-128");
break;
- case 6: /* forget it */
+ case 6:
+ str_replace (&SmimeCryptAlg, "aes128");
+ break;
+ case 7:
+ str_replace (&SmimeCryptAlg, "aes192");
+ break;
+ case 8:
+ str_replace (&SmimeCryptAlg, "aes256");
+ break;
+ case 9: /* forget it */
break;
}
break;
case 4: /* sign (a)s */
if ((p = smime_ask_for_key (_("Sign as: "), NULL, 0))) {
- p[str_len (p) - 1] = '\0';
str_replace (&SmimeDefaultKey, p);
msg->security |= SIGN;