Skip to content

Commit 7544bea

Browse files
committed
ROX-33133: Remove hardcoded key-exchange in gRPC
1 parent 38c0ab7 commit 7544bea

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

builder/install/40-grpc.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ export CXXFLAGS="-Wno-error=class-memaccess -Wno-ignored-qualifiers -Wno-stringo
77
cd third_party/grpc
88

99
cp NOTICE.txt "${LICENSE_DIR}/grpc-${GRPC_REVISION}"
10+
11+
# ROX-33133: Remove hardcoded P-256 curve from gRPC (OpenSSL 3.x only) to allow
12+
# OpenSSL to use system crypto-policies defaults, enabling post-quantum key
13+
# exchange (ML-KEM). See: https://github.com/grpc/grpc/issues/23083
14+
patch -p1 < ../../builder/install/grpc-pq-curves.patch
15+
1016
mkdir -p cmake/build
1117
cd cmake/build
1218
cmake \
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Remove hardcoded P-256 curve for OpenSSL 3.x to allow system crypto-policies
2+
defaults, enabling post-quantum key exchange (X25519MLKEM768).
3+
4+
See: https://github.com/grpc/grpc/issues/23083
5+
6+
--- a/src/core/tsi/ssl_transport_security.cc
7+
+++ b/src/core/tsi/ssl_transport_security.cc
8+
@@ -819,12 +819,7 @@ static tsi_result populate_ssl_context(
9+
}
10+
SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
11+
EC_KEY_free(ecdh);
12+
-#else
13+
- if (!SSL_CTX_set1_groups(context, kSslEcCurveNames, 1)) {
14+
- LOG(ERROR) << "Could not set ephemeral ECDH key.";
15+
- return TSI_INTERNAL_ERROR;
16+
- }
17+
- SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
18+
#endif
19+
}
20+
return TSI_OK;

0 commit comments

Comments
 (0)