1297 Commits

Author SHA1 Message Date
Richard T Bonhomme
cf489e3fb0
Merge branch 'trim-find_x509_types_dir' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-trim-find_x509_types_dir
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-27 17:43:58 +01:00
Richard T Bonhomme
c379603cfd
find_x509_types_dir(): Remove excess checks
Remove check for '$EASYRSA_PKI' folder 'x509-types',
because it is the first element on the subsequent 'for' list.

Remove check for hard coded 'pki' folder 'x509-types',
because it will over-ride option '--pki-dir=<DIR>'.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-27 03:08:43 +01:00
Richard T Bonhomme
5063eeb2a5
Merge branch 'TinCanTech-renew-remove-nopass'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-26 23:45:42 +01:00
Richard T Bonhomme
fdbe1d709e
Merge branch 'renew-remove-nopass' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-renew-remove-nopass
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-26 23:44:31 +01:00
Richard T Bonhomme
ada7bb41f6
Command 'renew': Remove option 'nopass'
Command 'renew' no longer builds new keys, therefore, the option 'nopass'
is not required.

Closes: #740

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-26 23:22:16 +01:00
Richard T Bonhomme
db33add56a
Command 'help': For unknown command, exit with error.
Added ChangeLog notice.

Squashed commit of the following:

commit de8f9e689e6409b606f112067754c28e3eef1d1d
Merge: ab7c480 0753241
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Wed Oct 26 21:45:29 2022 +0100

    Merge branch 'help-err-exit' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-help-err-exit

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

commit 0753241b0c45311475822d05ce492ef925423dad
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Tue Oct 25 21:52:49 2022 +0100

    Command 'help': For unknown command, exit with error.

    Closes: #736

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

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-26 21:48:45 +01:00
Richard T Bonhomme
ab7c4804fb
Minor refactor of secure_session() and easyrsa_mktemp()
Squashed commit of the following:

commit b93c8e60649d835b66fc4ab2c1d6050e6b1ca231
Merge: 17cbf07 130c161
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Wed Oct 26 21:08:00 2022 +0100

    Merge branch 'easyrsa-mktemp' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-easyrsa-mktemp

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

commit 130c161746d8e7885c7c3a86b8d29d28476b3890
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Wed Oct 26 20:00:56 2022 +0100

    Minor refactor of secure_session() and easyrsa_mktemp()

    Return without error on successful completion of final command.

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

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-26 21:08:54 +01:00
Richard T Bonhomme
17cbf07b29
ChangeLog: Find data-files in the correct order (#727)
Squashed commit of the following:

commit cd3ef9f218ba9e2862914ad9846dc674d5b89ea6
Merge: 368de14 8a8136b
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Tue Oct 25 21:04:16 2022 +0100

    Merge branch 'changlog-725' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-changlog-725

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

commit 8a8136b20a4465b53d4bd59eff4b638af57a5d5b
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Tue Oct 25 20:03:49 2022 +0100

    ChangeLog: Find data-files in the correct order (#727)

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

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-25 21:05:11 +01:00
Richard T Bonhomme
368de14fc1
vars.example: Remove EASYRSA_REQ_CN and EASYRSA_TEMP_FILE
Squashed commit of the following:

commit c27825c3bc5dddaeb3749d7a315a77239146ad22
Merge: 02f13f6 93da550
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Tue Oct 25 20:50:44 2022 +0100

    Merge branch 'vars-remove-req-cn' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-vars-remove-req-cn

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

commit 93da55003cee29695616d01243aecddcf7954c25
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Fri Oct 21 21:10:08 2022 +0100

    vars.example: Minor corrections and formatting

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

commit 9976f3f0d13a73827052f490438b95153a1b7576
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Fri Oct 21 20:57:07 2022 +0100

    vars.example: Remove EASYRSA_TEMP_FILE

    Closes: #729

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

commit 8a35375f84ab88b6f009e5971ddb7358f6619a03
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Fri Oct 21 20:44:53 2022 +0100

    vars.example: Remove EASYRSA_REQ_CN

    Closes: #730

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

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-25 20:51:51 +01:00
Richard T Bonhomme
02f13f6064
Find data-files in the correct order (#727)
Squashed commit of the following:

commit 136484f3ed28d57bf4244d9c716b8daa1cd9a8a7
Merge: 2083fb2 cae6357
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Tue Oct 18 19:44:17 2022 +0100

    Merge branch 'fix-order-725' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-order-725

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

commit cae6357c63b473e33e31620264bef4ede596ffac
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Sun Oct 16 22:52:44 2022 +0100

    Find data-files in the correct order

    With this change the PKI becomes the 'preferred' location for data-files.

    All other supported locations are searched by specific order.

    While this new order is the correct 'preferred' order, the associated code
    install_data_to_pki() needs to be simplified.

    Closes: #725
    Closes: #723

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

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-18 19:44:56 +01:00
Eric F Crist
2083fb29b5
update ChangeLog for today's v3.1.1 release
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-10-13 06:28:23 -05:00
Richard T Bonhomme
72cfbd2cd0
Refactor option parser: Use $number_only to verify $val is numeric
Compress repeated numeric checks.
Reformat case statement.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-12 23:56:05 +01:00
Richard T Bonhomme
95af4f0a30
Documentation updates (No functional changes)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-12 23:47:11 +01:00
Richard T Bonhomme
6472160152
Doc: Correct version requirements (Replace 3.1.2+ with 3.1.1+)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-09 19:46:53 +01:00
Richard T Bonhomme
cb3859be70
Merge branch 'TinCanTech-init-pki-soft'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-09 18:47:48 +01:00
Richard T Bonhomme
d9268ca7eb
Merge branch 'init-pki-soft' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-init-pki-soft
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-09 18:47:03 +01:00
Richard T Bonhomme
829a098950
Merge branch 'TinCanTech-doc-contrib-update'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-09 18:45:29 +01:00
Richard T Bonhomme
fa0a8f3e77
Merge branch 'doc-contrib-update' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-doc-contrib-update
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-09 18:44:39 +01:00
Richard T Bonhomme
b7199ec19a
init-pki soft: Include delete of revoked and renewed sub-directories
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-08 20:58:22 +01:00
Richard T Bonhomme
9cda05613c
Doc: EasyRSA-Contributing.md - Update
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-08 18:17:31 +01:00
Richard T Bonhomme
fc39a6b425
doc: Add EasyRSA-Contributing.md
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-07 15:15:09 +01:00
Richard T Bonhomme
ec7aaaed1f
Merge branch 'mandree-master'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-03 19:31:21 +01:00
Richard T Bonhomme
586f237897
Squashed commit of the following:
commit 5aa65657e2fdda455a8549ed4f4e60cad6cf2389
Author: Matthias Andree <matthias.andree@gmx.de>
Date:   Sun Oct 2 20:44:08 2022 +0200

    Use POSIX [[:space:]] instead of \s for sed(1).

    2nd half of fix for #714.

    Obtained from:	topical@gmx.net
    URL:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266726

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-10-03 19:30:39 +01:00
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