When a certificate CN is not the same as the file-name then show-expire
must calculate the expiry date, in seconds, from the database field.
This is done by functions:
* db_date_to_iso_8601_date()
Translate from database format to ISO_8601 date format.
* iso_8601_timestamp_to_seconds()
Translate from ISO_86012 date format to time-stamp in seconds.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
If '--vars=vars' is used, without specifying a path to 'vars', then
sourcing 'vars' fails to find './vars'. POSIX '.' searches the PATH
when the file-name does not contain a slash '/'. [man dot(1p)]
Since EasyRSA expects the 'vars' file to be within the current working
directory, setting 'PATH=./' forces '.' to search ONLY './'.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
The option 'soft' for 'init-pki' has been found to be flawed, because
keeping the 'vars' file in the PKI is now forbidden. The 'soft' option
will be removed in due course.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
For 'init-pki, disable creating vars.example, which also disables
creating a vars file in the PKI.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
The default 'vars' file MUST be "$PWD/vars", no other file can be default.
In order to enforce that, a default 'pki/vars' file MUST be forbidden.
This patch:
* Disables the recommandation for 'vars' to be moved TO the PKI, './pki/vars.
* Forbids the file called './pki/vars'.
* Forbids multiple 'vars' files
* Recommends ONLY the working directory copy of a 'vars' file.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
The upgrade function is no longer required.
Easy-RSA version 3.1.6 provides full upgrade path for older PKIs.
For rare PKIs which do not have 'unique_subject = no' set
in the 'index.txt.attr' file, fall back to SSL error.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Forbid any path ending with '/', '\' or ':'
This protects user variables for paths from being set to the root folder.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This allows a client that has not built a CA to use 'inline'.
The CA and signed client certificate can be sent to the client,
allowing the client to create a complete X509 based inline file,
without creating a redundant CA.
Also, add 'inline' command to the list of commands which do not
require a CA.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Expose 'inline' command to command line.
Inline available data and ignore missing files.
This function prints the available inline data to stdout.
To create inline files the data must be redirected to a file.
Internally, this redirection is taken care of.
Return 'soft' error when any data is missing but always print
available data.
This behaviour allows for incomplete inline files. For example,
when a CA signs a certificate but does not have the private key.
Any combination of missing files is allowed.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
nix.sh/win.sh/busybox.sh never return error from unset
when an invalid variable name 'a=b' is used with a value
to set, eg. 'c'; This causes EasyRSA to execute:
eval "export a=b=c".
'set_var EASYRSA_PKI=pki' results in $EASYRSA_PKI being
set to 'pki=pki-', without error!
Guard against this possible user error with 'case'.
Minor improvements to other input checks.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Add markdown links to documents referred to in README.md and
doc/EasyRSA-Readme.md
Signed-off-by: Junichi Uekawa <dancer@debian.org>
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>