mirror of
https://github.com/espressif/openthread.git
synced 2026-07-26 22:09:05 +00:00
[mac] always set Key Identifier for Transmit Security (#6678)
For multi-layer application, the radio requires from the upper layer to provide information for security processing like Key Identifier, in the Auxiliary Security Header according to IEEE802.15.4-2015. This change matters for handling security processing by radio only.
This commit is contained in:
@@ -328,10 +328,16 @@ void SubMac::ProcessTransmitSecurity(void)
|
||||
const ExtAddress *extAddress = nullptr;
|
||||
uint8_t keyIdMode;
|
||||
|
||||
VerifyOrExit(ShouldHandleTransmitSecurity());
|
||||
VerifyOrExit(mTransmitFrame.GetSecurityEnabled());
|
||||
VerifyOrExit(!mTransmitFrame.IsSecurityProcessed());
|
||||
|
||||
if (!mTransmitFrame.IsARetransmission())
|
||||
{
|
||||
mTransmitFrame.SetKeyId(mKeyId);
|
||||
}
|
||||
|
||||
VerifyOrExit(ShouldHandleTransmitSecurity());
|
||||
|
||||
SuccessOrExit(mTransmitFrame.GetKeyIdMode(keyIdMode));
|
||||
VerifyOrExit(keyIdMode == Frame::kKeyIdMode1);
|
||||
|
||||
@@ -341,7 +347,6 @@ void SubMac::ProcessTransmitSecurity(void)
|
||||
{
|
||||
uint32_t frameCounter = GetFrameCounter();
|
||||
|
||||
mTransmitFrame.SetKeyId(mKeyId);
|
||||
mTransmitFrame.SetFrameCounter(frameCounter);
|
||||
UpdateFrameCounter(frameCounter + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user