]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Add compatibility to build OpenVPN with AWS-LC.
authorShubham Mittal <smittals@amazon.com>
Tue, 28 Jan 2025 22:09:32 +0000 (14:09 -0800)
committerGert Doering <gert@greenie.muc.de>
Wed, 29 Jan 2025 16:11:19 +0000 (17:11 +0100)
commitaab1f862f42f300d4ee7fe9a971fd2ae474c53db
tree6934da740e3dd00b1a20431ddc95beed9ebc9eb4
parent0fcfc8381f60d9f7b4a53afaea223dfee5e18835
Add compatibility to build OpenVPN with AWS-LC.

Additional context from PR on Github about changes in ssl_openssl.c
around line 1900:
This change addresses a subtle behavioral difference between AWS-LC
and OpenSSL regarding object ownership semantics in
SSL_CTX_set_client_CA_list(ctx->ctx, cert_names).

OpenSSL Behavior:
Stores a reference to the provided cert_names stack
cert_names remains valid after SSL_CTX_set_client_CA_list

AWS-LC Behavior:
Creates a copy of the parameter cert_names (which is a stack of type
X509_NAME) and converts it to a stack of CRYPTO_BUFFER (how we internally
represent X509_NAME, it's an opaque byte string).  Then frees the original
passed in cert_names.
After SSL_CTX_set_client_CA_list, cert_names no longer points to valid
memory.

The proposed changes reorder operations to getting the size of the
stack before the set operation as opposed to after the set operation.
No operations between the setter and stack size check modify
cert_names. Therefore, the logical outcome should remain the same
- and this would also handle the subtle behavioral difference in
AWS-LC.

Github: closes OpenVPN/openvpn#672
Signed-off-by: Shubham Mittal <smittals@amazon.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20250128220932.2113-1-smittals@amazon.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30682.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
README.awslc [new file with mode: 0644]
src/openvpn/crypto_openssl.c
src/openvpn/openssl_compat.h
src/openvpn/ssl_openssl.c