860 Commits

Author SHA1 Message Date
Richard T Bonhomme
b02f4231a5
Re-arrange "# Signing a request" to fix markdown problem
Supercedes: #430
Closes: #47

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-21 19:28:59 +00:00
Richard T Bonhomme
df63c6385b
Merge branch 'thesteve0-patch-1' - Minor typo
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-21 18:13:02 +00:00
Richard T Bonhomme
91ca33fdf0 Merge branch 'patch-1' of https://github.com/thesteve0/easy-rsa 2022-03-21 18:08:53 +00:00
Richard T Bonhomme
c56eee40bf
Remove spurious echo in upgrade process
Closes: #453

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-21 17:51:11 +00:00
Richard T Bonhomme
32071fc32f
Merge branch 'TinCanTech-master'
Introduce support for OpenSSL version 3

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-21 16:43:08 +00:00
Richard T Bonhomme
8e7bac695d
Quote $algo_opts
When EasyRSA is installed to a path with a space in it, gen_req() fails
for EC and ED crypto.  This is caused by the space in the file-name for
the parameters file $EASYRSA_CURVE.

To resolve this, '-newkey' must be removed from $algo_opts and inserted
into the OpenSSL command.  And $algo_opts must be quoted. (#494)

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-21 15:57:03 +00:00
Richard T Bonhomme
f64fef9af2
Replace needlessly complicated 'if/elif/else' with simple 'case'
Where 'if' is replaced with 'case', functionality is generaly maintained.

With the following exceptions:

* verify_curve_ed() does not need to identify the specific curve.
  Error status will provide the correct result for a curve name error.

* For Edwards curve crypto, the 'case' statement is further reduced to
  use the verified $EASYRSA_CURVE inside the OpenSSL command.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-20 21:55:12 +00:00
Richard T Bonhomme
a7e0b3fe69
Make easyrsa_openssl() aware of the SSL Library version
Commit a0dbc346bd92088ee481f5488ac53a7537b32073 leads to bug caused
by OpenSSL 'genpkey' inconsistency. OpenSSL version 1 'genpkey' does
not support option '-config' but OpenSSL version 3 does.
(Details can be found at: https://www.openssl.org/docs/manpages.html)

To use 'genpkey' option '-config', easyrsa_openssl() needs to be aware
of the SSL Library version and only set '-config' for version 3.

This patch sets OpenSSL version 3 ONLY option '-config' for 'genpkey'.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-20 21:20:20 +00:00
Richard T Bonhomme
7b3fdee224
Quote $out_key_tmp
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-19 17:59:01 +00:00
Richard T Bonhomme
4315356de0
Minor refactoring of build_ca() for OpenSSL version 1
* (1) Move definition of $crypto_opts inside 'case' for OSSLv1 (NFC)
  This defines $crypto_opts for the CA private key.

* Wrap long lines (NFC)

* (2) Expand definition of $crypto_opts to use $no_password.
  This defines $crypto_opts for the CA pair.

Note: Before this change (2), the command which EasyRSA uses
does not include '-nodes' when building an unencrypted CA.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-19 16:52:22 +00:00
Richard T Bonhomme
73cc4a62cc
Set 'build_ca()' specific $crypto_opts '-pass' for OpenSSL version 3
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-18 20:39:40 +00:00
Richard T Bonhomme
16f2d11f37
Use $crypto_opts to correctly set SSL '-noenc' ($no_password)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-18 17:23:55 +00:00
Richard T Bonhomme
a0dbc346bd
Introduce support for OpenSSL version 3
Required changes:

* Use 'verify_ssl_lib()' to determine SSL Library version.
  Returns '1', '3' OR error.
  Sets 'no_password' to either '-nodes' (SSLv1) or '-noenc' (SSLv3)

* Replace OpenSSL paramater '-nodes' [DEPRECATED], with '-noenc'.
  Ref: https://www.openssl.org/docs/man3.0/man1/openssl-req.html
  This effects All Easy-RSA CAs built using OpenSSL version 3.

* Replace OpenSSL command 'genrsa' [DEPRECATED], with 'genpkey'.
  Ref: https://www.openssl.org/docs/man3.0/man1/openssl-genrsa.html
  This effects Easy-RSA 'RSA' CAs built using OpenSSL version 3.
  OpenSSL advises using 'genpkey' over 'genrsa'.

* OpenSSL 'genpkey' does not accept the parameters defined by
  easyrsa $opts and $no_password when generating CA private keys.
  Do not use these variables for OpenSSL-v3 'genpkey'.

Optional changes:

* Use 'easyrsa_openssl()' wrapper function to build All CAs.

* Add 'genpkey' to easyrsa_openssl() wrapper, to include using the
  EasyRSA/OpenSSL Configuration file $EASYRSA_SAFE_CONF.

* Change EasyRSA Elliptic Curve (ec) CA's to also use OpenSSL 'genpkey',
  instead of OpenSSL 'ec'.  This change is not required, however, this
  means that all EasyRSA CA Private keys are created using 'genpkey'
  with OpenSSL v3.

* EasyRSA 'gen_req()' is the only other code which uses OpenSSL '-nodes'.
  Make 'gen_req()' aware of the SSL Library version and therefore the
  correct parameter for an unencrypted private key. (-noenc vs -nodes)
  Note: OpenSSL '-nodes' is only deprecated not removed.

* Indent OpenSSL version 1 code block to match. No functional changes.

Tests Passed:

Full extended unit tests, with both OpenSSL version 1.1.x and 3.0.1
(Includes standard test for Edwards Curve PKI)

Manual building of All OpenSSL *v3* CAs with passwords and subsequent
building and signing of a server or client certificate.

Manual building of OpenSSL *v1* EC CA with password and subsequent
building and signing of a server or client certificate.
Tested due to changing CA key from OpenSSL 'ec' to 'genpkey'.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-03-18 14:43:28 +00:00
Eric F Crist
6ac2705eb4
Update ChangeLog to include notes for 3.0.9 release
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-03-15 21:40:03 -05:00
Eric F Crist
2155d2c95c
Update OpenSSL to 1.1.1m for Windows
Using compiled binaries from Overbyte at:
 http://wiki.overbyte.eu/wiki/index.php/ICS_Download#Download_OpenSSL_Binaries_.28required_for_SSL-enabled_components.29

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-03-15 21:16:52 -05:00
Eric F Crist
86e8feccda
Merge branch 'issue_478'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-03-15 19:23:17 -05:00
Eric F Crist
4463e1d08f
Use openssl rand -hex 3 instead of mktemp
This removes our dependency on an external non-POSIX mktemp
implementation and uses openssl's built in rand function.

Addresses #478

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-03-15 19:16:28 -05:00
Steven Pousty
3e009e3d7a
small typo fix
Just found a single letter typo
2021-11-01 20:48:25 -07:00
a1346054
212c18a83c
Trim excess whitespace 2021-10-21 14:21:00 +00:00
a1346054
c903669eef
Add missing final newline 2021-10-21 14:20:59 +00:00
a1346054
3b5321884a
Use windows-style newlines for .bat file 2021-10-21 14:20:34 +00:00
a1346054
67e3e6ae4a
Fix spelling 2021-10-21 14:08:50 +00:00
a1346054
20b4d2cbcc
Fix shellcheck warning 2021-10-21 14:08:25 +00:00
a1346054
335a8e09d6
Use hash-identical license file from gnu.org
The old license file has an extra newline.

Downloaded from:
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
2021-10-21 13:58:12 +00:00
a1346054
8aaa13f73a
Remove mention of no longer used IRC network
The channels are active at libera.chat IRC network instead
2021-10-21 13:57:30 +00:00
Fᴀʙɪᴇɴ Wᴇʀɴʟɪ
1f7ef3663f
Add possibility to configure umask 2021-10-12 10:21:35 +02:00
Eric Crist
243bb708b0
Update README.md
add link to key
2021-05-09 20:10:31 -05:00
Eric Crist
d227b0c9e7
Update README.md
Add signature verification example.
2021-05-09 20:01:21 -05:00
Eric F Crist
7adaf701c3
Merge branch 'patchhoernchen-patch-1'
Fixes #443

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2021-05-05 14:22:28 -05:00
patchhoernchen
6c5753348d
fixed renew filename confusion
fixed missing quotes leading to filename inconsistency in renew subcommand.
2021-05-04 16:51:43 +02:00
Markus Tillinger
aa925e18fa Fixed another issue of missing quotes where renewing would rename files
while moving them if filename contains spaces.
2021-01-22 17:19:14 +01:00
Markus Tillinger
74739844b4 Fixed space-related issues in export-pkcs 2021-01-22 16:30:17 +01:00
Markus Tillinger
0527385231 Minor re-formating replacing spaces with tabs for consistency 2021-01-22 13:55:00 +01:00
Markus Tillinger
e3f65e7905 Minor re-formating changing comparison order for consistency 2021-01-22 13:55:00 +01:00
Markus Tillinger
432d93ec94 Fixes issues #395 and #412
The openssl call relied on word splitting for $crypto_ops
but $crypto_opts consists of a path which could contain spaces.
Now path is stored in $pass_opts which is quoted when using in
openssl call.
2021-01-22 13:55:00 +01:00
Markus Tillinger
c064d3bc66 Fixed wrongly disabled shellcheck SC2231:
$EASYRSA_PKI is a path that could contain spaces where word splitting must be prevented.
2021-01-22 13:55:00 +01:00
Markus Tillinger
d211efe5d5 Fixed running op_test.sh when absolute repository-path has spaces:
For EC algorithm the variable $EASYRSA_ALGO_PARAMS is a path and needs to be quoted.
This also fixes #408
2021-01-22 13:54:39 +01:00
Noah Spahn
90071cc753
Update EasyRSA-Readme.md
A few more readability corrections/suggestions
2021-01-03 21:17:59 -08:00
pacija
10f6fb2a42
Fix renew on OpenBSD
Change `allow_renew_date` so it doesn't use `-v` flag not present on OpenBSD version of `date`
2020-11-19 17:29:57 +01:00
Eric F Crist
41a6bc6845
Use $EASYRSA_OPENSSL instead of $PATH
Silly bug on my part.

Fixes #416

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-11-06 20:50:37 -06:00
Eric F Crist
19a20046ca
Update OpenSSL to 1.1.1g (again)
Using another build of OpenSSL that appears to work fine in testing.

Long term, we should be building OpenSSL ourselves and shipping it on a
regular basis.  That's another project on the list.

Resolves #405.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-18 08:27:14 -05:00
Eric F Crist
a9cecc747c
Revert "Update Windows OpenSSL to 1.1.1g from 1.1.0j"
This reverts commit 5f3e5ca450eaf464ed21a5d3ec62d39f7594fd99.

There is an incompatibility in 1.1.1g with the EasyRSA script.  There
are no new features in 1.1.1g we are leveraging directly, so just going
to revert to support the OpenVPN 2.5 release process and get EasyRSA
v3.x into more hands.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-16 07:50:04 -05:00
Eric F Crist
f12e00e53b
Update ChangeLog for v3.0.8 release
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 15:55:36 -05:00
Eric F Crist
5791a732cc
Add caution about setting global options in docs
Merge branch 'visuve-master'

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 15:44:39 -05:00
Eric F Crist
8ad3cd845c
Add note in EasyRSA-Advanced about setting advanced options.
Merge branch 'master' of https://github.com/visuve/easy-rsa into visuve-master

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 15:42:56 -05:00
Eric F Crist
0ff79e5ea7
doc: Spelling, formatting, etc improvements
Various punctuation and grammatical corrections.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 15:35:33 -05:00
Eric F Crist
bc1b04116e
doc: Spelling, formatting, etc
Various grammatical and punctuation related changes.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 15:33:43 -05:00
Eric F Crist
5f3e5ca450
Update Windows OpenSSL to 1.1.1g from 1.1.0j
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 15:30:47 -05:00
Eric F Crist
eaca0832fa
fix --passin option for RSA keys
Commit 1e98ba8 introduced an issue with RSA keys (only ED keys were
tested).

Closes #403 and #395

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-09 14:38:49 -05:00
Daniel Iancu
08746ca179 Fix: build_ca() fails for rsa keys
This fixes an argument error I made in commit 1e98ba808c9c90629595827773a66b59f8c9b927, sorry I have not tested RSA keys as I only use ED.
The argument is -passout for all openssl versions (tested on LibreSSL 2.8.3 and OpenSSL 1.1.1d).
2020-09-09 14:13:20 +03:00