push username, homedir and tmpdir in lua too.
[apps/madmutt.git] / lib-sys / mutt_ssl.c
index 4c7137a..745141b 100644 (file)
@@ -143,7 +143,7 @@ static int ssl_init (void)
     /* load entropy from egd sockets */
 #ifdef HAVE_RAND_EGD
     add_entropy (getenv ("EGDSOCKET"));
-    snprintf (path, sizeof (path), "%s/.entropy", NONULL (Homedir));
+    snprintf (path, sizeof (path), "%s/.entropy", NONULL(MCore.homedir));
     add_entropy (path);
     add_entropy ("/tmp/entropy");
 #endif
@@ -333,9 +333,6 @@ static int ssl_socket_close (CONNECTION * conn)
 
   if (data) {
     SSL_shutdown (data->ssl);
-#if 0
-    X509_free (data->cert);
-#endif
     SSL_free (data->ssl);
     SSL_CTX_free (data->ctx);
     p_delete(&conn->sockdata);
@@ -398,7 +395,7 @@ static int tls_close (CONNECTION * conn)
 
 static char *x509_get_part (char *line, const char *ndx)
 {
-  static char ret[SHORT_STRING];
+  static char ret[STRING];
   char *c, *c2;
 
   m_strcpy(ret, sizeof(ret), _("Unknown"));
@@ -528,8 +525,8 @@ static int check_certificate_by_digest (X509 * peercert)
 static int ssl_check_certificate (sslsockdata * data)
 {
   char *part[] = { "/CN=", "/Email=", "/O=", "/OU=", "/L=", "/ST=", "/C=" };
-  char helpstr[SHORT_STRING];
-  char buf[SHORT_STRING];
+  char helpstr[STRING];
+  char buf[STRING];
   MUTTMENU *menu;
   int done, row, i;
   FILE *fp;
@@ -554,42 +551,42 @@ static int ssl_check_certificate (sslsockdata * data)
   menu->max = 19;
   menu->dialog = p_new(char *, menu->max);
   for (i = 0; i < menu->max; i++)
-    menu->dialog[i] = p_new(char, SHORT_STRING);
+    menu->dialog[i] = p_new(char, STRING);
 
   row = 0;
-  m_strcpy(menu->dialog[row], SHORT_STRING,
+  m_strcpy(menu->dialog[row], STRING,
            _("This certificate belongs to:"));
   row++;
   name = X509_NAME_oneline (X509_get_subject_name (data->cert),
                             buf, sizeof (buf));
   for (i = 0; i < 5; i++) {
     c = x509_get_part (name, part[i]);
-    snprintf (menu->dialog[row++], SHORT_STRING, "   %s", c);
+    snprintf (menu->dialog[row++], STRING, "   %s", c);
   }
 
   row++;
-  m_strcpy(menu->dialog[row], SHORT_STRING,
+  m_strcpy(menu->dialog[row], STRING,
            _("This certificate was issued by:"));
   row++;
   name = X509_NAME_oneline (X509_get_issuer_name (data->cert),
                             buf, sizeof (buf));
   for (i = 0; i < 5; i++) {
     c = x509_get_part (name, part[i]);
-    snprintf (menu->dialog[row++], SHORT_STRING, "   %s", c);
+    snprintf (menu->dialog[row++], STRING, "   %s", c);
   }
 
   row++;
-  snprintf (menu->dialog[row++], SHORT_STRING, "%s",
+  snprintf (menu->dialog[row++], STRING, "%s",
             _("This certificate is valid"));
-  snprintf (menu->dialog[row++], SHORT_STRING, _("   from %s"),
+  snprintf (menu->dialog[row++], STRING, _("   from %s"),
             asn1time_to_string (X509_get_notBefore (data->cert)));
-  snprintf (menu->dialog[row++], SHORT_STRING, _("     to %s"),
+  snprintf (menu->dialog[row++], STRING, _("     to %s"),
             asn1time_to_string (X509_get_notAfter (data->cert)));
 
   row++;
   buf[0] = '\0';
   x509_fingerprint (buf, sizeof (buf), data->cert);
-  snprintf (menu->dialog[row++], SHORT_STRING, _("Fingerprint: %s"), buf);
+  snprintf (menu->dialog[row++], STRING, _("Fingerprint: %s"), buf);
 
   menu->title = _("SSL Certificate check");