summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-05-08 15:13:35 +0000
committerRichard Levitte <levitte@openssl.org>2002-05-08 15:13:35 +0000
commit3f8c72ce77837ee47f3cf9af78408e8b1309c8de (patch)
tree87822059f0c73bc75fe7b3931c97f9722dbad7cd /apps
parent35fbadb32266694baea67037c19f96146e06be0e (diff)
Generate an error if rewinding wasn't possible.
Notified by Ken Hirsch <kenhirsch@myself.com>. PR: 23
Diffstat (limited to 'apps')
-rw-r--r--apps/smime.c5
1 files changed, 4 insertions, 1 deletions
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);