From d47cd45271f8b56a7545c913eb4d9dedd3a202b7 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 23 Jun 2023 17:00:07 +0200 Subject: [PATCH] [meshcop] fix compilation error mbedtls_base64_encode not defined 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 1ff30e41d17..2a4df728d22 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