X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-sys%2Fmutt_ssl.c;h=745141ba452b780f140019ef49b2cdaf6745e2b1;hp=9d658d423a36b3697f392ce8f4580967bff8d032;hb=2dc50decd320b310ef56c14041b6fa4fefd865ac;hpb=1ee89902de184a640c171ae3285bff6882a791bd diff --git a/lib-sys/mutt_ssl.c b/lib-sys/mutt_ssl.c index 9d658d4..745141b 100644 --- a/lib-sys/mutt_ssl.c +++ b/lib-sys/mutt_ssl.c @@ -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")); @@ -510,7 +507,7 @@ static int check_certificate_by_digest (X509 * peercert) return 0; if (!X509_digest (peercert, EVP_sha1 (), peermd, &peermdlen)) { - fclose (fp); + m_fclose(&fp); return 0; } @@ -520,7 +517,7 @@ static int check_certificate_by_digest (X509 * peercert) break; } X509_free (cert); - fclose (fp); + m_fclose(&fp); return pass; } @@ -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"); @@ -624,7 +621,7 @@ static int ssl_check_certificate (sslsockdata * data) if ((fp = fopen (SslCertFile, "a"))) { if (PEM_write_X509 (fp, data->cert)) done = 1; - fclose (fp); + m_fclose(&fp); } if (!done) { mutt_error (_("Warning: Couldn't save certificate"));