more include simplifications
[apps/madmutt.git] / lib-crypt / smime.c
index 5d773cd..24ed09a 100644 (file)
@@ -9,34 +9,12 @@
  * please see the file GPL in the top level source directory.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <sys/wait.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <ctype.h>
+#include <lib-lib/lib-lib.h>
 
-#ifdef HAVE_LOCALE_H
-#  include <locale.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#  include <sys/time.h>
-#endif
 #ifdef HAVE_SYS_RESOURCE_H
 #  include <sys/resource.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/debug.h>
-
 #include <lib-mime/mime.h>
 
 #include <lib-ui/curses.h>
@@ -256,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,
@@ -758,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];
@@ -1306,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;
@@ -1422,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");
@@ -1454,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,