1709 Commits

Author SHA1 Message Date
Richard T Bonhomme
3cb911ef2a
Very minor changes to comments, help/msg text, wrap lines, code
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-08 19:04:10 +01:00
Richard T Bonhomme
99809bc3bb
Merge branch 'TinCanTech-easyrsa-exit-with-error'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-08 16:24:18 +01:00
Richard T Bonhomme
28d4cae3a4
Merge branch 'easyrsa-exit-with-error' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-easyrsa-exit-with-error
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-08 16:23:42 +01:00
Richard T Bonhomme
b16596f9ec
cleanup: Rename $easyrsa_error_exit to $easyrsa_exit_with_error
This reduces a tiny, unnecessary complexity for exiting with an error.

Functions which use the new variable to exit with error:
* verify_cert() and confirm().

Also, allow verify-cert to support --silent-ssl.

Add more verbose messages.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-08 16:13:08 +01:00
Richard T Bonhomme
80ac745925
Merge branch 'TinCanTech-316-verify-ssl-lib'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-05 23:01:02 +01:00
Richard T Bonhomme
44e2696e46
Merge branch '316-verify-ssl-lib' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-316-verify-ssl-lib
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-05 23:00:32 +01:00
Richard T Bonhomme
91bb2cf8e9
verify_ssl_lib(): Minor style improvements
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-05 22:26:40 +01:00
Richard T Bonhomme
ac0d826272
Add command show-host to command list that does not require a PKI
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 22:59:39 +01:00
Richard T Bonhomme
268e8f59fd
vars_setup() and init-pki() 'vars' management improvements
The actual changes made are:

* Remove $old_vars_true, no longer required.

* Change a test of $found_vars from any-string to specific number 1.
  Which then tests for only one vars file is found.

* If vars-file is created during init-pki then also set $vars to file-name.
  The change here is that $vars is now ALWAYS set for this condition.

* Always print the names of conflicting vars files.
  Helps debugging for users.

* Expand short-circuits to full 'if; then; else; fi'.

* Add more verbose messages
  Help for debugging.

The combined effect is to show the correct messages regarding vars file,
during default status, help, init-pki and standard further commands.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 20:39:23 +01:00
Richard T Bonhomme
5350d50e03
Format: Correct indentation
See: git diff -w

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 02:35:19 +01:00
Richard T Bonhomme
9f752bde7a
vars_setup(): For EASYRSA_NO_VARS set found_vars to zero
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 02:14:08 +01:00
Richard T Bonhomme
7ec58cd64c
Status: Use variable for ca.crt name and correct found_vars value
'ca.crt' was hard-coded to 'pki/ca.crt', instead use '$EASYRSA_PKI/ca.crt'

Status incorrectly warns that there are multiple, conflicting vars files,
when vars is user-defined. Set '$found_vars' to 1, when vars is user-defined.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 01:56:18 +01:00
Richard T Bonhomme
1135efc148
Merge branch 'TinCanTech-expand-default-status'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 00:16:27 +01:00
Richard T Bonhomme
2edec49954
Merge branch 'expand-default-status' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-expand-default-status
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-04 00:15:47 +01:00
Richard T Bonhomme
8d5867a54f
ChangeLog: Expand default status to include vars-file and CA status
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 23:59:04 +01:00
Richard T Bonhomme
e2e2d1bfa1
Expand default status to include vars-file and CA status
For default command 'easyrsa', show the following:
* Show the location of vars-file.
* Show the status of the CA.
* If vars is not in the PKI then show the "Prefer pki/vars" warning.

Also, show the "Prefer pki/vars" warning for all commands except help.

Move the logic to show the "Prefer pki/vars" warning to the function.

Extensively, manually tested.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 23:32:28 +01:00
Richard T Bonhomme
5a0c7cd1f9
Merge branch 'TinCanTech-warn-no-vars'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 13:38:45 +01:00
Richard T Bonhomme
0a895027f0
Merge branch 'warn-no-vars' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-warn-no-vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 13:37:48 +01:00
Richard T Bonhomme
97b9a4c665
vars-file: Warn about EASYRSA_NO_VARS disabling vars-file use
Also, minor improvement to checking vars-file for 'export' and 'unset'.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 13:13:30 +01:00
Richard T Bonhomme
9872cc22c1
Merge branch 'TinCanTech-set_var-allow-empty'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 02:16:07 +01:00
Richard T Bonhomme
890780116a
Merge branch 'set_var-allow-empty' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-set_var-allow-empty
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 02:15:26 +01:00
Richard T Bonhomme
8e62fa28d7
set_var(): Allow empty input to return without error
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 02:04:18 +01:00
Richard T Bonhomme
002c84fff1
verify_working_env(): Simple improvements, no functional changes
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-03 01:32:27 +01:00
Richard T Bonhomme
3db8c50782
Prefer test for '-z' over '!'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 22:13:18 +01:00
Richard T Bonhomme
c5d698d169
Merge branch 'TinCanTech-post-315-refactor'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 21:43:44 +01:00
Richard T Bonhomme
a8567ba80d
Merge branch 'post-315-refactor' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-post-315-refactor
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 21:38:27 +01:00
Richard T Bonhomme
444444595e
Simplify requirements for PKI, CA and vars file
Prioritise $EASYRSA_NO_VARS above other vars file detection.

Rename $pki_is_required to $require_pki

