Commit Graph
1396 Commits
Author SHA1 Message Date
Richard T Bonhomme 3e6478aae4 Add cmd-opt 'batch' to verify_cert() - Allows returning deliberate error
This allows verify_cert() to show the status and, optionally, return an
error (1) on "failure to verify" to a calling program.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-13 22:46:51 +01:00
Richard T Bonhomme 8c05298f62 Add option '-p' to test '--passin' and '--passout'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-13 14:14:58 +01:00
Richard T Bonhomme e7a5d321e4 Exit with an error, if there was an error..
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-11 20:58:36 +01:00
Richard T Bonhomme a94ae1a537 Minor improvement to locating 'vars' file
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-11 16:50:53 +01:00
Richard T Bonhomme 20d2bedaed Merge branch 'AndersBlomdell-master'
Interesting awk code archived.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-10 09:58:21 +01:00
Richard T Bonhomme 93bf14f223 Merge branch 'master' of ssh://github.com/AndersBlomdell/easy-rsa into AndersBlomdell-master 2022-05-10 09:57:07 +01:00
Richard T Bonhomme 3e6f297a37 Merge branch 'TinCanTech-status-reports'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-10 09:53:38 +01:00
Richard T Bonhomme 7743b32a7d Merge branch 'status-reports' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-status-reports 2022-05-10 09:47:46 +01:00
Richard T Bonhomme d7494fb73e Merge branch 'nkakouros-init-vars'
Minor changes to original comments.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-10 09:41:29 +01:00
Richard T Bonhomme e3d08f776f Merge branch 'init-vars' of ssh://github.com/nkakouros/easy-rsa into nkakouros-init-vars 2022-05-10 09:33:03 +01:00
Eric Crist 2f1e6eaad8 Merge pull request #563 from OpenVPN/release/3.0
Backport patch for #559 to 3.0
2022-05-09 21:21:08 -05:00
Eric F Crist 8670ee4a1f Backport patch for #559 to 3.0
Backport the patch from a4e37cfe54 to 3.0
that fixes the data arguments on Darwin and BSD.  Patch originally
authored by @tincantech.

Update .gitignore to ignore macOS .DS_Store files.

Update ChangeLog for v3.0.9 release

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-09 21:14:32 -05:00
Nikolaos Kakouros 783a8e03d8 Always respect --vars=file 2022-05-09 23:51:42 +00:00
Richard T Bonhomme 90794c0771 Switch macOS unit test runner back to 'macos-latest'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-09 18:05:08 +01:00
Richard T Bonhomme a4e37cfe54 Fix 'start_fix_sec' - date requires '-f input_format'
Tested on macOS and FreeBSD.

Closes: #559

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-09 17:37:16 +01:00
Richard T Bonhomme 55bdd0264d Use correct input format for 'start_fix_sec' on Darwin and *BSD
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-09 16:00:06 +01:00
Richard T Bonhomme 85b35cccb8 CI - Do not run Edwards Curve tests for LibreSSL
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-09 04:23:49 +01:00
Richard T Bonhomme 3770f565a4 Set macOS github runner to supported macOS version Catalina 10.15
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-09 02:06:04 +01:00
Richard T Bonhomme af4120c50e CI - Spin up macos-latest runner for op-test.sh
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-07 19:18:35 +01:00
Eric Crist 74a79b0c87 Merge pull request #558 from OpenVPN/release/3.0
Merging changes from Release/3.0
2022-05-07 07:13:07 -05:00
Eric F Crist fc79ff14ed Correct grep regex for POSIX compatibility
Issue brought up by Michael Gmelin in FreeBSD bug:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263812

The \d patter is not POSIX, instead :digit: or [0-9] should be used.
Opted for the latter.

Resolves #556 from freebsd/freebsd-ports@8e0b9d2

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-07 07:07:17 -05:00
Eric F Crist 6b803b5a7b update changelog for patch for #556
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-07 07:05:11 -05:00
Eric F Crist d428d53a8b Correct grep regex for POSIX compatibility
Issue brought up by Michael Gmelin in FreeBSD bug:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263812

The \d patter is not POSIX, instead :digit: or [0-9] should be used.
Opted for the latter.

