Skip to content

External key provider for use with OpenSSL 3

[email protected]... openvpn-devel 2 versions – In review

Get series with b4
b4 am [email protected]...

Versions newest first · linked by author and title

  1. v3 Latest18 patches 39 repliesIn review
  2. v19 patches 18 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18A built-in provider for using external key with OpenSSL 3.0src/openvpn/Makefile.am src/openvpn/xkey_common.h src/openvpn/xkey_provider.c+215 -02 replies
2/18Implement KEYMGMT in the xkey providersrc/openvpn/xkey_provider.c+374 -12 replies
3/18Implement SIGNATURE operations in xkey providersrc/openvpn/xkey_common.h src/openvpn/xkey_provider.c+566 -72 replies
4/18Implement import of custom external keyssrc/openvpn/xkey_provider.c+133 -22 replies
5/18Initialize the xkey provider and use it in SSL contextsrc/openvpn/openssl_compat.h src/openvpn/options.c src/openvpn/options.h +5 more+134 -32 replies
6/18A helper function to import private key for management-external-keysrc/openvpn/Makefile.am src/openvpn/ssl_openssl.c src/openvpn/xkey_common.h +1 more+129 -02 replies
7/18Enable signing via provider for management-external-keysrc/openvpn/ssl_openssl.c src/openvpn/xkey_common.h src/openvpn/xkey_helper.c+113 -64 replies
8/18Add a function to encode digests with PKCS1 DigestInfo wrappersrc/openvpn/xkey_common.h src/openvpn/xkey_helper.c+150 -02 replies
9/18Allow management client to announce pss padding supportdoc/man-sections/management-options.rst doc/management-notes.txt src/openvpn/manage.h +1 more+34 -82 replies
10/18Respect algorithm support announced by management clientsrc/openvpn/xkey_helper.c+6 -42 replies
11/18Support sending DigestSign request to management clientsrc/openvpn/manage.h src/openvpn/options.c src/openvpn/xkey_helper.c+45 -122 replies
12/18Increase ERR_BUF_SIZE when management interface support is enabledsrc/openvpn/error.h+2 -22 replies
13/18Add a generic key loading helper function for xkey providersrc/openvpn/xkey_common.h src/openvpn/xkey_helper.c+66 -62 replies
14/18pkcs11: Interface the xkey provider with pkcs11-helpersrc/openvpn/pkcs11_openssl.c src/openvpn/ssl_openssl.c src/openvpn/xkey_common.h+154 -12 replies
15/18Enable signing using CNG through xkey providersrc/openvpn/cryptoapi.c+211 -302 replies
16/18Add a unit test for external key providerconfigure.ac tests/unit_tests/openvpn/Makefile.am tests/unit_tests/openvpn/test_provider.c+327 -01 reply
17/18xkey-provider: Add a test for generic key load and signatureconfigure.ac tests/unit_tests/openvpn/Makefile.am tests/unit_tests/openvpn/test_provider.c+105 -136 replies
18/18Add xkey_provider sources and includes to MSVC projectsrc/openvpn/openvpn.vcxproj+3 -02 replies

Reviews trailers per patch

All 18 patches have a Reviewed-by or Acked-by.

PatchArne Schwabe
1/18A-b
2/18A-b
3/18A-b
4/18A-b
5/18A-b
6/18A-b
7/18A-b
8/18A-b
9/18A-b
10/18A-b
11/18A-b
12/18A-b
13/18A-b
14/18A-b
15/18A-b
16/18A-b
17/18A-b
18/18A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Openvpn-devel] [PATCH v3 00/18] External key provider for use with OpenSSL 3

From: Selva Nair <[email protected]...>

The following series of patches implement a built-in provider for interfacing OpenSSL 3.0 when external keys are in use.

Essentially, to intercept the sign operation, the SSL_CTX object has to be created with properties string set to prioritize our provider. In the provider we implement only keymgmt and signature operations and specify the property string as optional. That allows all operations we do not provide to be used from the default provider.

Same as PR#161 https://github.com/OpenVPN/openvpn/pull/161
with fixup commits in there squashed and rebased to master.

Requires OpenSSL 3.0.1 (released on Dec 14, 2021) or OpenSSL 3.0 or 3.1 dev branch post Oct 27.

Selva Nair (18):
A built-in provider for using external key with OpenSSL 3.0 Implement KEYMGMT in the xkey provider
Implement SIGNATURE operations in xkey provider Implement import of custom external keys
Initialize the xkey provider and use it in SSL context
A helper function to import private key for management-external-key Enable signing via provider for management-external-key Add a function to encode digests with PKCS1 DigestInfo wrapper Allow management client to announce pss padding support Respect algorithm support announced by management client Support sending DigestSign request to management client Increase ERR_BUF_SIZE when management interface support is enabled Add a generic key loading helper function for xkey provider
pkcs11: Interface the xkey provider with pkcs11-helper Enable signing using CNG through xkey provider
Add a unit test for external key provider
xkey-provider: Add a test for generic key load and signature Add xkey_provider sources and includes to MSVC project

 doc/man-sections/management-options.rst  |    8 +-
 doc/management-notes.txt                 |   22 +-
 src/openvpn/Makefile.am                  |    2 +
 src/openvpn/cryptoapi.c                  |  241 ++++-
 src/openvpn/error.h                      |    4 +-
 src/openvpn/manage.h                     |    2 +
 src/openvpn/openssl_compat.h             |    8 +
 src/openvpn/openvpn.vcxproj              |    3 +
 src/openvpn/options.c                    |   31 +-
 src/openvpn/options.h                    |    2 +
 src/openvpn/pkcs11_openssl.c             |  151 +++
 src/openvpn/ssl.c                        |    5 +
 src/openvpn/ssl.h                        |    6 +
 src/openvpn/ssl_mbedtls.c                |    6 +
 src/openvpn/ssl_openssl.c                |  108 +-
 src/openvpn/xkey_common.h                |  158 +++
 src/openvpn/xkey_helper.c                |  393 +++++++
 src/openvpn/xkey_provider.c              | 1189 ++++++++++++++++++++++
 tests/unit_tests/openvpn/Makefile.am     |   16 +
 tests/unit_tests/openvpn/test_provider.c |  403 ++++++++
 20 files changed, 2715 insertions(+), 43 deletions(-)
 create mode 100644 src/openvpn/xkey_common.h
 create mode 100644 src/openvpn/xkey_helper.c
 create mode 100644 src/openvpn/xkey_provider.c
 create mode 100644 tests/unit_tests/openvpn/test_provider.c
Signature · 1 line
2.30.2