File tree 3 files changed +12
-11
lines changed
config/nrfconnect/chip-module
3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -330,9 +330,7 @@ endif # CHIP_FACTORY_DATA_BUILD
330
330
331
331
# See config/zephyr/Kconfig for full definition
332
332
config CHIP_FACTORY_RESET_ERASE_SETTINGS
333
- default y
334
- depends on NVS || ZMS
335
- depends on !CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
333
+ default y if !CHIP_CRYPTO_PSA_DAC_PRIV_KEY_ITS || BUILD_WITH_TFM
336
334
337
335
config CHIP_LOG_SIZE_OPTIMIZATION
338
336
bool "Disable some detailed logs to decrease flash usage"
@@ -369,9 +367,12 @@ config CHIP_ENABLE_READ_CLIENT
369
367
370
368
config CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
371
369
bool "Migrate DAC private key from factory data to a secure storage"
370
+ default y
372
371
depends on CHIP_CRYPTO_PSA
373
372
depends on CHIP_FACTORY_DATA
374
373
374
+ if CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
375
+
375
376
choice CHIP_CRYPTO_PSA_DAC_PRIV_KEY_MIGRATION_DEST
376
377
prompt "Destination for DAC private key migration"
377
378
default CHIP_CRYPTO_PSA_DAC_PRIV_KEY_ITS
@@ -409,6 +410,8 @@ config CHIP_CRYPTO_PSA_DAC_PRIV_KEY_KMU_ENCRYPTED
409
410
help
410
411
Encrypt the DAC private key in the CRACEN KMU secure storage.
411
412
413
+ endif # CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
414
+
412
415
config CHIP_PERSISTENT_SUBSCRIPTIONS
413
416
default n
414
417
# selecting experimental for this feature since there is an issue with multiple controllers.
Original file line number Diff line number Diff line change @@ -433,9 +433,6 @@ config MBEDTLS_SSL_COOKIE_C
433
433
config MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH
434
434
default y
435
435
436
- config CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
437
- default y if !CHIP_WIFI
438
-
439
436
# ==============================================================================
440
437
# Logging configuration
441
438
# ==============================================================================
Original file line number Diff line number Diff line change @@ -174,15 +174,16 @@ CHIP_ERROR FactoryDataProvider<FlashFactoryData>::MoveDACPrivateKeyToSecureStora
174
174
#else
175
175
psa_set_key_lifetime (&attributes, PSA_KEY_LIFETIME_VOLATILE);
176
176
#endif // CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
177
+ VerifyOrReturnError (psa_import_key (&attributes, reinterpret_cast <uint8_t *>(mFactoryData .dac_priv_key .data ),
178
+ mFactoryData .dac_priv_key .len , &mDACPrivKeyId ) == PSA_SUCCESS,
179
+ CHIP_ERROR_INTERNAL);
177
180
}
178
- VerifyOrReturnError (psa_import_key (&attributes, reinterpret_cast <uint8_t *>(mFactoryData .dac_priv_key .data ),
179
- mFactoryData .dac_priv_key .len , &mDACPrivKeyId ) == PSA_SUCCESS,
180
- CHIP_ERROR_INTERNAL);
181
181
182
182
#ifdef CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY
183
- #ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS
183
+ #if defined(CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS) && defined(CONFIG_CHIP_CRYPTO_PSA_DAC_PRIV_KEY_ITS) && \
184
+ !defined (CONFIG_BUILD_WITH_TFM)
184
185
#error "Do not use both CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS and CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY kconfig options " \
185
- " because you will permanently lose the DAC private key from the device."
186
+ " while saving the DAC private key to ITS because you will permanently lose the DAC private key from the device."
186
187
#endif
187
188
// Check once again if the saved key has attributes set before removing it from the factory data set.
188
189
VerifyOrReturnError (psa_get_key_attributes (mDACPrivKeyId , &attributes) == PSA_SUCCESS, CHIP_ERROR_INTERNAL);
You can’t perform that action at this time.
0 commit comments