From: Richard Levitte Date: Wed, 8 May 2002 15:13:35 +0000 (+0000) Subject: Generate an error if rewinding wasn't possible. X-Git-Tag: OpenSSL_0_9_6d~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f8c72ce77837ee47f3cf9af78408e8b1309c8de;p=openssl Generate an error if rewinding wasn't possible. Notified by Ken Hirsch . PR: 23 --- diff --git a/apps/smime.c b/apps/smime.c index 83f9371a58..ebdac15d06 100644 --- a/apps/smime.c +++ b/apps/smime.c @@ -414,7 +414,10 @@ int MAIN(int argc, char **argv) p7 = PKCS7_encrypt(encerts, in, cipher, flags); } else if(operation == SMIME_SIGN) { p7 = PKCS7_sign(signer, key, other, in, flags); - BIO_reset(in); + if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) { + BIO_printf(bio_err, "Can't rewind input file\n"); + goto end; + } } else { if(informat == FORMAT_SMIME) p7 = SMIME_read_PKCS7(in, &indata);