Fix late opening of output file
authorRichard Levitte <levitte@openssl.org>
Mon, 23 Apr 2018 08:26:05 +0000 (10:26 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 23 Apr 2018 08:52:39 +0000 (10:52 +0200)
commit7afe18bd003ff7477168626d99efb5a297f2df39
treedf38352b8cfc2b9ba901ce9a3af73c1d3f8ff358
parentbf21fe935a979c08292d06553ef8c9a49382208c
Fix late opening of output file

For 'openssl dhparams', the output file was opened after calculations
were made, which is a waste of cycles and time if the output file
turns out not to be writable.

Fixes #3404

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6051)

(cherry picked from commit 10b37541dc7f27b0ca74102970691ce4636cc0bd)
apps/dhparam.c