[border-agent] invoke ephemeral key callback on session connection (#10699)

This commit updates the Border Agent to invoke the ephemeral key
callback when a commissioner candidate successfully establishes a
secure session using the ephemeral key. This can be identified by
checking the state `otBorderAgentGetState()` and matching it with
`OT_BORDER_AGENT_STATE_ACTIVE`. This new signal can be used to stop
advertising the mDNS service "_meshcop-e._udp" earlier (since the
ephemeral key is one-time use).
This commit is contained in:
Abtin Keshavarzian
2024-10-30 13:03:08 -07:00
committed by GitHub
parent 382337f9b3
commit 06d83fcca1
3 changed files with 5 additions and 1 deletions
+3
View File
@@ -257,6 +257,9 @@ bool otBorderAgentIsEphemeralKeyActive(otInstance *aInstance);
*
* - The Border Agent starts using an ephemeral key.
* - Any parameter related to the ephemeral key, such as the port number, changes.
* - A commissioner candidate successfully establishes a secure session with the Border Agent using the ephemeral key.
* This situation can be identified by `otBorderAgentGetState()` being `OT_BORDER_AGENT_STATE_ACTIVE` (this event
* can be used to stop advertising the mDNS service "_meshcop-e._udp").
* - The Border Agent stops using the ephemeral key due to:
* - A direct call to `otBorderAgentClearEphemeralKey()`.
* - The ephemeral key timing out.
+1 -1
View File
@@ -52,7 +52,7 @@ extern "C" {
*
* @note This number versions both OpenThread platform and user APIs.
*/
#define OPENTHREAD_API_VERSION (459)
#define OPENTHREAD_API_VERSION (460)
/**
* @addtogroup api-instance
+1
View File
@@ -655,6 +655,7 @@ void BorderAgent::HandleConnected(SecureTransport::ConnectEvent aEvent)
if (mUsingEphemeralKey)
{
mCounters.mEpskcSecureSessionSuccesses++;
mEphemeralKeyTask.Post();
}
else
#endif