mutt_decode_attachment (sigbdy, s);
- sigbdy->length = ftell (s->fpout);
+ sigbdy->length = ftello (s->fpout);
sigbdy->offset = 0;
fclose (s->fpout);
return NULL;
}
- fseek (s->fpin, m->offset, 0);
+ fseeko (s->fpin, m->offset, 0);
last_pos = m->offset;
mutt_copy_bytes (s->fpin, tmpfp, m->length);
memset (&s, 0, sizeof (s));
s.fpin = fpin;
- fseek (s.fpin, b->offset, 0);
+ fseeko (s.fpin, b->offset, 0);
mutt_mktemp (tempfile);
if ((tmpfp = safe_fopen (tempfile, "w+")) == NULL) {
s.fpout = tmpfp;
mutt_decode_attachment (b, &s);
fflush (tmpfp);
- b->length = ftell (s.fpout);
+ b->length = ftello (s.fpout);
b->offset = 0;
rewind (tmpfp);
s.fpin = tmpfp;
break;
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, 6: AES128,"
- " 7: AES192, 8: AES256, or (f)orget it? "),
- _("12345678f"))) {
- case 1:
- str_replace (&SmimeCryptAlg, "des");
- break;
- case 2:
- str_replace (&SmimeCryptAlg, "des3");
- break;
- case 3:
- str_replace (&SmimeCryptAlg, "rc2-40");
- break;
- case 4:
- str_replace (&SmimeCryptAlg, "rc2-64");
- break;
- case 5:
- str_replace (&SmimeCryptAlg, "rc2-128");
- break;
- 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;
+ {
+ int choice = 0;
+ msg->security |= ENCRYPT;
+
+ do {
+ /* I use "dra" because "123" is recognized anyway */
+ switch (mutt_multi_choice (_("Choose algorithm family:"
+ " 1: DES, 2: RC2, 3: AES,"
+ " or (c)lear? "), _("drac"))) {
+ case 1:
+ switch (choice = mutt_multi_choice (_("1: DES, 2: Triple-DES "),
+ _("dt"))) {
+ case 1:
+ str_replace (&SmimeCryptAlg, "des");
+ break;
+ case 2:
+ str_replace (&SmimeCryptAlg, "des3");
+ break;
+ }
+ break;
+
+ case 2:
+ switch (choice = mutt_multi_choice (_("1: RC2-40, 2: RC2-64, 3: RC2-128 "),
+ _("468"))) {
+ case 1:
+ str_replace (&SmimeCryptAlg, "rc2-40");
+ break;
+ case 2:
+ str_replace (&SmimeCryptAlg, "rc2-64");
+ break;
+ case 3:
+ str_replace (&SmimeCryptAlg, "rc2-128");
+ break;
+ }
+ break;
+
+ case 3:
+ switch (choice = mutt_multi_choice (_("1: AES128, 2: AES192, 3: AES256 "),
+ _("895"))) {
+ case 1:
+ str_replace (&SmimeCryptAlg, "aes128");
+ break;
+ case 2:
+ str_replace (&SmimeCryptAlg, "aes192");
+ break;
+ case 3:
+ str_replace (&SmimeCryptAlg, "aes256");
+ break;
+ }
+ break;
+
+ case 4: /* (c)lear */
+ mem_free (&SmimeCryptAlg);
+ /* fallback */
+ case -1: /* Ctrl-G or Enter */
+ choice = 0;
+ break;
+ }
+ } while (choice == -1);
}
break;