]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - apps/pkcs12.c
On VMS, stdout may very well lead to a file that is written to in a
[thirdparty/openssl.git] / apps / pkcs12.c
index 070993de308ab6ef210802308e27d0d61537255c..6789169bdb48dc7d6c31ebad1c09abee42f66f9e 100644 (file)
@@ -350,8 +350,15 @@ int MAIN(int argc, char **argv)
     CRYPTO_push_info("write files");
 #endif
 
-    if (!outfile) out = BIO_new_fp(stdout, BIO_NOCLOSE);
-    else out = BIO_new_file(outfile, "wb");
+    if (!outfile) {
+       out = BIO_new_fp(stdout, BIO_NOCLOSE);
+#ifdef VMS
+       {
+           BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+           out = BIO_push(tmpbio, out);
+       }
+#endif
+    } else out = BIO_new_file(outfile, "wb");
     if (!out) {
        BIO_printf(bio_err, "Error opening output file %s\n",
                                                outfile ? outfile : "<stdout>");
@@ -657,7 +664,7 @@ int MAIN(int argc, char **argv)
     CRYPTO_remove_all_info();
 #endif
     BIO_free(in);
-    BIO_free(out);
+    BIO_free_all(out);
     if (canames) sk_free(canames);
     if(passin) OPENSSL_free(passin);
     if(passout) OPENSSL_free(passout);