Commit Graph
1240 Commits
Author SHA1 Message Date
Richard T Bonhomme 0fed20bf9e Merge branch 'TinCanTech-ca-x509-types-files'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:36:52 +01:00
Richard T Bonhomme b6748d9fdc Merge branch 'ca-x509-types-files' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-ca-x509-types-files
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:36:03 +01:00
Richard T Bonhomme bceab3ee74 Merge branch 'TinCanTech-add-rebuild'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:34:25 +01:00
Richard T Bonhomme 1582656254 Merge branch 'add-rebuild' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-add-rebuild
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:33:16 +01:00
Richard T Bonhomme 993f504b09 ChangeLog: 'Always ensure X509-types files exist (#581 #696)'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-20 22:26:33 +01:00
Richard T Bonhomme 748c19be21 build-ca: Check x509-types 'ca' and 'COMMON' files exist
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-20 22:05:53 +01:00
Richard T Bonhomme 5736250a91 Merge branch 'TinCanTech-ca-x509-types-checks'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-20 20:32:22 +01:00
Richard T Bonhomme 7a4c3df91a Merge branch 'ca-x509-types-checks' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-ca-x509-types-checks
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-20 20:31:31 +01:00
Richard T Bonhomme 0f50f5c788 Error messages: Minor text-only improvements
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-19 13:33:06 +01:00
Richard T Bonhomme 9524d3361d Error messages: Minor text improvements
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-19 13:22:44 +01:00
Richard T Bonhomme 27c9905aa4 X509-types: Always check SSL config file for EasyRSA insert-markers
Since EasyRSA version 3.1 there is a NEW insert-marker for X509 type 'ca'.

* New insert-marker: '^#%CA_X509_TYPES_EXTRA_EXTS%' [BRE]

This is only required to build a new CA or Sub-CA. However, without this
check, an old version of openssl-easyrsa.cnf will silently FAIL to include
the X509 types for 'ca' and 'COMMON', when builing a new CA.

EasyRSA 'init-pki soft' does leave 'openssl-easyrsa.cnf' in place, which
means that this is a known possible failure.

For consistency, check for All EasyRSA insert-markers, when used.

* Standard insert-markers: '^#%EXTRA_EXTS%' and '^#%COPY_EXTS%' [BRE]

Tested manually.

Closes: #693

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-18 17:32:08 +01:00
Richard T Bonhomme d99bef68e1 Merge branch 'TinCanTech-doc-renew'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-15 21:10:13 +01:00
Richard T Bonhomme 932eea78d4 Merge branch 'doc-renew' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-doc-renew
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-15 21:09:38 +01:00
Richard T Bonhomme b44035c225 Documentation: Add EasyRSA-Renew-and-Revoke.md
Document the various EasyRSA version differences of renewal and revocation.

Closes: #626

Authors comment:
It has taken good luck, hard work and co-operation to save
EasyRSA "renewal and revocation".

I am pleased to have provided the solution presented here.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-15 20:27:55 +01:00
Eric F Crist 43fb5990d8 update OpenSSL to 3.0.5
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-09-14 19:28:55 -05:00
Richard T Bonhomme 6317779ff9 Rename 'renew' to 'rebuild' - Introduce 'renew' version 3
The old 'renew' always created a new private key at the CA signing side.
This forces the entity private key to be exposed, unnecessarily.

Only certificates expire, therefore, only certificates can be renewed.

For those reasons, the old 'renew' has been renamed to 'rebuild'.

The new 'renew' creates a new certificate only from the existing CSR.
The existing CSR will always exist, allowing a certificate to be renewed
indefinitely.

Both 'rebuild' and 'renew' use the renewed/ folders to temporarily store
the old certificate, where it can be revoked with 'revoke-renewed' command.

Manually tested.

Closes: #684

Notes:
* renew version 1 did not have a command to revoke old certificates.
* renew version 2 allowed old certificates to be revoked via command
  'revoke-renewed'.
