[instance] define key-ref manager only under MTD or FTD builds (#11189)

This commit is contained in:
Abtin Keshavarzian
2025-01-23 11:32:50 -08:00
committed by GitHub
parent 648f1a982d
commit 6694d5c275
4 changed files with 15 additions and 7 deletions
+4
View File
@@ -57,6 +57,8 @@ exit:
return error;
}
#if OPENTHREAD_FTD || OPENTHREAD_MTD
void Storage::KeyRefManager::DestroyPersistentKeys(void)
{
DestroyKey(KeyRefFor(kNetworkKey));
@@ -68,6 +70,8 @@ void Storage::KeyRefManager::DestroyPersistentKeys(void)
DestroyKey(KeyRefFor(kEcdsa));
}
#endif
#endif // OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
LiteralKey::LiteralKey(const Key &aKey)
+4
View File
@@ -97,6 +97,8 @@ typedef otCryptoKeyRef KeyRef;
constexpr KeyRef kInvalidKeyRef = 0x80000000; ///< Invalid `KeyRef` value (PSA_KEY_ID_VENDOR_MAX + 1).
#if OPENTHREAD_FTD || OPENTHREAD_MTD
/**
* Manages and selects the `KeyRef` values.
*/
@@ -174,6 +176,8 @@ private:
#endif
};
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
/**
* Determine if a given `KeyRef` is valid or not.
*
+3 -3
View File
@@ -75,9 +75,6 @@ Instance::Instance(void)
: mTimerMilliScheduler(*this)
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
, mTimerMicroScheduler(*this)
#endif
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
, mCryptoStorageKeyRefManager(*this)
#endif
, mRadio(*this)
#if OPENTHREAD_CONFIG_UPTIME_ENABLE
@@ -93,6 +90,9 @@ Instance::Instance(void)
// DNS-SD (mDNS) platform is initialized early to
// allow other modules to use it.
, mDnssd(*this)
#endif
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
, mCryptoStorageKeyRefManager(*this)
#endif
, mIp6(*this)
, mThreadNetif(*this)
+4 -4
View File
@@ -465,10 +465,6 @@ private:
Random::Manager mRandomManager;
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
Crypto::Storage::KeyRefManager mCryptoStorageKeyRefManager;
#endif
// Radio is initialized before other member variables
// (particularly, SubMac and Mac) to allow them to use its methods
// from their constructor.
@@ -494,6 +490,10 @@ private:
Dnssd mDnssd;
#endif
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
Crypto::Storage::KeyRefManager mCryptoStorageKeyRefManager;
#endif
Ip6::Ip6 mIp6;
ThreadNetif mThreadNetif;
Tmf::Agent mTmfAgent;