FILE *fpout = NULL, *fperr = NULL;
char tmpfname[_POSIX_PATH_MAX];
char email[STRING];
- int ret = 0;
+ int ret = -1;
pid_t thepid;
mutt_mktemp (tmpfname);
fflush (fperr);
- if (!(fgets (email, sizeof (email), fpout)))
+ while ((fgets (email, sizeof (email), fpout)))
+ {
+ *(email+mutt_strlen(email)-1) = '\0';
+ if(mutt_strncasecmp (email, mailbox, mutt_strlen (mailbox))==0)
+ {
+ ret = 0;
+ break;
+ }
+ ret = 1;
+ }
+ if (ret == -1)
{
mutt_copy_stream (fperr, stdout);
- fclose (fpout);
- fclose (fperr);
mutt_endwin(NULL);
mutt_error (_("Alert: No mailbox specified in certificate.\n"));
- return 1;
+ ret = 1;
}
- *(email+mutt_strlen(email)-1) = '\0';
-
-
- if(mutt_strncasecmp (email, mailbox, mutt_strlen (mailbox)))
+ else if (ret == 1)
{
mutt_endwin(NULL);
mutt_error (_("Alert: Certificate belongs to \"%s\".\n"
empty = (fgetc (fpout) == EOF);
if (empty)
{
+ mutt_endwin (NULL);
mutt_copy_stream (fperr, stdout);
+ mutt_any_key_to_continue (NULL);
fclose (fpout);
fclose (fperr);
mutt_unlink (certfile);
/*
OpenSSl can create a hash value of the certificate's subject.
- This and a concatenated integer make up the certificat's
+ This and a concatenated integer make up the certificate's
'unique id' and also its filename.
*/
mutt_unlink (tmpfname);
+
if (s->flags & M_DISPLAY)
+ {
+ rewind (smimeerr);
mutt_copy_stream (smimeerr, s->fpout);
-
- if (s->flags & M_DISPLAY)
+
state_attach_puts (_("\n[-- End of OpenSSL output --]\n\n"), s);
- if (s->flags & M_DISPLAY)
- {
if (type & ENCRYPT)
state_attach_puts (_("\n[-- The following data is S/MIME"
" encrypted --]\n"), s);