X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-crypt%2Fsmime.c;h=24ed09a765b28ee9e9e85a54863f84384bbdd0f4;hb=d8aeb41018aaf2f85fbd937278ffdd94164e236e;hp=eb554e9b2e38d4ada1c70ff1410e4c85d6b20285;hpb=5b0581b41f115cd0442037a97db313ef5b5b8822;p=apps%2Fmadmutt.git diff --git a/lib-crypt/smime.c b/lib-crypt/smime.c index eb554e9..24ed09a 100644 --- a/lib-crypt/smime.c +++ b/lib-crypt/smime.c @@ -9,15 +9,11 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include -#include -#include -#include -#include -#include +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif #include @@ -26,30 +22,10 @@ #include #include "mutt.h" +#include "alias.h" #include "handler.h" #include "copy.h" - - -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_LOCALE_H -#include -#endif - -#ifdef HAVE_SYS_TIME_H -# include -#endif - -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif - +#include "alias.h" #include "crypt.h" struct smime_command_context { @@ -258,7 +234,6 @@ static void mutt_smime_command (char *d, ssize_t dlen, { mutt_FormatString (d, dlen, NONULL (fmt), _mutt_fmt_smime_command, (unsigned long) cctx, 0); - debug_print (2, ("%s\n", d)); } static pid_t smime_invoke (FILE ** smimein, FILE ** smimeout, @@ -760,7 +735,7 @@ char *smime_findKeys (address_t * to, address_t * cc, address_t * bcc) if (fqdn) rfc822_qualify (tmp, fqdn); - tmp = mutt_remove_duplicates (tmp); + address_list_uniq(&tmp); for (p = tmp; p; p = p->next) { char buf[LONG_STRING]; @@ -1308,11 +1283,11 @@ BODY *smime_build_smime_entity (BODY * a, char *certlist) return (NULL); } - t = mutt_new_body (); + t = body_new(); t->type = TYPEAPPLICATION; t->subtype = m_strdup("x-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; @@ -1424,23 +1399,23 @@ BODY *smime_sign_message (BODY * a) return (NULL); /* fatal error while signing */ } - 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); + parameter_set_boundary(&t->parameter); /* check if this can be extracted from private key somehow.... */ - mutt_set_parameter ("micalg", "sha1", &t->parameter); - mutt_set_parameter ("protocol", "application/x-pkcs7-signature", - &t->parameter); + parameter_setval(&t->parameter, "micalg", "sha1"); + parameter_setval(&t->parameter, "protocol", + "application/x-pkcs7-signature"); t->parts = a; a = t; - t->parts->next = mutt_new_body (); + t->parts->next = body_new(); t = t->parts->next; t->type = TYPEAPPLICATION; t->subtype = m_strdup("x-pkcs7-signature"); @@ -1456,19 +1431,11 @@ BODY *smime_sign_message (BODY * a) } - - - - /* * Handling S/MIME - bodies. */ - - - - static pid_t smime_invoke_verify (FILE ** smimein, FILE ** smimeout, FILE ** smimeerr, int smimeinfd, int smimeoutfd,