-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenVPN tip of main to CI #1843
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
tests/ci/integration/openvpn_patch/aws-lc-openvpn-master.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c | ||
index fbd38f3d..b4a37d42 100644 | ||
--- a/src/openvpn/crypto_openssl.c | ||
+++ b/src/openvpn/crypto_openssl.c | ||
@@ -1397,7 +1397,7 @@ out: | ||
|
||
return ret; | ||
} | ||
-#elif !defined(LIBRESSL_VERSION_NUMBER) && !defined(ENABLE_CRYPTO_WOLFSSL) | ||
+#elif !defined(LIBRESSL_VERSION_NUMBER) && !defined(ENABLE_CRYPTO_WOLFSSL) && !defined(OPENSSL_IS_AWSLC) | ||
bool | ||
ssl_tls1_PRF(const uint8_t *seed, int seed_len, const uint8_t *secret, | ||
int secret_len, uint8_t *output, int output_len) | ||
@@ -1443,6 +1443,13 @@ out: | ||
EVP_PKEY_CTX_free(pctx); | ||
return ret; | ||
} | ||
+#elif defined(OPENSSL_IS_AWSLC) | ||
+bool | ||
+ssl_tls1_PRF(const uint8_t *label, int label_len, const uint8_t *sec, | ||
+ int slen, uint8_t *out1, int olen) | ||
+{ | ||
+ CRYPTO_tls1_prf(EVP_md5_sha1(), out1, olen, sec, slen, label, label_len, NULL, 0, NULL, 0); | ||
+} | ||
#else /* if defined(LIBRESSL_VERSION_NUMBER) */ | ||
/* LibreSSL and wolfSSL do not expose a TLS 1.0/1.1 PRF via the same APIs as | ||
* OpenSSL does. As result they will only be able to support | ||
diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h | ||
index 95417b22..61b632dd 100644 | ||
--- a/src/openvpn/openssl_compat.h | ||
+++ b/src/openvpn/openssl_compat.h | ||
@@ -75,7 +75,7 @@ X509_OBJECT_free(X509_OBJECT *obj) | ||
#define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT RSA_F_RSA_EAY_PRIVATE_ENCRYPT | ||
#endif | ||
|
||
-#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3050400fL | ||
+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3050400fL || defined(OPENSSL_IS_AWSLC) | ||
#define SSL_get_peer_tmp_key SSL_get_server_tmp_key | ||
#endif | ||
|
||
diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c | ||
index 0d845f4a..c47a0c5d 100644 | ||
--- a/src/openvpn/ssl_openssl.c | ||
+++ b/src/openvpn/ssl_openssl.c | ||
@@ -1631,7 +1631,11 @@ tls_ctx_use_external_ec_key(struct tls_root_ctx *ctx, EVP_PKEY *pkey) | ||
|
||
/* Among init methods, we only need the finish method */ | ||
EC_KEY_METHOD_set_init(ec_method, NULL, openvpn_extkey_ec_finish, NULL, NULL, NULL, NULL); | ||
+#ifdef OPENSSL_IS_AWSLC | ||
+ EC_KEY_METHOD_set_sign(ec_method, ecdsa_sign, NULL, ecdsa_sign_sig); | ||
+#else | ||
EC_KEY_METHOD_set_sign(ec_method, ecdsa_sign, ecdsa_sign_setup, ecdsa_sign_sig); | ||
+#endif | ||
|
||
ec = EC_KEY_dup(EVP_PKEY_get0_EC_KEY(pkey)); | ||
if (!ec) | ||
@@ -1857,9 +1861,11 @@ tls_ctx_load_ca(struct tls_root_ctx *ctx, const char *ca_file, | ||
} | ||
sk_X509_INFO_pop_free(info_stack, X509_INFO_free); | ||
} | ||
- | ||
+ | ||
+ int cnum; | ||
if (tls_server) | ||
{ | ||
+ cnum = sk_X509_NAME_num(cert_names); | ||
SSL_CTX_set_client_CA_list(ctx->ctx, cert_names); | ||
} | ||
|
||
@@ -1872,7 +1878,6 @@ tls_ctx_load_ca(struct tls_root_ctx *ctx, const char *ca_file, | ||
|
||
if (tls_server) | ||
{ | ||
- int cnum = sk_X509_NAME_num(cert_names); | ||
if (cnum != added) | ||
{ | ||
crypto_msg(M_FATAL, "Cannot load CA certificate file %s (only %d " | ||
@@ -2520,7 +2525,7 @@ show_available_tls_ciphers_list(const char *cipher_list, | ||
crypto_msg(M_FATAL, "Cannot create SSL object"); | ||
} | ||
|
||
-#if OPENSSL_VERSION_NUMBER < 0x1010000fL | ||
+#if OPENSSL_VERSION_NUMBER < 0x1010000fL || defined(OPENSSL_IS_AWSLC) | ||
STACK_OF(SSL_CIPHER) *sk = SSL_get_ciphers(ssl); | ||
#else | ||
STACK_OF(SSL_CIPHER) *sk = SSL_get1_supported_ciphers(ssl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: Very minor, but is there a way we could just reconfigure the
release/2.6
string to match our patch directory/file naming scheme? Maybe something like taking the/
out and directing it to arelease2.6
directory or file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine for now, should we decide to add another branch in the future happy to refactor the code as necessary. Currently, not sure what the approach would be - probably some string manipulation stuff that would be overly complex for the current state of this script.