Commit Graph
848 Commits
Author SHA1 Message Date
Richard T Bonhomme cf6d9efcea Merge branch 'TinCanTech-new_vars_setup'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 23:20:52 +01:00
Richard T Bonhomme bd7f47ee61 Merge branch 'new_vars_setup' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-new_vars_setup 2022-04-05 23:19:47 +01:00
Richard T Bonhomme 6d7b6c256a Merge branch 'TinCanTech-opt-silent'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 23:00:49 +01:00
Richard T Bonhomme 4809babe23 Merge branch 'opt-silent' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-opt-silent
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 22:58:00 +01:00
Richard T Bonhomme 18248622ec Merge branch 'TinCanTech-shellcheck'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 22:47:27 +01:00
Richard T Bonhomme 917b1dd25b Merge branch 'shellcheck' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-shellcheck 2022-04-05 22:45:47 +01:00
Richard T Bonhomme 72dc76c062 Merge branch 'TinCanTech-copy-x509-types-ca'
Added one newline to terminate the shellcheck directive above.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 22:30:06 +01:00
Richard T Bonhomme 283d4f7fd2 Merge branch 'copy-x509-types-ca' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-copy-x509-types-ca 2022-04-05 22:25:02 +01:00
Richard T Bonhomme 96e79c7371 ChangeLog: Warnings are no longer silenced by --batch (#523)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 21:01:00 +01:00
Richard T Bonhomme fe1dd65ab3 Merge branch 'TinCanTech-renew-del-inline'
Closes: #448

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 18:31:20 +01:00
Richard T Bonhomme 75021037ee Remove inline file for revoke and renew
If an inline file is found that matches the certificate being revoked
or renewed then it will be removed, pending standard confirmation.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 18:18:54 +01:00
Richard T Bonhomme ebcbc8f559 Merge branch 'TinCanTech-fix-gen-req-cn'
Note:

Also added command line option 'text' to include the request text
in the request file.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 16:50:25 +01:00
Richard T Bonhomme 4ec775e4a8 Merge branch 'fix-gen-req-cn' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-gen-req-cn
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 16:49:13 +01:00
Richard T Bonhomme a5669ed574 Insert missing '$'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 16:29:32 +01:00
Richard T Bonhomme c345d0b7b8 Minor formatting correction
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 16:24:14 +01:00
Richard T Bonhomme 4d5a5d4a7b Introduce new vars_setup() regime
vars_setup() now ignores some setup when this is 'init-pki'.
* Do not set anything which requires a PKI.

Remove some undocumented commands, which are known to break Windows.

Find 'vars' in preferred locations and only allow ONE instance.
* Probably a breaking change but only where things are already broken.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 01:27:17 +01:00
Richard T Bonhomme 179aa1763a Actions: Add flag to enable --x509-alt unit tests
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 01:02:59 +01:00
Richard T Bonhomme 57285db4ff Minor improvements - Guard from my changes
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-05 00:59:48 +01:00
Richard T Bonhomme 393a510cf4 shellcheck recommendations (Ongoing)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-04 00:52:38 +01:00
Richard T Bonhomme ee51c1cc91 Unit-test: Only use shellcheck if easyrsa is present in ./easyrsa3/
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-03 22:03:58 +01:00
Richard T Bonhomme 6f138abb5b Allow build_ca() to accept OpenSSL '-addext' as raw data
Set env:var:
EASYRSA_EXTRA_EXTS="-addext foo,a:b -addext bah,c:d -addext baz e:f,g"

The value of EASYRSA_EXTRA_EXTS is passed as-is to the SSL command.

Creating a CA does not allow for an arbitrary extensions file, therefore
extensions must be added via the config file (#526) or via SSL Library
option '-addext' (Can be specified to SSL multiple times).

Option '-addext' is allowed to be specified multiple times to SSL,
therefore, this string must be syntactically correct for SSL not EasyRSA.

Finally, rename EASYRSA_EXTRA_EXTS to EASYRSA_CA_EXTRA_EXTS to avoid
triggering EASYRSA_EXTRA_EXTS code buried inside of easyrsa_openssl().

Closes: #54

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-03 03:13:39 +01:00
Richard T Bonhomme 7227adcca2 Rigorously quote all use of "$EASYRSA_BATCH"
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-03 02:31:55 +01:00
Richard T Bonhomme bce4dadc43 Use x509-types 'ca' and COMMON when building a CA
To sign a request, easyrsa uses 'openssl ca', which does support -extfile.

To create a CA, easyrsa uses 'openssl req', which does not support -extfile.

Therefore, the x509-types 'ca' and COMMON files cannot be specified using
-extfile to create a CA. Instead, they must be included within the SSL
config file, which 'openssl req' does support.

Using the same awk script from gen_req(), with New Token '#%X509_TYPES%',
the x509-types files 'ca' and COMMON are inserted into the SSL config file.

Closes: #525

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-03 00:10:09 +01:00
Richard T Bonhomme a52d6c5a71 Make gen_req() Always use EASYRSA_REQ_CN as intended
All requests now have the specified commonName <FILE_NAME_BASE>

Changes:

* Separate EASYRSA_BATCH from internal SSL -batch option.
  This makes the code easier to understand.

* If both EASYRSA_BATCH and openssl_batch are unset then full
  inter-active mode is enabled.  The user can verify the input.

  Otherwise SSL interactive is disabled and no user interaction
  is required.

  In either case, all DN fields are fully populated, depending on
  EASYRSA_DN mode ('org' or 'cn_only').

Closes: #456

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-02 15:42:56 +01:00
Richard T Bonhomme ec1bac96cb Separate silent-mode from batch-mode - Respect batch-mode
Introduce EASYRSA_SILENT to enhance the use of EASYRSA_BATCH.
Effected functions: warn()

The change in behaviour is that warn() can ONLY be silenced by
option --silent.  Batch-mode is still respected but silence is not.

For scripts which rely on EasyRSA, if they use option --batch then
the change to restore prevous bevaviour is to use option --sbatch.
Otherwise, export EASYRSA_SILENT=1.

This is a minimal change that preserves batch-mode functionality but
also heeds Warnings, unless NEW option --sbatch is specifcally used.

Warnings should not be silenced by batch-mode.

Closes: #512

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-01 20:53:39 +01:00
Richard T Bonhomme 9970d626c1 Merge branch 'wiscii-remove-copy_data_to_pki' (#521)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-01 16:46:54 +01:00
Wharf in Ships Clothing b25d74e6b7 Remove obsolete function copy_data_to_pki()
Signed-off-by: Wharf in Ships Clothing <wiscii@protonmail.com>
2022-04-01 16:03:52 +01:00
Richard T Bonhomme 821827028e gitignore: Add shellcheck
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-04-01 00:16:55 +01:00
Richard T Bonhomme 0d29396070 General formatting corrections (NFC)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 23:00:47 +01:00
Richard T Bonhomme 14a29f9fca Merge branch 'Antagonym-soft-reset'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 22:50:43 +01:00
Richard T Bonhomme 24a2b4fa77 Merge branch 'soft-reset' of ssh://github.com/Antagonym/easy-rsa into Antagonym-soft-reset
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 22:00:25 +01:00
Richard T Bonhomme 58000f777b Merge branch 'pacija-patch-1'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 19:56:11 +01:00
Richard T Bonhomme 6759e87dd9 Merge branch 'patch-1' of ssh://github.com/pacija/easy-rsa into pacija-patch-1
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 19:54:22 +01:00
Richard T Bonhomme 7c3f41ab68 Merge branch 'TinCanTech-master' (#518)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 13:45:53 +01:00
Richard T Bonhomme dc2da4ed45 Merge branch 'master' of /TinCanTech/easy-rsa into TinCanTech-master
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-31 13:44:29 +01:00
IPv4v6 6bdbc8ef97 Add authority information access example (#307) 2022-03-30 21:43:25 +01:00
Richard T Bonhomme f48e7fe9e3 Archive travis.yml to easyrsa-unit-tests repository
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-30 00:32:39 +01:00
Richard T Bonhomme b3a1d54e8c Merge branch 'TinCanTech-master'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 23:50:26 +01:00
Richard T Bonhomme ef59ea7dd9 copy_data_to_pki(): Immediate exit-with-error or 'shift' on success
This captures any copy errors and/or clears the excess second parameter.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 23:38:37 +01:00
Richard T Bonhomme 4ff6b773d2 Merge branch 'TinCanTech-master' (#515)
Add notice to 'init-pki': 'vars' file has now moved to PKI.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 23:08:00 +01:00
Richard T Bonhomme 7690574315 Add notice to 'init-pki': 'vars' file has now moved to PKI above
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 23:02:14 +01:00
Richard T Bonhomme 672b56b6ba Merge branch 'mxc5178-master'
Minor white-space and typo corrections.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 20:59:00 +01:00
Richard T Bonhomme 59cf4b50d3 Merge branch 'master' of mxc5178/easy-rsa into mxc5178-master (#67)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 20:53:10 +01:00
Richard T Bonhomme 462f12a802 Merge branch 'TinCanTech-master' (#514)
Improve install_data_to_pki(): Create pki/vars at 'init-pki'

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 17:39:48 +01:00
Richard T Bonhomme d88ec8bea3 Improve install_data_to_pki(): Create pki/vars at 'init-pki'
Bug: '$1' is not cleared, therefore 'pki/vars' was always created.

Explicitly require 'context:$1' (init-pki or vars-setup), otherwise die.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 17:30:24 +01:00
Richard T Bonhomme 606cc48874 Merge 'TinCanTech-master' - Add 'init' to install_data_to_pki()
This will create EASYRSA_PKI/vars from example for all new PKIs.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 16:20:17 +01:00
Richard T Bonhomme a6db7f496f When initialising a new PKI, create "$EASYRSA_PKI/vars' from example
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 16:15:01 +01:00
Richard T Bonhomme 90b10c3514 Move 'op_test.orig' to Openvpn/easyrsa-unit-tests repository
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 14:57:01 +01:00
Richard T Bonhomme 615c643473 Rename unit test files
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 14:48:33 +01:00
Richard T Bonhomme 2b2ef5f7b8 Enable shellcheck test - Use version 0.8.0 from easyrsa-unit-tests
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-29 14:00:45 +01:00