Re-establish; Do not require PKI, CA or vars for command 'upgrade'.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 21:10:10 +01:00
Richard T Bonhomme
232f9f6b8d
verify_working_env(): Verify PKI and CA are initialised as required
This moves all PKI and CA initialisation requirements into verify_working_env().

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 19:03:18 +01:00
Richard T Bonhomme
fdb3b1a2b2
Merge branch 'TinCanTech-sign-req-preserve-dn'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 14:11:23 +01:00
Richard T Bonhomme
e89f4d7ace
Merge branch 'sign-req-preserve-dn' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-sign-req-preserve-dn
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-02 14:10:34 +01:00
Richard T Bonhomme
49fda49e25
cleanup(): Change die() to warn(), cleanup cannot use die()
Minor improvements to help and comments

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-01 22:05:45 +01:00
Richard T Bonhomme
d29183721f
sign-req: Allow the CSR DN-field order to be preserved
When signing a request, EasyRSA ALWAYS defaults to the CA defined
Distinguished Name field order, as defined by openssl-easyrsa.cnf
configuration file.

In the unlikely event that a CSR is received with a different DN-
field order, that order can be preserved for the signed certificate.

Command 'sign-req', now has a command option 'preserve' for this.

Additional:

Use of 'preserve = yes' in openssl-easyrsa.cnf has no effect for
EasyRSA.

Testing OpenSSL directly indicates that this option may have no effect
when used in OpenSSL default configuration file openssl.cnf

Also, OpenSSL documentation for command 'ca', option '-preserveDN'
does NOT infer that this option can be used in the configuration file.

None of which is important to EasyRSA because only foreign CSRs can
have a different DN-field order, so default behavior can remain.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-30 21:28:41 +01:00
Richard T Bonhomme
dfd12562dc
Introduce Easy-RSA error log-file - Used by easyrsa_mktemp
When commands executed in a subshell fail the error message is lost.

Easy-RSA error log provides a permanent temp-file to write those
error messages to and be displayed on completion of the script.

This first use of the log-file by easyrsa_mktemp(), will log errors
caused by requiring more than three (3) subshell temp-files.

Temp-files created during a subshell command do not update the
temp-file counter, so their name relies on a second, built-in
extension to the temp-file name. If this second extension exceeds
three (3) then a non-fatal warning is logged to the error log-file.

Other functions, which are executed in subshells, will use the error
log-file in follow up patches, as required.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-26 12:47:53 +01:00
Richard T Bonhomme
f0aa171373
Introduce and use 'user_error()'
Replace use of die(), which is very noisy, with user_error(),
which simply outputs the error message and EasyRSA Version.

Use of user_error() is specific to input and file errors,
caused by invalid user input.

Internal errors continue to use die().

Other associated improvements to output.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-20 14:19:53 +01:00
Richard T Bonhomme
a4fb7f0528
sign-req: Minor improvements; Remove function-end 'return 0'
Remove fucntion-end 'retrun 0' because it masks unexpected errors.

'if; then; else; fi;' wrap SSL call.

Minor improvements.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-20 00:21:47 +01:00
Richard T Bonhomme
71bedfd554
Brace '{}' delimit variable names in long assignment strings
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-19 20:48:37 +01:00
Richard T Bonhomme
c004c89034
Rename variable: duplicate_cert_by_serial -> dup_cert_by_serial
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-19 20:28:17 +01:00
Richard T Bonhomme
d7aa07bc7f
User level output, general improvements
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-18 00:42:13 +01:00
Richard T Bonhomme
4a18ed5e3a
sign-req: Do not show "foreign request" warning during build-full
Only show the "foreign request" warning when sign-req is called for
an imported request. Do not show the warning when the request has
been created by build-full-*.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-17 21:29:13 +01:00
Richard T Bonhomme
0c95a37f08
Wrap long lines, improve comments and very minor changes
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-15 00:00:23 +01:00
Richard T Bonhomme
db9507626b
Auto-create x509-types: Corrections to buld-ca and sign-req
build-ca:
* Replace 'print foo' with function create_x509_types_ca()
* Replace 'ignore' with function create_x509_type_COMMON()

sign-req:
* Replace 'ignore' with function create_x509_type_COMMON()

Note: x509-types/COMMON only has comments, no code.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-14 21:24:51 +01:00
Eric F Crist
27c5973174
New OpenSSL Build Script
Initial commit of a quick attempt at making a build script for OpenSSL.
This assumes some things present on my build VM.  Appears to work at
least on an Ubuntu VM as well as on a Mac as long as mingw is installed.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2023-06-10 10:58:50 -05:00
Eric F Crist
635e935e2f
Updating OpenSSL to v3.1.1
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2023-06-10 10:56:06 -05:00
Eric F Crist
a8d43bc3cf
Release v3.1.5
* update build script to sign/verify using gpg
* update ChangeLog for release

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2023-06-10 09:01:27 -05:00
Richard T Bonhomme
a24578a37e
Merge branch 'TinCanTech-auto-support-files'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-09 22:13:42 +01:00
Richard T Bonhomme
117c6c10c6
Merge branch 'auto-support-files' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-auto-support-files
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-09 22:13:05 +01:00
Richard T Bonhomme
9a70a50a0c
sign-req: Correct variable assignment
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-09 22:04:37 +01:00
Richard T Bonhomme
7da63e9408
ChangeLog: Automate support-file creation (Free packaging)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-09 11:30:17 +01:00
Richard T Bonhomme
1f39fce75c
Automate support-file creation (Free packaging)
Create default files for openssl-easyrsa.cnf, vars.example and x509-types files.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-09 00:09:37 +01:00
Richard T Bonhomme
52551e7c49
Merge branch 'TinCanTech-ca-via-raw'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-06-06 00:37:51 +01:00