Skip to content

Commit 02a3488

Browse files
[nrf noup] [Zephyr] Prevent from removing DAC Private Key
Prevent from removing DAC Private Key from ITS during factory reset.
1 parent c6d0842 commit 02a3488

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/platform/Zephyr/ConfigurationManagerImpl.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
219219
for (uint32_t keyID = static_cast<uint32_t>(chip::Crypto::KeyIdBase::Minimum);
220220
keyID <= static_cast<uint32_t>(chip::Crypto::KeyIdBase::Maximum); keyID++)
221221
{
222+
#ifdef CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
223+
// Prevent from removing DAC Private Key
224+
if (keyID == static_cast<uint32_t>(chip::Crypto::KeyIdBase::DACPrivKey))
225+
{
226+
continue;
227+
}
228+
#endif
222229
psa_destroy_key(static_cast<psa_key_id_t>(keyID));
223230
}
224231
#endif

0 commit comments

Comments
 (0)