mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 02:00:12 +00:00
[instance] define key-ref manager only under MTD or FTD builds (#11189)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user