1865 Commits

Author SHA1 Message Date
f4762ff0af remove crl distribution url from ca 2024-02-19 15:42:07 +00:00
067b67c1d7 added full path to commands 2024-02-18 09:02:46 +00:00
5c4815109e added full path to commands 2024-02-18 08:54:15 +00:00
770c1c2e98 added full path to commands 2024-02-18 08:48:39 +00:00
75df850bef modified gitignore 2024-02-16 07:29:25 +00:00
4d2ba5b93f add vars 2024-02-15 15:36:15 +00:00
667c2b8c62 easyrsa modified and working 2024-02-15 12:26:31 +00:00
Richard T Bonhomme
3c233d279d
Merge branch 'TinCanTech-reuse-select_vars'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-10 20:53:35 +01:00
Richard T Bonhomme
a858d1bddd
Merge branch 'reuse-select_vars' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-reuse-select_vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-10 20:52:34 +01:00
Richard T Bonhomme
17946f39b2
Improve select_vars() and source_vars()
Allow reuse of select_vars() by not also calling source_vars().

Minor improvement to error detection in source_vars().

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-10 20:32:00 +01:00
Richard T Bonhomme
d958f1b9a5
Merge branch 'TinCanTech-adjust-warnings'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-10 18:48:34 +01:00
Richard T Bonhomme
febdc86c4b
Merge branch 'adjust-warnings' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-adjust-warnings
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-10 18:47:56 +01:00
Richard T Bonhomme
0fa7218848
init-pki, User message: Replace use of $vars with $EASYRSA_VARS_FILE
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-10 18:36:23 +01:00
Richard T Bonhomme
774b9c5622
Replace santize_path() and ignore Windows "security" warning
sanitize_path() is unnecessary and simply replaced by a condition
in init_pki(), to protect against use of root / directory.

Push the dubious Easy-RSA Windows "security" warning to verbose mode.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-09 19:11:32 +01:00
Richard T Bonhomme
00efeb88a3
Merge branch 'TinCanTech-update-advanced-global-env-vars'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-01 23:56:11 +01:00
Richard T Bonhomme
b2dab1e868
Merge branch 'update-advanced-global-env-vars' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-update-advanced-global-env-vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-01 23:55:24 +01:00
Richard T Bonhomme
99fd046612
Merge branch 'TinCanTech-vars-hierarchy-v2'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-01 23:37:01 +01:00
Richard T Bonhomme
eba3a821b2
Merge branch 'vars-hierarchy-v2' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-vars-hierarchy-v2
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-01 23:36:02 +01:00
Richard T Bonhomme
de708b411f
ChangeLog: Add reference commit ID ecd65065
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-01 20:50:33 +01:00
Richard T Bonhomme
ed5d7f4cf0
Unit-tests: Update shellcheck to version 0.9.0
Dependency, completed:
- Upload new shellcheck binary to Openvpn/easyrsa-unit-tests repository.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-10-01 13:50:07 +01:00
Richard T Bonhomme
edcc61c49b
select_vars: Selective use of default "$PWD/pki/vars"
If either EASYRSA or EASYRSA_PKI is already defined when searching for
default "$PWD/pki/var" then ignore this default vars file.

If EASYRSA_PKI is defined then do not load a vars file from a different PKI.
If EASYRSA is defined then do not load a vars file from any PKI.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-29 18:58:29 +01:00
Richard T Bonhomme
9db0671d70
select_vars: Correct use of set_var syntax
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-29 18:15:48 +01:00
Richard T Bonhomme
29bd64ceb0
select_vars: Set "expected" values ONLY when "$PWD/pki/vars" is used
Vars 'expected_EASYRSA' and 'expected_EASYRSA_PKI' must only be set
when "$PWD/pki/vars" is used. This is the only file which can set the
PKI to an "unexpected" location.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-29 03:02:34 +01:00
Richard T Bonhomme
61ce4a009c
doc: Update EasyRSA-Advanced.md environment variable list
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-26 00:33:37 +01:00
Richard T Bonhomme
302fa37a79
ChangeLog: Rewrite vars-auto-detect, adhere to EasyRSA-Advanced.md
Additional:
Caveat: The default '$PWD/pki/vars' file is forbidden to change either
        EASYRSA or EASYRSA_PKI, which are both implied by default.

NOTICE: vars-auto-detect no longer searches easyrsa program directory.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-25 01:49:46 +01:00
Richard T Bonhomme
587510b52f
Improve warnings for default pki/vars changing EASYRSA/EASYRSA_PKI
Also, remove unused variable $expected_pki.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 23:49:27 +01:00
Richard T Bonhomme
11c510ef9c
Remove unused variable $found_vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 22:21:30 +01:00
Richard T Bonhomme
79571583e5
Remove unused function vars_setup()
Replaced by: select_vars(), source_vars() and default_vars().

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 22:15:45 +01:00
Richard T Bonhomme
f05adaf9d7
select_vars: Establish correct hierarchy to assign EASYRSA_VARS_FILE
All candidate vars-files are searched for and EASYRSA_VARS_FILE is set
to the first valid vars-file found. According to Advanced.md

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 21:37:35 +01:00
Richard T Bonhomme
632b369cd6
Simplify select_vars(): Use EASYRSA_NO_VARS or EASYRSA_VARS_FILE
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 21:11:42 +01:00
Richard T Bonhomme
cc9a19cf28
help, status: Use EASYRSA_VARS_FILE for 'vars-file:' detection
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 19:31:00 +01:00
Richard T Bonhomme
1d0ecaf17b
New function: validate_default_vars()
Check that sourcing default pki/vars has NOT changed EASYRSA or EASYRSA_PKI.
This will be resolved in v3.2.0 - See #comment for details.

