This removes our dependency on an external non-POSIX mktemp
implementation and uses openssl's built in rand function.
Addresses #478
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
The openssl call relied on word splitting for $crypto_ops
but $crypto_opts consists of a path which could contain spaces.
Now path is stored in $pass_opts which is quoted when using in
openssl call.
Using another build of OpenSSL that appears to work fine in testing.
Long term, we should be building OpenSSL ourselves and shipping it on a
regular basis. That's another project on the list.
Resolves#405.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
This reverts commit 5f3e5ca450.
There is an incompatibility in 1.1.1g with the EasyRSA script. There
are no new features in 1.1.1g we are leveraging directly, so just going
to revert to support the OpenVPN 2.5 release process and get EasyRSA
v3.x into more hands.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
This fixes an argument error I made in commit 1e98ba808c, sorry I have not tested RSA keys as I only use ED.
The argument is -passout for all openssl versions (tested on LibreSSL 2.8.3 and OpenSSL 1.1.1d).
When a vars file cannot be found, the up23_manage_upgrade_23() function
will now exit and print a message stating such. Previously, it exited
silently.
Fixes#377.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
This resolves a bug where build_ca ignores the nopass flag and always makes non-encrypted private keys when ALGO is "ed".
Also solves build_ca handling of EASYRSA_PASSOUT argument when generating private keys with ALGO set to "ed".
Merge branch 'madmajestro-use-passin-update-db'
Adds support for leveraging the --passin option for the CA private key
password when running the update-db command.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
Merge branch 'madmajestro-setpass-never-returns-0-in-batchmode'
Similar bug to what was fixed in 2953817, with the same fix.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
Merge branch 'madmajestro-imrove-returncode-notice-and-warn'
This resolves a bug where the warn() and notice() functions would
produce a non-zero exit during batch mode operations. This bug was
introduced by me in 09e2c3b.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
The functions notice() and warn() allways exited with an return-code !=
0 if called in batch-mode, which can cause unexpected behavior in the
calling code. Now it is ensured that they return with succes.
Additinally, the Script will now terminate if the printf command in the
function print() fails. This ensures that errors during
output-generation will not be ignored.
If changing passwords in batch-mode, the commands set-rsa-pass and
set-ec-pass allways returned with an exit code != 0 on success.
The origin for this is the implementation of the function notice() which
allway returns an return-code != 0 if called in batch-mode.
This patch fixes the bug by adding a return 0 at the end of set_pass(),
because this is the way this behaviour is fixed in other functions. I
will provide an additional pull-request to improve the functions
notice() and warn().