Generate an error if rewinding wasn't possible.
authorRichard Levitte <levitte@openssl.org>
Wed, 8 May 2002 15:12:59 +0000 (15:12 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 8 May 2002 15:12:59 +0000 (15:12 +0000)
Notified by Ken Hirsch <kenhirsch@myself.com>.
PR: 23

apps/smime.c

index b05bd704e88715a825c5e1fc1e5a2895f51183c5..90fe026f567781d86445d240c0e3be6e63eebe4e 100644 (file)
@@ -471,7 +471,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);
                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);
        } else {
                if(informat == FORMAT_SMIME) 
                        p7 = SMIME_read_PKCS7(in, &indata);