Resolves #556 from freebsd/freebsd-ports@8e0b9d2

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-07 06:57:56 -05:00
Richard T Bonhomme 4b6e0bdb45 Add '--renew-days' - Option to set EASYRSA_CERT_RENEW days
Used with 'renew' to extend the grace period before allowing certificates
to be renewed.

Used with 'show-expire' to extend the period of the search for certificates
which are close to expiring.

Also, correct some comments and minor formatting changes.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-07 10:51:10 +01:00
Richard T Bonhomme d0905bd72a Add 'show-renew' to help
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-07 10:11:10 +01:00
Richard T Bonhomme 06078cad43 Add 'show-renew' - List of renewed but not revoked certificates
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-07 09:20:28 +01:00
Richard T Bonhomme 89a5aeedaf Prohibit '--fix-date' for status reports
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-07 02:18:53 +01:00
Richard T Bonhomme 1137a54cc1 Introduce extensible PKI reporting tool framework
Comes with 'expiry' and 'revoke' report.

Could do with 'renewed-not-revoked' report.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-07 01:41:36 +01:00
Anders Blomdell b6089f25a7 Do all renewable checking in awk script 2022-05-06 12:15:23 +02:00
Eric F Crist a03a839685 Housekeeping: README/gitignore
Update README.md to show release/3.0 branch and add the .DS_Store
file/folder to .gitignore

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-05 19:30:51 -05:00
Eric F Crist 59cddca67d OpenSSL 3.x doesn't appear to work on Windows 7
Doesn't seem to work - Win7 is EOL and not really worth a lot of time
debugging.  Users should use v3.0.9 of EasyRSA which includes OpenSSL
1.1.1o which should work.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-05 19:12:59 -05:00
Richard T Bonhomme 7a7302c4b0 Merge branch 'TinCanTech-verify-cert'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 20:42:37 +01:00
Richard T Bonhomme b862799f19 Merge branch 'verify-cert' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-verify-cert 2022-05-05 20:41:35 +01:00
Anders Blomdell d56dbcf300 Get rid of non-existing find command 2022-05-05 19:34:24 +02:00
Richard T Bonhomme 12eecc5d6a Replace arithmetic number overflow with sensible error detection code
Windows sh.exe cannot multiply two date stamps due to 32bit integer overflow.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 14:58:27 +01:00
Eric F Crist 6e64026d3a update OpenSSL to 3.0.3
Compiled OpenSSL 3.0.3 from github for both 64 and 32 bit Windows.  Ran
the wop-test.sh script and passed tests:

* Easy-RSA Unit Tests:
* Windows, no OpenSSL-v3
* System SSL enabled
easyrsa-unit-tests.sh version: 2.3.0
* setup unit-test - ok
* shellcheck abandoned
* >>> BEGIN unit tests:
* >>>>>>: sh C:/Users/ecrist/Desktop/3.1.0-64/easy-rsa/easyrsa-unit-tests.sh -v
easyrsa-unit-tests.sh version: 2.3.0
easyrsa-unit-tests.sh source:  localhost
easyrsa source:                C:/Users/ecrist/Desktop/3.1.0-64/easy-rsa/easyrsa3/easyrsa

* EASYRSA_OPENSSL:
  openssl (env)
  OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)
EasyRSA Version Information
Version:     ~VER~
Generated:   ~DATE~
SSL Lib:     OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)
Git Commit:  ~GITHEAD~
Source Repo: https://github.com/OpenVPN/easy-rsa

Setup .. ok
>>>>> >>>>> Begin easyrsa rsa tests

... Lots of tests here.

<<<<< <<<<< End easyrsa ed tests
easyrsa-unit-tests.sh version: 2.3.0
easyrsa-unit-tests.sh source:  localhost
easyrsa source:                C:/Users/ecrist/Desktop/3.1.0-64/easy-rsa/easyrsa3/easyrsa

* EASYRSA_OPENSSL:
  openssl (env)
  OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)

