mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 06:37:46 +00:00
[secure-transport] introduce Extension class (#10978)
This commit updates `SecureTransport`. It introduces the `Extension` class within `SecureTransport`, providing support for additional cipher suites and related methods to configure the ciphers (e.g., `SetPreSharedKey()`, `SetCertificate()`). This class decouples this functionality from the common `SecureTransport` object, allowing it to be added to any class. Classes like `ApplicationCoapSecure` or `BleSecure` can inherit from `Extension` to provide these methods. An `Extension` is then associated with a `SecureTransport` (or any of its subclasses). This approach ensures that only instances requiring extended cipher suite support incur the associated memory cost and avoid repeated code. This commit also introduces `Dtls`, `DtlsExtended`, and `Tls` as subclasses of `SecureTransport` for easier use by other modules.
This commit is contained in:
committed by
Jonathan Hui
parent
f0d6007cc3
commit
53c02c6141
@@ -273,7 +273,8 @@ Message::Priority Agent::DscpToPriority(uint8_t aDscp)
|
||||
#if OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
|
||||
SecureAgent::SecureAgent(Instance &aInstance)
|
||||
: Coap::CoapSecureBase(aInstance, kNoLinkSecurity)
|
||||
: Coap::CoapSecureBase(aInstance, mDtls)
|
||||
, mDtls(aInstance, kNoLinkSecurity)
|
||||
{
|
||||
SetResourceHandler(&HandleResource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user