Skip to content

Commit

Permalink
contrib/smime.rc: $smime_verify_opaque_command fallback to -noverify
Browse files Browse the repository at this point in the history
to get signed text despite a failed -verify (but send only this first
failure notice to stderr).
smime.c: fflush() before rewind().
Closes #2428. Helps Debian Bug 420014

--HG--
branch : HEAD
  • Loading branch information
Alain Bench committed Apr 30, 2007
1 parent aefa9fd commit 820af47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion contrib/smime.rc
Expand Up @@ -79,7 +79,9 @@ set smime_decrypt_command="openssl smime -decrypt -passin stdin -inform DER -in
set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f"

# Verify a signature of type application/x-pkcs7-mime
set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s %C"
set smime_verify_opaque_command="\
openssl smime -verify -inform DER -in %s %C || \
openssl smime -verify -inform DER -in %s -noverify 2>/dev/null"



Expand Down
9 changes: 5 additions & 4 deletions smime.c
Expand Up @@ -859,8 +859,8 @@ static int smime_handle_cert_email (char *certificate, char *mailbox,

fflush (fpout);
rewind (fpout);
rewind (fperr);
fflush (fperr);
rewind (fperr);


while ((fgets (email, sizeof (email), fpout)))
Expand Down Expand Up @@ -954,8 +954,8 @@ static char *smime_extract_certificate (char *infile)

fflush (fpout);
rewind (fpout);
rewind (fperr);
fflush (fperr);
rewind (fperr);
empty = (fgetc (fpout) == EOF);
if (empty)
{
Expand Down Expand Up @@ -1000,8 +1000,8 @@ static char *smime_extract_certificate (char *infile)

fflush (fpout);
rewind (fpout);
rewind (fperr);
fflush (fperr);
rewind (fperr);
empty = (fgetc (fpout) == EOF);
if (empty)
{
Expand Down Expand Up @@ -1063,8 +1063,8 @@ static char *smime_extract_signer_certificate (char *infile)

fflush (fpout);
rewind (fpout);
rewind (fperr);
fflush (fperr);
rewind (fperr);
empty = (fgetc (fpout) == EOF);
if (empty)
{
Expand Down Expand Up @@ -1750,6 +1750,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile)

if (s->flags & M_DISPLAY)
{
fflush (smimeerr);
rewind (smimeerr);

if ((c = fgetc (smimeerr)) != EOF)
Expand Down

0 comments on commit 820af47

Please sign in to comment.