mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 02:37:47 +00:00
[mac] avoid potential assert with SetKeyId() on an invalid frame (#6704)
This commit is contained in:
@@ -331,14 +331,14 @@ void SubMac::ProcessTransmitSecurity(void)
|
||||
VerifyOrExit(mTransmitFrame.GetSecurityEnabled());
|
||||
VerifyOrExit(!mTransmitFrame.IsSecurityProcessed());
|
||||
|
||||
SuccessOrExit(mTransmitFrame.GetKeyIdMode(keyIdMode));
|
||||
|
||||
if (!mTransmitFrame.IsARetransmission())
|
||||
{
|
||||
mTransmitFrame.SetKeyId(mKeyId);
|
||||
}
|
||||
|
||||
VerifyOrExit(ShouldHandleTransmitSecurity());
|
||||
|
||||
SuccessOrExit(mTransmitFrame.GetKeyIdMode(keyIdMode));
|
||||
VerifyOrExit(keyIdMode == Frame::kKeyIdMode1);
|
||||
|
||||
mTransmitFrame.SetAesKey(GetCurrentMacKey());
|
||||
|
||||
Reference in New Issue
Block a user