return NULL;
}
- t = mutt_new_body ();
+ t = body_new();
t->type = TYPEMULTIPART;
t->subtype = m_strdup("signed");
t->encoding = ENC7BIT;
t->use_disp = 0;
t->disposition = DISPINLINE;
- mutt_generate_boundary (&t->parameter);
- mutt_set_parameter ("protocol",
- use_smime ? "application/pkcs7-signature"
- : "application/pgp-signature", &t->parameter);
+ parameter_set_boundary(&t->parameter);
+ parameter_setval(&t->parameter, "protocol",
+ use_smime ? "application/pkcs7-signature"
+ : "application/pgp-signature");
/* Get the micalg from gpgme. Old gpgme versions don't support this
for S/MIME so we assume sha-1 in this case. */
if (!get_micalg (ctx, buf, sizeof buf))
- mutt_set_parameter ("micalg", buf, &t->parameter);
+ parameter_setval(&t->parameter, "micalg", buf);
else if (use_smime)
- mutt_set_parameter ("micalg", "sha1", &t->parameter);
+ parameter_setval(&t->parameter, "micalg", "sha1");
gpgme_release (ctx);
t->parts = a;
a = t;
- t->parts->next = mutt_new_body ();
+ t->parts->next = body_new();
t = t->parts->next;
t->type = TYPEAPPLICATION;
if (use_smime) {
t->subtype = m_strdup("pkcs7-signature");
- mutt_set_parameter ("name", "smime.p7s", &t->parameter);
+ parameter_setval(&t->parameter, "name", "smime.p7s");
t->encoding = ENCBASE64;
t->use_disp = 1;
t->disposition = DISPATTACH;
if (!outfile)
return NULL;
- t = mutt_new_body ();
+ t = body_new();
t->type = TYPEMULTIPART;
t->subtype = m_strdup("encrypted");
t->encoding = ENC7BIT;
t->use_disp = 0;
t->disposition = DISPINLINE;
- mutt_generate_boundary (&t->parameter);
- mutt_set_parameter ("protocol", "application/pgp-encrypted", &t->parameter);
+ parameter_set_boundary(&t->parameter);
+ parameter_setval(&t->parameter, "protocol", "application/pgp-encrypted");
- t->parts = mutt_new_body ();
+ t->parts = body_new();
t->parts->type = TYPEAPPLICATION;
t->parts->subtype = m_strdup("pgp-encrypted");
t->parts->encoding = ENC7BIT;
- t->parts->next = mutt_new_body ();
+ t->parts->next = body_new();
t->parts->next->type = TYPEAPPLICATION;
t->parts->next->subtype = m_strdup("octet-stream");
t->parts->next->encoding = ENC7BIT;
if (!outfile)
return NULL;
- t = mutt_new_body ();
+ t = body_new();
t->type = TYPEAPPLICATION;
t->subtype = m_strdup("pkcs7-mime");
- mutt_set_parameter ("name", "smime.p7m", &t->parameter);
- mutt_set_parameter ("smime-type", "enveloped-data", &t->parameter);
+ parameter_setval(&t->parameter, "name", "smime.p7m");
+ parameter_setval(&t->parameter, "smime-type", "enveloped-data");
t->encoding = ENCBASE64; /* The output of OpenSSL SHOULD be binary */
t->use_disp = 1;
t->disposition = DISPATTACH;
bb->offset = saved_b_offset;
fclose (tmpfp);
rewind (*fpout);
- mutt_free_body (cur);
+ body_list_wipe(cur);
*cur = tmp_b;
}
return *cur ? 0 : -1;
/* fix the content type */
- mutt_set_parameter ("format", "fixed", &b->parameter);
- mutt_set_parameter ("x-action", enc ? "pgp-encrypted" : "pgp-signed",
- &b->parameter);
-
+ parameter_setval(&b->parameter, "format", "fixed");
+ parameter_setval(&b->parameter, "x-action",
+ enc ? "pgp-encrypted" : "pgp-signed");
return 1;
}
{
char buf[HUGE_STRING];
short complete, armor_header;
- FGETCONV *fc;
+ fgetconv_t *fc;
char *fname;
FILE *fp;
copy_clearsigned (armored_data, s, body_charset);
}
else if (pgpout) {
- FGETCONV *fc;
+ fgetconv_t *fc;
int c;
rewind (pgpout);
: _("[-- End of PGP/MIME encrypted data --]\n"), s);
}
- mutt_free_body (&tattach);
+ body_list_wipe(&tattach);
}
fclose (fpout);
_("[-- End of S/MIME encrypted data --]\n"), s);
}
- mutt_free_body (&tattach);
+ body_list_wipe(&tattach);
}
fclose (fpout);