Use the flag as intended.
Also, improvements to layout and comments, in nearby functions.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
The input data, when a certificate is not found, was an unpunctuated
numerical representation of date. eg: '220613123456'.
Format this input to: '22-06-13 12:34:56' for use.
Also, disambiguate between certificate-data verses database-data
by renaming the database variables from 'crt_foo' to 'db_foo'.
Also, disambiguate between full-date verses epoch-date-seconds
by renaming epoch-date-seconds variables from 'foo' to 'foo_s'.
Also, improvements to status reports output format.
Also, improve related comments.
Closes: #568
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
New function: verify_algo_params()
Verify algorithm and parameters in a single function.
Remove verify_curve_ec() and verify_curve_ed()
Place verify_algo_params() at the end of vars_setup().
No longer use a dedicated directory for Elliptic curve
parameters file. Instead, use an easyrsa-temp file.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Flags are set when a 'vars' file is found:
eg. [ -e "$pki_vars" ] && e_pki_vars=1
Use flag '$e_pki_vars' not the target file variable '$pki_vars' for
subsequent code decisions. Unset '$pki_vars', once it us used.
The same goes for: '$prog_vars', '$pwd_vars' and '$easy_vars'.
Closes: #567
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This check ensures the a valid command does not sneak a missing but
expected 'vars' file through 'vars' detection phase.
Move detect_host() and expand the comment.
Minor reformatting, for readability.
Improve/update comments.
Stage-3-of: #566
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Undo changes made by 4922cae263
which allowed '--vars=FILE init-pki'.
Keep the changes to user output which suppress messages to "use PKI/vars".
Stage-2-of: #566
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Using option '--vars=file' now sets variable 'user_vars_true'.
When 'user_vars_true' then do not create a conflicting PKI/vars.
Also, remove vars-file warnings when 'user_vars_true'.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This allows verify_cert() to show the status and, optionally, return an
error (1) on "failure to verify" to a calling program.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Used with 'renew' to extend the grace period before allowing certificates
to be renewed.
Used with 'show-expire' to extend the period of the search for certificates
which are close to expiring.
Also, correct some comments and minor formatting changes.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
When 'vars' is in the same directory as 'easyrsa' and they are both
in the current working directory, easyrsa would falsely warn about
"conflicting" 'vars' files.
Filter out this false error by checking if '$prog_dir' is './'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Changes to how 'vars' is located and sourced omitted the possibility
that the vars file has been declared via '--vars'.
Move the 'fi' to the correct location so that '--vars' is respected.
Closes: #552 (Over-ruled, due to another, unrelated change)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This has been an on/off release tag, but we're going to push it out
because there are some that will remain on the v3.0.x branch for a
long time, and OpenSSL 3.x isn't available in all distros/embedded
systems yet (or for a while).
- Updated OpenSSL for Windows to 1.1.1o
- Updated ChangeLog for v3.0.9, pulling in most comments for v3.1.0
- Updated header in easyrsa to point to Github contributors page
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
date.exe does not support output format '+%s' as input.
Instead, use date.exe "string" not seconds since epoch.
Also, force easyrsa_openssl() 'makesafeconf' to move the the temp-file
to the target file. Otherwise, Windows users are expected to confirm
over-write, every time.
Also, minor variable name changes, for clarity.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
The initial idea was to mask the actual certificate creation date.
The reason was to further anonymise user certificates. (YMMV)
There is now a second part to this date "fixing":
* This allows for all certificates to expire on the same day.
Using command option '--fix-offset=nnn', all certificates will be created
* with a 'notBefore' date of January 1st of the current year.
* with a 'notAfter' date of the day-of-year number from '--fix-offset',
in the final year, as per EASYRSA_CERT_EXPIRE (Default 825 days).
The default 825 days results in 2 years plus the offset given.
This can also be set in the 'vars' file, for convenience.
The default day-of-year offered is 183; either July 2 or 3 (leap year).
Follow-up to: #550 (Replaces 'nodatetime' with '--fix-offset')
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>