* renew version 3 only renews the certificate.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-13 13:54:11 +01:00
Richard T Bonhomme d7aa481587 Merge branch 'TinCanTech-remove-renew-req'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-09 19:03:44 +01:00
Richard T Bonhomme 19c4ddbc62 Merge branch 'remove-renew-req' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove-renew-req
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-09 19:00:23 +01:00
Richard T Bonhomme 2850fbb009 Remove renew-req
Phase-2: #684

Supersedes: #616

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-09 14:20:30 +01:00
Richard T Bonhomme 77172864c0 Merge branch 'TinCanTech-renew-req-nopass'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 22:05:25 +01:00
Richard T Bonhomme 8a1d825901 Merge branch 'renew-req-nopass' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-renew-req-nopass
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 22:04:30 +01:00
Richard T Bonhomme 3c9513f406 renew-req: Add command option 'nopass'
Closes: #681

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 21:54:24 +01:00
Richard T Bonhomme 8ebb013339 Option --keep-tmp: Do not remove sign_req() extentions temp file
The extentions temp-file is part of the session temp-dir and is otherwise
removed by cleanup() on successful completion.

Part-of: #667
Closes: #676

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 14:11:53 +01:00
Richard T Bonhomme 46d43aabbb ChangeLog: Re-enable use of '--vars=FILE init-pki' #640 (Revert #566)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 12:59:40 +01:00
Richard T Bonhomme d29dfea2ad Merge branch 'TinCanTech-batch-gen-req'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 12:25:21 +01:00
Richard T Bonhomme caaafdb932 Merge branch 'batch-gen-req' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-batch-gen-req
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 12:24:29 +01:00
Richard T Bonhomme fe3cced16c Option --req-cn: Restore original behavior from v30x series
Due to my previous misunderstanding of the intended use of --req-cn,
it is no longer possible to set commonName for command gen-req.
Ref: #524  #456

This commit restores v30x series behavior:
* --req-cn can only be used in batch mode.
* --req-cn can only be used by commands build-ca and gen-req.
* SSL layer prompts are restored to original behavior.

Important: The use of internal batch mode is no longer required
for command sign_req(), when called by build_full(). This code
has been disabled but remains in place.  This is a considerable
change under the hood but there is no user observable difference.

Also, minor improvements to help and EasyRSA-Advanced.md

Tested manually and thoroughly.

Closes: #668

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-08 11:42:56 +01:00
Richard T Bonhomme 917d078045 Merge branch 'TinCanTech-keep-temp-files'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-02 16:32:31 +01:00
Richard T Bonhomme 7174602844 Merge branch 'keep-temp-files' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-keep-temp-files
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-02 16:31:14 +01:00
Richard T Bonhomme 1dfd7307d5 ChangeLog: Add --keep-tmp
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-02 15:41:57 +01:00
Richard T Bonhomme b90798387f Options: Typo, rename --keep-temp to --keep-tmp
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-02 15:35:31 +01:00
Richard T Bonhomme 48e7d0a593 Merge branch 'TinCanTech-expand-days'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-01 21:28:37 +01:00
Richard T Bonhomme df6b8bf1a1 Merge branch 'expand-days' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-expand-days
Minor help output change: Remove useless 'N/A'

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-01 21:25:19 +01:00
Richard T Bonhomme a9c2ef9a67 help: Refactor/simplify 'help' output conditionals.
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-01 20:41:54 +01:00
Richard T Bonhomme d01bfa8dbf Logical consistency
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-31 23:28:38 +01:00
Richard T Bonhomme b71bfb478c Options: Expand alias '--days' to all suitable options with a period
Option alias '--days=NUMBER' can now be used for all other options which
indicate a validity period.

* Option: --days

This global option is an alias for one of the following:
* Expiry days for a new CA.
  eg: '--days=3650 build-ca'
* Expiry days for new/renewed certificate.
  eg: '--days=1095 renew server'
* Expiry days for certificate revokation list.
  eg: '--days=180 gen-crl'
