From a66703773f1d8847cf4b5ba58ecd2e2156172dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Duda?= Date: Thu, 23 Sep 2021 18:13:08 +0200 Subject: [PATCH] [dtls] ensure mbedtls_ssl_key_export_type is defined (#7025) For certain external mbedTLS configurations, there is no much sense to define MBEDTLS_SSL_EXPORT_KEYS when OT has Joiner || Commissioner || DTLS functionalities disabled. This commit only ensures that such builds don't fail. The mbedtls_ssl_key_export_type type is defined only when MBEDTLS_SSL_EXPORT_KEYS is defined, while dtls.hpp is always taken into the build process. --- 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 505fdbe1a..40db55168 100644 --- a/src/core/meshcop/dtls.hpp +++ b/src/core/meshcop/dtls.hpp @@ -391,6 +391,7 @@ private: static int HandleMbedtlsTransmit(void *aContext, const unsigned char *aBuf, size_t aLength); int HandleMbedtlsTransmit(const unsigned char *aBuf, size_t aLength); +#ifdef MBEDTLS_SSL_EXPORT_KEYS #if (MBEDTLS_VERSION_NUMBER >= 0x03000000) static void HandleMbedtlsExportKeys(void * aContext, @@ -422,7 +423,8 @@ private: size_t aKeyLength, size_t aIvLength); -#endif +#endif // (MBEDTLS_VERSION_NUMBER >= 0x03000000) +#endif // MBEDTLS_SSL_EXPORT_KEYS static void HandleTimer(Timer &aTimer); void HandleTimer(void);