898 Commits

Author SHA1 Message Date
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
Eric F Crist
8b0e302337
Print error and exit when vars not found on upgrade
When a vars file cannot be found, the up23_manage_upgrade_23() function
will now exit and print a message stating such.  Previously, it exited
silently.

Fixes #377.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-02 10:22:48 -05:00
Eric F Crist
2db812160e
Clarify error messages
The word "offending" doesn't make sense.  Changed to "File Path".

Closes #384

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-09-02 09:31:30 -05:00
Eric F Crist
768b66cfdd
Fix build_ca() always making non-encrypted keys
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-08-28 09:39:04 -05:00
Daniel Iancu
1e98ba808c Fix: build_ca() always makes non-encrypted ED private keys
This resolves a bug where build_ca ignores the nopass flag and always makes non-encrypted private keys when ALGO is "ed".
Also solves build_ca handling of EASYRSA_PASSOUT argument when generating private keys with ALGO set to "ed".
2020-08-28 12:13:28 +03:00
Nicolas Jeker
3d23b1bd01 doc: Spelling, formatting and setence structure improvements 2020-08-20 11:35:14 +02:00
visuve
c7980daaa4 Add a note in EasyRSA-Advanced.md
- The global options need to be set before the actual commands
- https://github.com/OpenVPN/easy-rsa/blob/master/easyrsa3/easyrsa#L219
2020-06-28 16:33:45 +03:00
Eric F Crist
e68faed0a3
Feature: --passin for update-db operations with CA
Merge branch 'madmajestro-use-passin-update-db'

Adds support for leveraging the --passin option for the CA private key
password when running the update-db command.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-05-12 22:25:53 -05:00
Eric F Crist
eb370fe4cd
Merge branch 'use-passin-update-db' of https://github.com/madmajestro/easy-rsa into madmajestro-use-passin-update-db 2020-05-12 22:24:51 -05:00
Eric F Crist
358fa06c15
Fix: Return in set_pass() always non-zero in batch
Merge branch 'madmajestro-setpass-never-returns-0-in-batchmode'

Similar bug to what was fixed in 2953817, with the same fix.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-05-12 22:22:19 -05:00
Eric F Crist
d2f2735f6a
Merge branch 'setpass-never-returns-0-in-batchmode' of https://github.com/madmajestro/easy-rsa into madmajestro-setpass-never-returns-0-in-batchmode 2020-05-12 22:20:50 -05:00
Eric F Crist
2953817e45
Fix: notice() and warn() returned error in batch
Merge branch 'madmajestro-imrove-returncode-notice-and-warn'

This resolves a bug where the warn() and notice() functions would
produce a non-zero exit during batch mode operations.  This bug was
introduced by me in 09e2c3b.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-05-12 22:17:44 -05:00
Arndt Kaiser
0044e1dc7c Functions notice() and warn() return with success now
The functions notice() and warn() allways exited with an return-code !=
0 if called in batch-mode, which can cause unexpected behavior in the
calling code. Now it is ensured that they return with succes.

Additinally, the Script will now terminate if the printf command in the
function print() fails. This ensures that errors during
output-generation will not be ignored.
2020-05-12 08:49:07 +02:00