[mac] clear mode2 key only on mac destruction

This commit is contained in:
zwx
2025-12-29 10:46:37 +08:00
parent e16325e99f
commit 1289536e72
2 changed files with 5 additions and 1 deletions
+5
View File
@@ -134,6 +134,11 @@ public:
*/
explicit Mac(Instance &aInstance);
/**
* Clears the Mode2Key on destruction.
*/
~Mac(void) { ClearMode2Key(); }
/**
* Starts an IEEE 802.15.4 Active Scan.
*
-1
View File
@@ -691,7 +691,6 @@ void KeyManager::DestroyTemporaryKeys(void)
mMleKey.Clear();
mKek.Clear();
Get<Mac::SubMac>().ClearMacKeys();
Get<Mac::Mac>().ClearMode2Key();
}
void KeyManager::DestroyPersistentKeys(void) { Get<Crypto::Storage::KeyRefManager>().DestroyPersistentKeys(); }