X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-crypt%2Fsmime.c;h=479fd8c5dee168d62ca94aea3b88c986b2d7617c;hb=676b896e26b7aeef16d95aba7a5ea9322d2dc6e1;hp=d455a3a6eda75390d57b981c1529f0331b71cf32;hpb=23e6291cb5d5b4cd2008403d8b628007fd75ff23;p=apps%2Fmadmutt.git diff --git a/lib-crypt/smime.c b/lib-crypt/smime.c index d455a3a..479fd8c 100644 --- a/lib-crypt/smime.c +++ b/lib-crypt/smime.c @@ -9,45 +9,26 @@ * 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 -#include +#include -#ifdef HAVE_LOCALE_H -# include -#endif -#ifdef HAVE_SYS_TIME_H -# include -#endif #ifdef HAVE_SYS_RESOURCE_H # include #endif -#include -#include -#include -#include - #include +#include #include #include #include -#include "mutt.h" #include "alias.h" #include "handler.h" #include "copy.h" #include "alias.h" + #include "crypt.h" +#include "smime.h" struct smime_command_context { const char *key; /* %k */ @@ -628,15 +609,11 @@ char *smime_get_field_from_db (char *mailbox, char *query, short public, return m_strdup(key); } - - - /* This sets the '*ToUse' variables for an upcoming decryption, where the reuquired key is different from SmimeDefaultKey. */ - -void _smime_getkeys (char *mailbox) +static void _smime_getkeys (char *mailbox) { char *k = NULL; char buf[STRING]; @@ -756,7 +733,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]; @@ -1304,11 +1281,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; @@ -1420,23 +1397,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"); @@ -1452,19 +1429,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,