1274 Commits

Author SHA1 Message Date
Richard T Bonhomme
71de656090
Merge branch 'TinCanTech-remove-renewable'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-02 18:54:58 +01:00
Richard T Bonhomme
03d974a064
Merge branch 'remove-renewable' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove-renewable
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-02 18:54:08 +01:00
Richard T Bonhomme
0d03a6f657
Remove obsolete command 'renewable'
All valid certificates are renewable.

Closes: #714

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-02 17:56:39 +01:00
Richard T Bonhomme
781c40ea8b
Merge branch 'TinCanTech-doc-x509-types'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-28 16:46:29 +01:00
Richard T Bonhomme
70958e0f88
Merge branch 'doc-x509-types' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-doc-x509-types
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-28 16:45:36 +01:00
Richard T Bonhomme
4a04e5a5d9
Merge branch 'TinCanTech-update-ns-support'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-28 16:39:04 +01:00
Richard T Bonhomme
10485ab70d
Merge branch 'update-ns-support' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-update-ns-support
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-28 16:37:50 +01:00
Richard T Bonhomme
e21ab73ba6
Merge branch 'TinCanTech-fix-subca-len'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-28 15:02:09 +01:00
Richard T Bonhomme
f4cb94ade6
Merge branch 'fix-subca-len' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-subca-len
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-27 20:51:37 +01:00
Richard T Bonhomme
318e57bbbc
Merge branch 'TinCanTech-update-keep-tmp'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 21:57:58 +01:00
Richard T Bonhomme
c91408c793
Merge branch 'update-keep-tmp' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-update-keep-tmp
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 21:57:09 +01:00
Richard T Bonhomme
92f90fcd18
Option --keep-tmp: Reliability improvements
Do not allow a known PKI folder <NAME> as --keep-tmp=<NAME>

Remove unnecessary random number extension.

Move all snapshots to sub-directory: $EASYRSA_TEMP_DIR/tmp/<NAME>

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 21:45:16 +01:00
Richard T Bonhomme
f297f14c32
Merge branch 'TinCanTech-update-keep-tmp'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 20:08:45 +01:00
Richard T Bonhomme
08d62dd4ee
Merge branch 'update-keep-tmp' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-update-keep-tmp
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 20:07:54 +01:00
Richard T Bonhomme
bcd1376aa2
Option --keep-tmp: Append EASYRSA_TEMP_DIR_session random number
Append the random 32bit number generated for temporary session directory
to the '--keep-tmp=NAME' directory NAME specified by the user.

This avoids obliterating a private keys directory.

Example:
With default settings, '--keep-tmp=private' will delete "$PKI/private".

This will now destroy any directory with the name:
* "$temp_dir/$NAME.$rand"

Closes: #707

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 19:21:46 +01:00
Richard T Bonhomme
df80f52e28
Refactor Netscape support
Do not require '--ns-cert=yes' (or no):
If '--ns-cert' is specified then Netscape support is being requested.
However, '--ns-cert=no' (or yes) will still work as expected.
if '--ns-cert' is used then '--ns-cert=yes' is the new default.

Remove 'awk_yesno()': Unnecessary complexity.

Reword 'help': The behavior is simplified and so is the help.

Closes: #698
Closes: #709

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-26 18:16:21 +01:00
Richard T Bonhomme
43e5cb9af1
ChangeLog: Add resolution of --subca-len=N issue
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-25 21:42:26 +01:00
Richard T Bonhomme
96b3d38847
Move show_host() to cleanup() and move detect_host() after options
Move show_host() to cleanup() and only call it when die() was called.
This allows for confirm() Aborted to exit without extended error data.

