fp = fopen (SslCertFile, "w+t"); if (fp)
if ((fp = fopen (SslCertFile, "w+t")))
static int ssl_check_certificate (sslsockdata * data){  char *part[] =  {"/CN=", "/Email=", "/O=", "/OU=", "/L=", "/ST=", "/C="};  char helpstr[SHORT_STRING];  char buf[SHORT_STRING];  MUTTMENU *menu;  int done, i;  FILE *fp;  char *line = NULL, *c;  /* automatic check from user's database */  fp = fopen (SslCertFile, "rt");  if (fp)  {    EVP_PKEY *peer = X509_get_pubkey (data->cert);    X509 *savedkey = NULL;    int pass = 0;    while ((savedkey = READ_X509_KEY (fp, &savedkey)))    {      if (X509_verify (savedkey, peer))      {	pass = 1;	break;      }    }    fclose (fp);    if (pass)      return 1;  }  menu = mutt_new_menu ();  menu->max = 15;  menu->dialog = (char **) safe_calloc (1, menu->max * sizeof (char *));  for (i = 0; i < menu->max; i++)    menu->dialog[i] = (char *) safe_calloc (1, SHORT_STRING * sizeof (char));  strncpy (menu->dialog[0], _("This certificate belongs to:"), SHORT_STRING);  line = X509_NAME_oneline (X509_get_subject_name (data->cert),			    buf, sizeof (buf));  for (i = 1; i <= 5; i++)  {    c = x509_get_part (line, part[i - 1]);    snprintf (menu->dialog[i], SHORT_STRING, "   %s", c);  }  strncpy (menu->dialog[7], _("This certificate was issued by:"), SHORT_STRING);  line = X509_NAME_oneline (X509_get_subject_name (data->cert),			    buf, sizeof (buf));  for (i = 8; i <= 12; i++)  {    c = x509_get_part (line, part[i - 8]);    snprintf (menu->dialog[i], SHORT_STRING, "   %s", c);  }  buf[0] = '\0';  x509_fingerprint (buf, sizeof (buf), data->cert);  snprintf (menu->dialog[14], SHORT_STRING, _("Fingerprint: %s"), buf);  menu->title = _("SSL Certificate check");  if (SslCertFile)  {    menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always");    menu->keys = _("roa");  }  else  {    menu->prompt = _("(r)eject, accept (o)nce");    menu->keys = _("ro");  }    helpstr[0] = '\0';  mutt_make_help (buf, sizeof (buf), _("Exit  "), MENU_GENERIC, OP_EXIT);  strncat (helpstr, buf, sizeof (helpstr));  mutt_make_help (buf, sizeof (buf), _("Help"), MENU_GENERIC, OP_HELP);  strncat (helpstr, buf, sizeof (helpstr));  menu->help = helpstr;  done = 0;  while (!done)  {    switch (mutt_menuLoop (menu))    {      case -1:			/* abort */      case OP_MAX + 1:		/* reject */      case OP_EXIT:        done = 1;        break;      case OP_MAX + 3:		/* accept always */        done = 0;	fp = fopen (SslCertFile, "w+t");	if (fp)	{	  if (PEM_write_X509 (fp, data->cert))	    done = 1;	  fclose (fp);	}	if (!done)	  mutt_error (_("Warning: Couldn't save certificate"));	else	  mutt_message (_("Certificate saved"));	sleep (1);        /* fall through */      case OP_MAX + 2:		/* accept once */        done = 2;        break;    }  }  mutt_menuDestroy (&menu);  return (done == 2);}