Skip to content
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

DONTMERGE [common] Update ciphersuite used for securing pipe/UDS connections #1918

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/src/crypto/adapters/mbedtls_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ int lib_SSLInit(LIB_SSL_CONTEXT* ssl_ctx, int stream_fd, bool is_server, const u

memset(ssl_ctx, 0, sizeof(*ssl_ctx));

ssl_ctx->ciphersuites[0] = MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256;
ssl_ctx->ciphersuites[0] = MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256;
memset(&ssl_ctx->ciphersuites[1], 0, sizeof(ssl_ctx->ciphersuites[1]));

ssl_ctx->pal_recv_cb = pal_recv_cb;
Expand Down
9 changes: 7 additions & 2 deletions subprojects/packagefiles/mbedtls/include/mbedtls/config-pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#define MBEDTLS_HAVE_X86_64
#endif
#define MBEDTLS_HKDF_C
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
#define MBEDTLS_MD_C
#define MBEDTLS_NET_C
#define MBEDTLS_NO_PLATFORM_ENTROPY
Expand All @@ -49,9 +48,15 @@
#define MBEDTLS_PLATFORM_ZEROIZE_ALT
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C

/* below features are to implement DHE-PSK based secure-pipe sessions */
#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
/* We use DHE (slightly weaker than ECDHE) because it's the strongest PSK ciphersuite that offers
* AES-128 and GCM; note that there is no GCM or CCM support for ECDHE-PSK yet. See issue
* https://github.com/Mbed-TLS/mbedtls/issues/8170 that tracks ECDHE-AES-GCM support status. */
#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256