Fix openssl passwd -1
[oweals/openssl.git] / apps / dhparam.c
index f570f5f02489a9e96fc405671302f5a0161a58f7..5f9b60148d6fb60610a7abaf887b2be721d137e6 100644 (file)
@@ -285,7 +285,7 @@ bad:
                        DSA *dsa;
                        
                        BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
-               dsa = DSA_generate_parameters(num, NULL, 0, NULL, NULL, dh_cb, bio_err);
+                       dsa = DSA_generate_parameters(num, NULL, 0, NULL, NULL, dh_cb, bio_err);
                        if (dsa == NULL)
                                {
                                ERR_print_errors(bio_err);
@@ -391,7 +391,15 @@ bad:
                goto end;
                }
        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)
@@ -496,7 +504,7 @@ bad:
        ret=0;
 end:
        if (in != NULL) BIO_free(in);
-       if (out != NULL) BIO_free(out);
+       if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
        EXIT(ret);
        }