Skip to content

Commit

Permalink
Check if the key is present and not if the key ref is valid, before e…
Browse files Browse the repository at this point in the history
…xporting the key
  • Loading branch information
hemanth-silabs committed Jan 31, 2024
1 parent bdb5807 commit 5e24c4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/thread/key_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ void KeyManager::HandleKeyRotationTimer(void)
void KeyManager::GetNetworkKey(NetworkKey &aNetworkKey) const
{
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
if (Crypto::Storage::IsKeyRefValid(mNetworkKeyRef))
if (Crypto::Storage::HasKey(mNetworkKeyRef))
{
size_t keyLen;

Expand All @@ -535,7 +535,7 @@ void KeyManager::GetNetworkKey(NetworkKey &aNetworkKey) const
void KeyManager::GetPskc(Pskc &aPskc) const
{
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
if (Crypto::Storage::IsKeyRefValid(mPskcRef))
if (Crypto::Storage::HasKey(mPskcRef))
{
size_t keyLen;

Expand Down

0 comments on commit 5e24c4d

Please sign in to comment.