1794 Commits

Author SHA1 Message Date
Richard T Bonhomme
7684b975ca
init-pki: Remove SECOND confirmation promoting use of option 'soft'
The option 'soft' for 'init-pki' has been found to be flawed, because
keeping the 'vars' file in the PKI is now forbidden. The 'soft' option
will be removed in due course.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-14 11:08:44 +01:00
Richard T Bonhomme
eedb81e0e0
init-pki: Never create a vars.example and vars file in the pki
For 'init-pki, disable creating vars.example, which also disables
creating a vars file in the PKI.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-14 11:04:15 +01:00
Richard T Bonhomme
660895293b
Forbid "default vars in the default PKI" for all commands
The default 'vars' file MUST be "$PWD/vars", no other file can be default.
In order to enforce that, a default 'pki/vars' file MUST be forbidden.

This patch:
* Disables the recommandation for 'vars' to be moved TO the PKI, './pki/vars.
* Forbids the file called './pki/vars'.
* Forbids multiple 'vars' files
* Recommends ONLY the working directory copy of a 'vars' file.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-09-14 00:28:12 +01:00
Richard T Bonhomme
6dac068b7e
Merge branch 'revert-1002-expand-help'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-29 12:07:53 +01:00
Richard T Bonhomme
811e8ad593
Merge branch 'revert-1002-expand-help' of ssh://github.com/Openvpn/easy-rsa into revert-1002-expand-help
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-29 12:07:03 +01:00
Richard T Bonhomme
e69ba7dd35
Merge branch 'revert-1001-remove-upgrade23'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-29 12:04:52 +01:00
Richard T Bonhomme
dd650bfbb2
Merge branch 'revert-1001-remove-upgrade23' of ssh://github.com/Openvpn/easy-rsa into revert-1001-remove-upgrade23
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-29 12:04:08 +01:00
TinCanTech
b5cc16f910
Revert "Completely Remove Upgrade Functionality" 2023-08-29 11:47:20 +01:00
TinCanTech
d9e0c418c4
Revert "Expand help to include undocumented commands" 2023-08-29 11:46:44 +01:00
Richard T Bonhomme
f03eb74260
Merge branch 'TinCanTech-expand-help'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-22 12:55:42 +01:00
Richard T Bonhomme
94078ae8da
Merge branch 'expand-help' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-expand-help
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-22 12:55:01 +01:00
Richard T Bonhomme
d15b05d322
Expand help to include undocumented commands
Allow default-san to find requests in pki/reqs folder.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-21 13:00:45 +01:00
Richard T Bonhomme
5b628520a8
Merge branch 'TinCanTech-remove-upgrade23'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-20 01:21:55 +01:00
Richard T Bonhomme
62a20e7868
Merge branch 'remove-upgrade23' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove-upgrade23
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-20 01:21:13 +01:00
Richard T Bonhomme
e0bcdbf12d
ChangeLog: Completely Remove Upgrade Functionality
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-20 01:13:28 +01:00
Richard T Bonhomme
bb2c90a8f7
Completely Remove Upgrade Functionality
The upgrade function is no longer required.

Easy-RSA version 3.1.6 provides full upgrade path for older PKIs.

For rare PKIs which do not have 'unique_subject = no' set
in the 'index.txt.attr' file, fall back to SSL error.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-20 00:38:49 +01:00
Eric F Crist
bb16111041
update changelog for 3.2.0
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2023-08-18 11:30:01 -05:00
Eric F Crist
c6e5f5ba5b
Update OpenSSL to 3.1.2
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2023-08-18 11:27:59 -05:00
Eric F Crist
9850ced8be
Update ChangeLog for release.
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2023-08-18 09:24:51 -05:00
Richard T Bonhomme
c1ace38a17
Merge branch 'TinCanTech-sanitize-path'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-17 11:09:14 +01:00
Richard T Bonhomme
3bb013ce86
Merge branch 'sanitize-path' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-sanitize-path
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-17 11:08:31 +01:00
Richard T Bonhomme
489d2238d2
verify_working_env: sanitize_path(), forbid broken values
Forbid any path ending with '/', '\' or ':'

This protects user variables for paths from being set to the root folder.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-16 16:48:52 +01:00
Richard T Bonhomme
98443c3204
Merge branch 'TinCanTech-force_set_var-v2'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 17:18:07 +01:00
Richard T Bonhomme
2df4ef2016
Merge branch 'force_set_var-v2' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-force_set_var-v2
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 17:17:36 +01:00
Richard T Bonhomme
41d4b4bed2
Merge branch 'TinCanTech-inline-v2'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 16:55:29 +01:00
Richard T Bonhomme
87ac22dcf8
Merge branch 'inline-v2' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-inline-v2
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 16:54:37 +01:00
Richard T Bonhomme
352b8db0fc
ChangeLog: New commands 'inline' and 'x509-eku'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 16:42:39 +01:00
Richard T Bonhomme
b637e9b695
Move creating 'inline' folder from 'build-ca' to 'init-pki'
This allows a client that has not built a CA to use 'inline'.

The CA and signed client certificate can be sent to the client,
allowing the client to create a complete X509 based inline file,
without creating a redundant CA.

Also, add 'inline' command to the list of commands which do not
require a CA.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 15:58:56 +01:00
Richard T Bonhomme
98e9f43be6
renew: Use new ssl_cert_x509v3_eku()
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 15:58:25 +01:00
Richard T Bonhomme
77a0534347
New command inline: Inline available data for certificate
Expose 'inline' command to command line.
Inline available data and ignore missing files.