Refactor select_vars():
To: single if/elif/else/fi.
From: separate if/fi statements.
Always set EASYRSA_VARS_FILE to the used vars-file.
(Required for 'help' status)

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 19:20:09 +01:00
Richard T Bonhomme
dd702802c1
Replace vars_setup with select_vars, source_vars and default_vars
vars_setup was trying to do more work than only setting up vars.
These tasks have been broken down as follows:

select_vars:
* Choose only ONE vars file to source by priority specified in Advanced.md
* Apply restrictions to default vars changing EASYRSA or EASYRSA_PKI.

source_vars:
* Verify and source a vars file.

default_vars:
* Set all default values as expected.

Note: Also disable use of vars_setup.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 17:02:59 +01:00
Richard T Bonhomme
ecd65065e3
Advanced.md: Correct auto-load order and Remove program location
Correct auto-load order:
The previous order was to search the default PKI before EASYRSA.
Change: EASYRSA is moved to a higher priority than a default PKI.

Remove 'program location' as a valid target for auto-loading vars.
Keeping writable data files in the same folder as executable code
is not necessary.  If it is required then use of other options is
preferred. eg: --vars=<FILE> or $EASYRSA

Add additional information regarding use of default PKI.
Add section to advise the preferred use of --pki over --vars.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-24 16:30:43 +01:00
Richard T Bonhomme
060299f3df
Merge branch 'TinCanTech-improve-vars-auto-load'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-21 23:30:07 +01:00
Richard T Bonhomme
49ffffc6be
Merge branch 'improve-vars-auto-load' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-improve-vars-auto-load
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-21 23:29:32 +01:00
Richard T Bonhomme
ebbb51def7
vars_setup: Add advice to "Conflicting vars files" error message
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-21 23:25:19 +01:00
Richard T Bonhomme
de3d484c67
Remove EASYRSA and EASYRSA_PKI from built-in vars file generation
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-21 15:22:12 +01:00
Richard T Bonhomme
3b4b5f37c7
Ignore conflicting vars files for commands which do not require vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-20 23:37:14 +01:00
Richard T Bonhomme
2720fc103a
Remove useless option --no-safe-ssl
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-20 21:49:09 +01:00
Richard T Bonhomme
f68e5d4c2c
ChangeLog: gen-crl: preserve existing crl.pem ownership+mode
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-20 21:35:28 +01:00
Richard T Bonhomme
f426149d90
Merge branch 'Tabiskabis-gen_crl-preserve-permissions'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-20 21:22:32 +01:00
Richard T Bonhomme
057fba01e8
Merge branch 'gen_crl-preserve-permissions' of ssh://github.com/Tabiskabis/easy-rsa into Tabiskabis-gen_crl-preserve-permissions
Amendments:
* Remove trailing space.
* Catch error on update.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-20 21:19:04 +01:00
Richard T Bonhomme
0f1064ef00
Rename option --pki-dir to --pki but continue support for --pki-dir
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-20 10:52:12 +01:00
Richard T Bonhomme
7b38d99b4c
vars: Forbid auto-loaded "$EASYRSA_PKI/vars" from changing the PKI
If a vars file in the PKI tries to change the expected PKI then fail.

Allow vars file in the working directory to change the PKI.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-19 03:21:25 +01:00
Richard T Bonhomme
f47b491346
vars: Remove program directory as a valid "vars auto-load" candidate
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-19 01:59:39 +01:00
Richard T Bonhomme
8d7e017066
vars: Improve auto-load logic
The main changes made are:
* If EASYRSA is set then only allow default vars file. No auto-load
* If EASYRSA_PKI is set then allow also EASYRSA_PKI/vars. Use auto-load.

This is something like "The Three Laws"; vars auto-load is unnecassary
and should be replaced by a single default vars file. However, here is
the latest version:

1. The DEFAULT vars file is in the working directory: ./vars
2. Using --vars=<FILE>, takes priority ALWAYS. NO auto-load!
3. Using --pki-dir=<DIR>, allows "$EASYRSA_PKI/vars". Use auto-load!

Note:
A user set PKI can auto-load a default vars file in the PKI, however,
that can also conflict with a default ./vars file.

4. ERROR, if vars auto-load finds more than one VIABLE vars file.

Viable vars files and conflicts:
1. "$PWD/vars" - Can conflict.
2. "$PWD/pki/vars" - Can conflict.
3. "$EASYRSA/vars" - User defined EASYRSA, no conflict.
4. "$EASYRSA_PKI/vars" - User defined EASYRSA_PKI, can conflict.

This is achieved by making the following changes:

Prioritise user-set EASYRSA to force "$EASYRSA/vars" ONLY.
No auto-load.

Expand assigning EASYRSA_PKI/vars to test for user-set PKI or default PKI.
Use auto-load.

Remove unused code and improve comments.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-19 01:16:12 +01:00
Richard T Bonhomme
e6b8e62c92
ChangeLog: Minor version correction for v3.1.7
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-17 21:31:42 +01:00
Richard T Bonhomme
a409867e84
Merge branch 'TinCanTech-make-vars'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-17 21:05:27 +01:00
Richard T Bonhomme
582aadeea7
Merge branch 'make-vars' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-make-vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-17 21:04:58 +01:00