From 9fd1da5b9e8e7bd8cbf0242f390eb666fca4203b Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 29 Jun 2023 05:20:05 +0200 Subject: [PATCH] [meshcop] fix compilation error mbedtls_base64_encode not defined (#9206) Fix compilation error mbedtls_base64_encode not defined when compiling with MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED disabled. The logic for including the mbedtls/base64.h header file is doing the wrong define check. Signed-off-by: Joakim Andersson --- src/core/meshcop/dtls.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/meshcop/dtls.hpp b/src/core/meshcop/dtls.hpp index 1ff30e41d..2a4df728d 100644 --- a/src/core/meshcop/dtls.hpp +++ b/src/core/meshcop/dtls.hpp @@ -42,8 +42,10 @@ #include #if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE -#ifdef MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +#if defined(MBEDTLS_BASE64_C) && defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) #include +#endif +#ifdef MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED #include #include #include