1566 Commits

Author SHA1 Message Date
Richard T Bonhomme
bb16726682
Merge branch 'remove-date-code' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove-date-code
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-22 23:48:32 +00:00
Richard T Bonhomme
d561a89eaf
Prioritise GNU and Windows date programs over Mac and busybox
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-21 18:47:02 +00:00
Richard T Bonhomme
67e34ace64
ChangeLog: Replace option --fix-offset with --startdate/--enddate
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-21 01:44:22 +00:00
Richard T Bonhomme
4a8ec3af15
Introduce global options --startdate and --enddate
EasyrSA options to pass values directly to SSL options:
* EasyRSA --startdate=YYYYMMDDhhmmssZ -> SSL -startdate YYYYMMDDhhmmssZ
* EasyRSA --enddate=YYYYMMDDhhmmssZ -> SSL -enddate YYYYMMDDhhmmssZ

Note: Use of --enddate over-rides EASYRSA_CERT_EXPIRE (--days).

Establish requirements for use of --startdate and --enddate

Option --startdate MANDATES the use of --enddate. Otherwise, the valid
period counts from NOW.  If --startdate is 6 months into the future and
--days is set to '1' then the certificate will expire in one 1 day but
not be valid for 6 months. Exit on improper use of --startdate.

Option --enddate is ONLY supported by commands which use 'sign-req'.
Warn when command does not support --enddate.

Use of --enddate MANDATES over-ruling --days.
Warn when --enddate will over-rule --days.

Correct user confirmation dialogue to reflect either number of --days
or date specified by --enddate.

Officially terminate support for --fix-offset.

Move "mutual exclusions" to a function.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-21 01:29:19 +00:00
Richard T Bonhomme
31669cbb9d
Merge branch 'TinCanTech-workflow-checkout-v3'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-17 06:12:09 +00:00
Richard T Bonhomme
e63752fe31
Merge branch 'workflow-checkout-v3' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-workflow-checkout-v3
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-17 06:11:03 +00:00
Richard T Bonhomme
85c3ceb5f4
CI: Update checkout to v3
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-16 20:29:46 +00:00
Richard T Bonhomme
1eaf57b727
Merge branch 'TinCanTech-silence-ssl-with-batch'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-14 20:25:51 +00:00
Richard T Bonhomme
b1af5eeaf0
Merge branch 'silence-ssl-with-batch' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-silence-ssl-with-batch
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-14 20:24:39 +00:00
Richard T Bonhomme
5ba5088df9
Run all tests with EASYRSA_SILENT_SSL=1 (Temporary)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-13 21:05:06 +00:00
Richard T Bonhomme
71bd6ae930
easyrsa_openssl(): Improve failure message
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-13 16:59:51 +00:00
Richard T Bonhomme
fc6d827196
ChangeLog: Introduce option -S|--silent-ssl: Silence SSL output
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-11 16:26:15 +00:00
Richard T Bonhomme
5d33440069
Introduce option -S|--silent-ssl: Silence SSL output
Redirect SSL command error-output to /dev/null (2>/dev/null)

Requires batch mode, otherwise output intended for the user
is also redirected.  In batch mode there is no output intended
for the user.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-11 16:24:28 +00:00
Richard T Bonhomme
7f6f2562b2
escape_hazard(): Test sourcing vars:org fields via subshell first
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-11 02:53:05 +00:00
Richard T Bonhomme
9fec600274
easyrsa_openssl(): Only 'return' on success of called openssl command
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-10 20:34:34 +00:00
Richard T Bonhomme
a27e729a4a
Merge branch 'TinCanTech-prohibit-vars-export'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-10 20:27:25 +00:00
Richard T Bonhomme
59c4e6f62f
Merge branch 'prohibit-vars-export' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-prohibit-vars-export
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-10 20:26:42 +00:00
Richard T Bonhomme
e57fef63f1
Merge branch 'TinCanTech-status-CN-missing-from-index'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-10 20:24:25 +00:00
Richard T Bonhomme
c9acb53229
Merge branch 'status-CN-missing-from-index' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-status-CN-missing-from-index
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-10 20:23:46 +00:00
Richard T Bonhomme
598b8f8617
Exit with error on untrapped error detected
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-09 20:36:27 +00:00
Richard T Bonhomme
7bb3eb5d03
vars_setup(): Refactor '# Sanitize vars' section
Forbid use of 'export' in 'vars' file.

Use one instance of 'grep' to test for prohibited strings.

