Fix openssl passwd -1
[oweals/openssl.git] / apps / pkcs7.c
index d7feafd2f582e5efc6766b7842b27ae88db12593..0af269007ac71422d352330c80ff0d03ec6125d4 100644 (file)
@@ -78,6 +78,8 @@
  * -print_certs
  */
 
+int MAIN(int, char **);
+
 int MAIN(int argc, char **argv)
        {
        PKCS7 *p7=NULL;
@@ -194,7 +196,15 @@ bad:
                }
 
        if (outfile == NULL)
+               {
                BIO_set_fp(out,stdout,BIO_NOCLOSE);
+#ifdef VMS
+               {
+               BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+               out = BIO_push(tmpbio, out);
+               }
+#endif
+               }
        else
                {
                if (BIO_write_filename(out,outfile) <= 0)
@@ -278,6 +288,6 @@ bad:
 end:
        if (p7 != NULL) PKCS7_free(p7);
        if (in != NULL) BIO_free(in);
-       if (out != NULL) BIO_free(out);
+       if (out != NULL) BIO_free_all(out);
        EXIT(ret);
        }