* Cutoff days for commands: show-expire or renewable.
  eg: '--days=90 show-expire'"

The alias '--days' is now ONLY applied to the variable which requires it.
eg: If building a certificate then the appropriate variable for that type
is set. The other possible uses are not set by the same use.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-31 20:56:35 +01:00
Richard T Bonhomme ace0a733a5 Merge branch 'ashutoshojha5-patch-1'
Closes: #671

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-30 20:04:20 +01:00
Richard T Bonhomme a1790c44ba Merge branch 'patch-1' of ssh://github.com/ashutoshojha5/easy-rsa into ashutoshojha5-patch-1
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-30 20:03:12 +01:00
Ashutosh Ojha b877210a48 fixed typo
Signed-off-by: Ashutosh Ojha <ashutoshojha5@gmail.com>
2022-08-30 19:04:49 +05:30
Richard T Bonhomme fb173e5ea0 Options: Introduce --keep-tmp=NAME; Keep the temporary session data
--keep-tmp=NAME : Keep the original temporary session by name: NAME
                  NAME is a sub-directory of the dir declared by --tmp-dir
                  This option ALWAYS over-writes a sub-dir of the same name.

Closes: #610

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 19:45:18 +01:00
Richard T Bonhomme b1cc53fbcb Merge branch 'TinCanTech-fix-locate-x509-types'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 02:09:50 +01:00
Richard T Bonhomme 02004074b4 Merge branch 'fix-locate-x509-types' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-locate-x509-types
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 02:08:48 +01:00
Richard T Bonhomme bb81dc5bb4 x509-types: Reset non-existent x509-types dir set by vars
Closes: #654

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 01:42:01 +01:00
Richard T Bonhomme 75f633a315 Merge branch 'TinCanTech-locate-x509-types'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 01:12:43 +01:00
Richard T Bonhomme 5da1f8e0cb Merge branch 'locate-x509-types' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-locate-x509-types
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 01:11:03 +01:00
Richard T Bonhomme 47547efefc vars_setup: Correctly locate x509-types for usage() directory STATUS
Locate existing x509-types directory, after sourcing vars.
If vars is set incorrectly then this WILL over-ride vars.

Closes: #654

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-29 01:00:19 +01:00
Richard T Bonhomme 7bf1a262be Merge branch 'TinCanTech-status-x509-types'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-28 16:57:21 +01:00
Richard T Bonhomme 1254ca5e47 Merge branch 'status-x509-types' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-status-x509-types
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-28 16:56:30 +01:00
Richard T Bonhomme df37955f4a build-ca: Assign default sub-CA commonName and enable SSL interactive
Squashed commit of the following:

commit 5e9609873a01dd358e3a4c6928fc553e5257d8ea
Merge: ed54b1a 42bfae4
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Sun Aug 28 14:44:13 2022 +0100

    Merge branch 'subca-default-cn' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-subca-default-cn

    Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>

commit 42bfae4673996307107964be0fc8b15883072d31
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Sat Aug 27 13:20:41 2022 +0100

    build-ca: Assign default sub-CA commonName and enable SSL interactive

    When building a CA/SubCA, if a commonName has not been assigned by --req-cn
    then assign a default commonName, of either:
    * 'Easy-RSA CA' or 'Easy-RSA Sub-CA'.

    If a default commonName has been assigned then use SSL interactive mode
    to edit/confirm each of the subject fields individually. Otherwise, use
    EasyRSA to confirm all of the subject fields with a single prompt.

    Closes: #659

    Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-28 16:36:28 +01:00
Richard T Bonhomme 1c9ff967fb x509-types: Add x509-types location to usage() STATUS
Make find_x509_types_dir() a stand alone function.

When calling usage(), find_x509_types_dir() can be a soft fail.
When x509-types directory is required, this function is a hard fail.

This also simplifies install_data_to_pki(), because x509-types do not
need to be installed in the PKI.

Closes: #654

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-08-27 17:17:51 +01:00