Unit-test: cleanup
Remove temp dir: C:/Users/ecrist/Desktop/3.1.0-64/easy-rsa/easyrsa3/unit tests
Completed Thu May  5 08:28:30 Central Daylight Time 2022 (Total errors: 0)
* OK
* <<< END unit tests:

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-05 08:35:18 -05:00
Eric F Crist 3991ffdb96 call python3 instead of python in build-dist
Not all the places I want to build the distribution symlink python to
the python3 binary (namely macOS) so just call python3 directly.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-05 08:35:17 -05:00
Richard T Bonhomme a3dec9576d Minor improvement to cleanup() - Always detect terminal first
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 13:39:13 +01:00
Richard T Bonhomme 36543be760 Improve error detection in cert_dates()
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 13:37:28 +01:00
Richard T Bonhomme 0948e81304 Detect and filter erroneous duplicate "found 'vars' files"
When 'vars' is in the same directory as 'easyrsa' and they are both
in the current working directory, easyrsa would falsely warn about
"conflicting" 'vars' files.

Filter out this false error by checking if '$prog_dir' is './'

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 12:37:35 +01:00
Richard T Bonhomme 87e514e3b6 Correct indentation
Follow-up to: 9f0d4bf16d

Separate commit for clarity.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 12:33:44 +01:00
Richard T Bonhomme 9f0d4bf16d Respect '--vars=file'
Changes to how 'vars' is located and sourced omitted the possibility
that the vars file has been declared via '--vars'.

Move the 'fi' to the correct location so that '--vars' is respected.

Closes: #552 (Over-ruled, due to another, unrelated change)

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-05 12:29:07 +01:00
Eric F Crist ecc7cb72d1 Preparing for v3.0.9 release
This has been an on/off release tag, but we're going to push it out
because there are some that will remain on the v3.0.x branch for a
long time, and OpenSSL 3.x isn't available in all distros/embedded
systems yet (or for a while).

 - Updated OpenSSL for Windows to 1.1.1o
 - Updated ChangeLog for v3.0.9, pulling in most comments for v3.1.0
 - Updated header in easyrsa to point to Github contributors page

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2022-05-04 21:29:47 -05:00
Anders Blomdell 5c1a77cf66 Get rid of bash arrays, we know that certificate names does not contain whitespace 2022-05-04 14:47:48 +02:00
Anders Blomdell 70b388f0a2 Add command for testing which certificates are eligible for renewal 2022-05-04 12:49:51 +02:00
Richard T Bonhomme 814fab9bd3 Make cert_dates() '--fix-offset' Windows compatible
date.exe does not support output format '+%s' as input.

Instead, use date.exe "string" not seconds since epoch.

Also, force easyrsa_openssl() 'makesafeconf' to move the the temp-file
to the target file.  Otherwise, Windows users are expected to confirm
over-write, every time.

Also, minor variable name changes, for clarity.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-04 00:09:18 +01:00
Richard T Bonhomme 3b8f9137b0 Do not declare EASYRSA_FIX_OFFSET, must be set by user only
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-03 20:53:45 +01:00
Richard T Bonhomme 7a5212c9a9 Introduce '--fix-offset' for fixed start/end date certificates
The initial idea was to mask the actual certificate creation date.
The reason was to further anonymise user certificates. (YMMV)

There is now a second part to this date "fixing":
* This allows for all certificates to expire on the same day.

Using command option '--fix-offset=nnn', all certificates will be created
* with a 'notBefore' date of January 1st of the current year.
* with a 'notAfter' date of the day-of-year number from '--fix-offset',
  in the final year, as per EASYRSA_CERT_EXPIRE (Default 825 days).
  The default 825 days results in 2 years plus the offset given.

This can also be set in the 'vars' file, for convenience.

The default day-of-year offered is 183; either July 2 or 3 (leap year).

Follow-up to: #550 (Replaces 'nodatetime' with '--fix-offset')

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-03 20:25:00 +01:00
Richard T Bonhomme 8c5ee3df1b Merge branch 'ValdikSS-startdate-year-v3'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2022-05-03 20:16:50 +01:00
Richard T Bonhomme 1620cfe0d1 Merge branch 'startdate-year-v3' of ssh://github.com/ValdikSS/easy-rsa-ipsec into ValdikSS-startdate-year-v3 2022-05-03 20:15:29 +01:00