mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 12:47:47 +00:00
[config] add guard checks for features that require DTLS/TLS support (#11068)
This commit adds guard checks for Border Agent, Commissioner, Joiner, and CoAP Secure API features that use Secure Transport (DTLS/TLS) to ensure `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE` is enabled. It also moves the deprecation check for the earlier DTLS configuration to `openthread-core-config-check.h` to be consistent with other removed/deprecated configurations.
This commit is contained in:
@@ -31,6 +31,10 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE && !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
#error "CoAP Secure API feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
|
||||
#include "coap/coap.hpp"
|
||||
|
||||
@@ -694,4 +694,8 @@
|
||||
#error "OPENTHREAD_CONFIG_MLE_SEND_LINK_REQUEST_ON_ADV_TIMEOUT is removed, behavior is always applied"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_DTLS_ENABLE
|
||||
#error "OPENTHREAD_CONFIG_DTLS_ENABLE was replaced by OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE"
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_CORE_CONFIG_CHECK_H_
|
||||
|
||||
@@ -68,10 +68,6 @@
|
||||
OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_CONFIG_JOINER_ENABLE || OPENTHREAD_CONFIG_BLE_TCAT_ENABLE)
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_DTLS_ENABLE
|
||||
#error "OPENTHREAD_CONFIG_DTLS_ENABLE is deprecated please use OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE instead"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -56,6 +56,10 @@ namespace ot {
|
||||
|
||||
namespace MeshCoP {
|
||||
|
||||
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
#error "Border Agent feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
|
||||
#endif
|
||||
|
||||
class BorderAgent : public InstanceLocator, private NonCopyable
|
||||
{
|
||||
friend class ot::Notifier;
|
||||
|
||||
@@ -63,6 +63,10 @@ namespace ot {
|
||||
|
||||
namespace MeshCoP {
|
||||
|
||||
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
#error "Commissioner feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
|
||||
#endif
|
||||
|
||||
class Commissioner : public InstanceLocator, private NonCopyable
|
||||
{
|
||||
friend class Tmf::Agent;
|
||||
|
||||
@@ -59,6 +59,10 @@ namespace ot {
|
||||
|
||||
namespace MeshCoP {
|
||||
|
||||
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
#error "Joiner feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
|
||||
#endif
|
||||
|
||||
class Joiner : public InstanceLocator, private NonCopyable
|
||||
{
|
||||
friend class Tmf::Agent;
|
||||
|
||||
@@ -48,6 +48,10 @@ namespace ot {
|
||||
|
||||
namespace Ble {
|
||||
|
||||
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
#error "BLE TCAT feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
|
||||
#endif
|
||||
|
||||
class BleSecure : public InstanceLocator, public MeshCoP::Tls::Extension, private NonCopyable
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user