[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:
Abtin Keshavarzian
2024-12-04 10:19:58 -08:00
committed by Jonathan Hui
parent f0d6007cc3
commit 53c02c6141
17 changed files with 441 additions and 565 deletions
+2 -1
View File
@@ -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);
}