Move detect_host after options processing. Allows for use of options.
eg: --verbose

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-25 21:09:24 +01:00
Richard T Bonhomme
14ebbe2bf6
Use correct input file x509-types/ca
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-25 20:47:21 +01:00
Richard T Bonhomme
44d69ca2fe
typ0: Replace single TAB with SPACE
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-24 18:05:16 +01:00
Richard T Bonhomme
4f9e32fc7c
Opt. --subca-len: basicConstraints CA extension, Append 'pathlen:N'
When signing a request for an intermediate CA using --subca-len=N:

For a Sub-CA, the current method to apply 'pathlen:N' to CA basicConstraints
over-writes all user set basicConstraints.

Replace that with an awk script which reads the current x509-types/ca file;
selects the last occurence of 'basicConstraints' (As does OpenSSL) and then
prints that line, with ", pathlen:$EASYRSA_SUBCA_LEN" appended, into the
temporary x509-types/ca file.

If no CA basicConstraint is found then exit with an error. Reason:

Easy-RSA default CA basicConstrain will always be defined. If that is changed
by the user, who then attempts to use Easy-RSA to append 'pathlen' then that
is an error. Easy-RSA must not insert a default when the default has been
deliberately removed.

Closes: #691 - Original bug report.
Closes: #692 - First use of awk as a solution. [Credit]

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-24 15:37:37 +01:00
Richard T Bonhomme
027a3e432f
Merge branch 'TinCanTech-build-full-cleanup'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-23 14:23:10 +01:00
Richard T Bonhomme
6d0038497e
Merge branch 'build-full-cleanup' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-build-full-cleanup
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-23 14:22:23 +01:00
Richard T Bonhomme
5978a211bf
build_full: Remove sign_req() subshell and do full cleanup
build-x-full uses a subshell to detect errors and cleanup the files
if an error occurs.  This does not work if Ctrl-C is pressed during
the confirmation yes/no dialog.

Replace the subshell with an indicator, $on_error_build_full_cleanup,
to force cleanup() to remove the CSR, key and certificate files when
an error occurs or user presses Ctrl-C.

Closes: #680

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-23 13:58:45 +01:00
Richard T Bonhomme
1599714db4
help: Document supported certificate X509 types
Closes: #630

Note: 'kdc' is not a supported X509 type #673

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-22 18:17:05 +01:00
Richard T Bonhomme
513c5be97a
Merge branch 'TinCanTech-final-ChangeLog-v311'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 22:38:51 +01:00
Richard T Bonhomme
0ee06591c2
Merge branch 'final-ChangeLog-v311' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-final-ChangeLog-v311
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 22:37:52 +01:00
Richard T Bonhomme
4b7b7516b4
ChangeLog: Final update for v3.1.1
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 22:29:28 +01:00
Richard T Bonhomme
36f4880cf9
Merge branch 'TinCanTech-doc-renew-revoke-update'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:55:35 +01:00
Richard T Bonhomme
9e908bcef9
Merge branch 'doc-renew-revoke-update' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-doc-renew-revoke-update
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:54:45 +01:00
Richard T Bonhomme
17ded6f52e
Doc-Update: Note that all changes were included with Easy-RSA v3.1.1
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:49:19 +01:00
Richard T Bonhomme
4535c66259
Merge branch 'TinCanTech-status-old-renew'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:39:09 +01:00
Richard T Bonhomme
8e3f928fff
Merge branch 'status-old-renew' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-status-old-renew
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 21:38:20 +01:00
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
0f7c74d1ca
Status Report 'show-renew': Include renewed certs from /cert_by_serial
Expand 'show-renew' to include certs which have been renewed the old way.
These are stored in 'renewed/certs_by_serial' and require 'rewind-renew'
before they can be revoked.

Also, introduce option '-v|--verbose' to make all status reports (only)
more verbose.

In this particular use case, verbose message detail expected serialNumber
mismatches, which can then be verified.  The previous code returned with
out an error, even though the test suggests that an error had occurred.

This verbosity for reports helps to verify that the report is correct.

Manually tested on a PKI with a mix of v1/v2 style renews.

Closese: 699

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-09-21 20:35:24 +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