Move log-output of 'vars' file location to before sourcing it.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-09 19:53:05 +00:00
Richard T Bonhomme
e71a2088d3
Merge branch 'TinCanTech-general-improvements'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-08 22:46:58 +00:00
Richard T Bonhomme
2b0d8f775c
Merge branch 'general-improvements' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-general-improvements
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-08 22:46:21 +00:00
Richard T Bonhomme
d455e84b7e
Status reports: Refactor conditionals that can cause untrapped errors
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-08 22:20:57 +00:00
Richard T Bonhomme
93cefa2e05
Status reports: Warn if given commonName is not found in database
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-08 22:15:38 +00:00
Richard T Bonhomme
6a4798ea5e
Merge branch 'TinCanTech-up23-fix-secure_session'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-07 22:56:47 +00:00
Richard T Bonhomme
c509507541
Merge branch 'up23-fix-secure_session' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-up23-fix-secure_session
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-07 22:56:13 +00:00
Richard T Bonhomme
9149aa8f74
ChangeLog: Always verify SSL lib, for all commands (#877)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-07 22:37:36 +00:00
Richard T Bonhomme
69424ecedb
Standardise use of '$# = N' and associated error messages
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-07 22:03:23 +00:00
Richard T Bonhomme
2343503f94
Prefer parameter expansion '${x:-y}' to test for "null or unset"
EasyRSA allows variables to be set to "" [null], therefore, as a
standard, the script now always tests for null or unset.

IE. Include the colon ':'.

The obvious exception to this is set_var(), which remains as test
for unset ONLY.

set_var() ONLY assigns a value if the variable is currently unset,
otherwise, it would over-write a deliberately empty value.

Also, where it helps readability, separate the expansion operator
from the expandable value, with a space.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-07 20:44:59 +00:00
Richard T Bonhomme
e7c371e44a
Upgrade-23: Remove unnecessary internal call to secure_session()
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-06 01:46:51 +00:00
Richard T Bonhomme
8c6948c4cc
Upgrade_23: Prioritise new PKI creation to allow temp file creation
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-03-06 01:13:52 +00:00
Richard T Bonhomme
940a94dee9
Merge branch 'TinCanTech-gen-crl-minor-improvement'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-25 17:58:40 +00:00
Richard T Bonhomme
ebd5f66db0
Merge branch 'gen-crl-minor-improvement' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-gen-crl-minor-improvement
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-25 17:58:04 +00:00
Richard T Bonhomme
95f4b67703
gen-crl: Minor improvements
Add EASYRSA_CRL_DAYS to command to generate a new CRL.
Although this is taken care of in the SSL config file,
it is easier to understand by having the code incuded
in the script.

Honor batch mode and over write an existing CRL, with
out confirmation.  An out dated CRL is of little value
and the user has specified batch mode, so honor it.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-25 14:56:09 +00:00
Richard T Bonhomme
1dd740f9a5
Merge branch 'TinCanTech-bugfix-req-serial-no-safe-ssl'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-23 13:23:46 +00:00
Richard T Bonhomme
c55b410f52
Merge branch 'bugfix-req-serial-no-safe-ssl' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-bugfix-req-serial-no-safe-ssl
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-23 13:23:01 +00:00
Richard T Bonhomme
8944eae7ac
Use set_var to correctly assign EASYRSA_REQ_SERIAL
This configures EASYRSA_REQ_SERIAL for use in the SSL config file.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-23 13:09:07 +00:00
Richard T Bonhomme
5fa424b913
Merge branch 'TinCanTech-fix-offset-use-enddate'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-21 22:16:21 +00:00
Richard T Bonhomme
04ee3b0977
Merge branch 'fix-offset-use-enddate' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-offset-use-enddate
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-21 22:15:40 +00:00
Richard T Bonhomme
d35e288700
Merge branch 'TinCanTech-move-rand-serial-file'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-21 22:04:02 +00:00
Richard T Bonhomme
32dc387723
Merge branch 'move-rand-serial-file' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-move-rand-serial-file
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-21 22:03:07 +00:00
Richard T Bonhomme
436f77e888
ChangeLog; Only create a random serial number file when expected (#896)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-21 22:01:16 +00:00
Richard T Bonhomme
06fed95730
sign-req: Use either SSL option -days OR -startdate/-enddate
Using --fix-offset will not use -days, only -statdate/-enddate.

Options -startdate/-enddate are absolute dates, not counted from
today by OpenSSL, for any reason.

Fixes some unrelated warnings about incomplete SSL config file,
when using --fix-offset.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-19 22:10:26 +00:00
Richard T Bonhomme
2eda52061b
sign-req: Only create a random serial number file when expected
When EASYRSA_RAND_SN="no", the file pki/serial file is not meant to
be updated by easyrsa. OpenSSL manages the file itself.

Move the code to write the file pki/serial with a random number,
inside the if condition for EASYRSA_RAND_SN, so the file is only
written to by easyrsa, when a random serial number is expected.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-19 21:37:30 +00:00
Richard T Bonhomme
2abc237594
Merge branch 'TinCanTech-ca-password-temp-file-removal'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-14 21:04:37 +00:00
Richard T Bonhomme
58638bcfc2
Merge branch 'ca-password-temp-file-removal' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-ca-password-temp-file-removal
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-14 21:03:42 +00:00
Richard T Bonhomme
88557aae8c
build_ca: Initialise get_passphrase() correctly
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-12 02:37:34 +00:00
Richard T Bonhomme
2dd2767922
build-ca: Deliberately remove manual password in temp-file
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-11 23:11:43 +00:00
Richard T Bonhomme
41f23444c6
Merge branch 'TinCanTech-set_var-v2'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-02-11 21:54:57 +00:00