This function prints the available inline data to stdout.
To create inline files the data must be redirected to a file.
Internally, this redirection is taken care of.

Return 'soft' error when any data is missing but always print
available data.

This behaviour allows for incomplete inline files. For example,
when a CA signs a certificate but does not have the private key.
Any combination of missing files is allowed.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 15:57:52 +01:00
Richard T Bonhomme
fb3223fd5e
New command x509-eku: Extract X509v3 Extended Key Usage from cert
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-05 15:55:36 +01:00
Richard T Bonhomme
6edffac0e6
set_var and force_set_var: Guard against invalid user input
nix.sh/win.sh/busybox.sh never return error from unset
when an invalid variable name 'a=b' is used with a value
to set, eg. 'c'; This causes EasyRSA to execute:
eval "export a=b=c".

'set_var EASYRSA_PKI=pki' results in $EASYRSA_PKI being
set to 'pki=pki-', without error!

Guard against this possible user error with 'case'.

Minor improvements to other input checks.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-04 19:41:29 +01:00
Richard T Bonhomme
7332ae01d9
Merge branch 'dancerj-docs'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-03 00:09:40 +01:00
Junichi Uekawa
14e26c7473
Stylistic updates to documentation.
Add markdown links to documents referred to in README.md and
doc/EasyRSA-Readme.md

Signed-off-by: Junichi Uekawa <dancer@debian.org>
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-08-03 00:06:31 +01:00
Richard T Bonhomme
669ee43ea1
init-pki: Change notice for x509-types directory to verbose level
Now that easyrsa covers missing x509-types, the 'init-pki' message,
for the status of x509-types, is no longer required.

Improve and correct other messages and comments.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-26 21:51:47 +01:00
Richard T Bonhomme
ada4ccae1b
Remove debugging code
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-26 11:15:05 +01:00
Richard T Bonhomme
a8083fdbf3
Export PKCS: export-p1, use -traditional not -legacy
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-26 11:09:38 +01:00
Richard T Bonhomme
d832d206d8
Merge branch 'TinCanTech-improve-export-pkcs'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-25 21:38:50 +01:00
Richard T Bonhomme
0f5689f8b2
Merge branch 'improve-export-pkcs' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-improve-export-pkcs
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-25 21:38:03 +01:00
Richard T Bonhomme
ef793f1629
Export PKCS: Improve user messages, re-arrange p12 command
Re-arranging the p12 command to follow the standard:
- In file
- out file

Followed by
- Conditional: -nokeys
- Unconditional: -inkey file

This is a reminder that '-inkey' is subordinate to '-nokeys' but
is ALWAYS required.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-25 20:06:34 +01:00
Richard T Bonhomme
e60b5e2f5f
Export PKCS: Rename variable $short_name to $file_name_base
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-25 17:10:46 +01:00
Richard T Bonhomme
aaa44558b2
Export PKCS: Expand usage for incomplete PKI
The current export functions only allow use on a complete PKI, with CA.

This change allows the following:
* Server - Export P12/P7 without client key
* Client - Export P12/P7 without CA, P8/P1 without PKI

Due to the relative obscurity of the command options 'noca' and 'nokey',
exporting P12/P7 with incorrect options can be adjusted on-the-fly with
confirmation from the user.

Correct behaviour of export-p1 with OpenSSL v3 by using -legacy option.
Otherwise, OpenSSL v3 outputs a PKCS#8 format file.

Minor improvements to comments.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-25 15:11:26 +01:00
Richard T Bonhomme
cc089ab008
Insert newline separator before confirmations
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-20 23:58:06 +01:00
Richard T Bonhomme
350c0c6cb8
Remove user warnings for missing X509 types
Minor alignment and wrap long lines

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-20 20:25:52 +01:00
Richard T Bonhomme
074d0706dd
Merge branch 'TinCanTech-remove-has_config'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-19 22:53:11 +01:00
Richard T Bonhomme
135d3da0a8
Merge branch 'remove-has_config' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove-has_config
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-19 22:52:27 +01:00
Richard T Bonhomme
82a52d1a9f
Always configure OPENSSL_CONF=/dev/null when there is no SSL config
This applies to all direct calls using EASYRSA_OPENSSL (Default: 'openssl'),
which bypass using easyrsa_openssl() wrapper function.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-19 21:51:45 +01:00
Richard T Bonhomme
e207f855eb
openeasy_easyrsa: Remove unused variable 'has_config'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-19 03:02:55 +01:00
Richard T Bonhomme
d4fa9bdb6d
easyrsa_openssl: Replace variable 'has_config' with OPENSSL_CONF
Variable 'has_config' was a way to minimize the need to fully expand the
SSL config file (ENV:OPENSSL_CONF) for use by LibreSSL. IE. Only expand
the SSL config file when the SSL command requires a config file.

LibreSSL Always requires the config file to be expanded, even when it
is Not used.

OpenSSL Never requires the config file to be expanded.

Changes follow.

The first part:
* Disable expanding the SSL config file for OpenSSL.
* Require expanding the SSL config file for LibreSSL.

LibreSSL will use the run-once mechanism to expand the SSL config file.

The second part:
Replace the use of SSL option '-config', by Always configuring the SSL
environment variable OPENSSL_CONF to point to the Easy-RSA generated
config file. This is supported by LibreSSL and OpenSSL.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-19 02:17:20 +01:00
Richard T Bonhomme
27fce22919
Merge branch 'TinCanTech-iss984-fix-verify_working_env'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-07-18 00:59:50 +01:00