34
34
#include < sl_matter_test_event_trigger_config.h>
35
35
#endif // defined(SL_MATTER_TEST_EVENT_TRIGGER_ENABLED) && (SL_MATTER_GN_BUILD == 0)
36
36
#endif // NDEBUG
37
- #ifdef OTA_ENCRYPTION_ENABLE
37
+ #ifdef SL_MATTER_ENABLE_OTA_ENCRYPTION
38
38
#include < platform/silabs/multi-ota/OtaTlvEncryptionKey.h>
39
- #endif // OTA_ENCRYPTION_ENABLE
39
+ #endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
40
40
#ifndef SLI_SI91X_MCU_INTERFACE
41
41
#include < psa/crypto.h>
42
42
#endif
@@ -474,7 +474,7 @@ CHIP_ERROR Storage::GetCertificationDeclaration(MutableByteSpan & value)
474
474
err = ReadFileByOffset (*this , " GetDeviceAttestationCert" , SL_CREDENTIALS_CD_OFFSET, SL_CREDENTIALS_CD_SIZE, value);
475
475
}
476
476
#endif
477
- #ifdef CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
477
+ #ifdef SL_MATTER_ENABLE_EXAMPLE_CREDENTIALS
478
478
if (CHIP_ERROR_NOT_FOUND == err)
479
479
{
480
480
// Example CD
@@ -502,7 +502,7 @@ CHIP_ERROR Storage::GetProductAttestationIntermediateCert(MutableByteSpan & valu
502
502
err = ReadFileByOffset (*this , " GetDeviceAttestationCert" , SL_CREDENTIALS_PAI_OFFSET, SL_CREDENTIALS_PAI_SIZE, value);
503
503
}
504
504
#endif
505
- #ifdef CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
505
+ #ifdef SL_MATTER_ENABLE_EXAMPLE_CREDENTIALS
506
506
if (CHIP_ERROR_NOT_FOUND == err)
507
507
{
508
508
// Example PAI
@@ -530,7 +530,7 @@ CHIP_ERROR Storage::GetDeviceAttestationCert(MutableByteSpan & value)
530
530
err = ReadFileByOffset (*this , " GetDeviceAttestationCert" , SL_CREDENTIALS_DAC_OFFSET, SL_CREDENTIALS_DAC_SIZE, value);
531
531
}
532
532
#endif
533
- #ifdef CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
533
+ #ifdef SL_MATTER_ENABLE_EXAMPLE_CREDENTIALS
534
534
if (CHIP_ERROR_NOT_FOUND == err)
535
535
{
536
536
// Example DAC
@@ -569,7 +569,7 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab
569
569
}
570
570
else
571
571
{
572
- #ifdef CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
572
+ #ifdef SL_MATTER_ENABLE_EXAMPLE_CREDENTIALS
573
573
// Example DAC key
574
574
return Examples::GetExampleDACProvider ()->SignWithDeviceAttestationKey (message, signature);
575
575
#else
@@ -605,7 +605,7 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab
605
605
AttestationKey key (kid);
606
606
err = key.SignMessage (message, signature);
607
607
}
608
- #ifdef CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
608
+ #ifdef SL_MATTER_ENABLE_EXAMPLE_CREDENTIALS
609
609
else
610
610
{
611
611
// Example DAC key
@@ -663,23 +663,18 @@ CHIP_ERROR Storage::GetProvisionRequest(bool & value)
663
663
return SilabsConfig::ReadConfigValue (SilabsConfig::kConfigKey_Provision_Request , value);
664
664
}
665
665
666
- #if OTA_ENCRYPTION_ENABLE
666
+ #ifdef SL_MATTER_ENABLE_OTA_ENCRYPTION
667
667
CHIP_ERROR Storage::SetOtaTlvEncryptionKey (const ByteSpan & value)
668
668
{
669
669
chip::DeviceLayer::Silabs::OtaTlvEncryptionKey::OtaTlvEncryptionKey key;
670
670
ReturnErrorOnFailure (key.Import (value.data (), value.size ()));
671
671
return SilabsConfig::WriteConfigValue (SilabsConfig::kOtaTlvEncryption_KeyId , key.GetId ());
672
672
}
673
- #endif // OTA_ENCRYPTION_ENABLE
673
+ #endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
674
674
675
- /* *
676
- * @brief Reads the test event trigger key from NVM. If the key isn't present, returns default value if defined.
677
- *
678
- * @param[out] keySpan output buffer. Must be at least large enough for 16 bytes (ken length)
679
- * @return CHIP_ERROR
680
- */
681
675
CHIP_ERROR Storage::GetTestEventTriggerKey (MutableByteSpan & keySpan)
682
676
{
677
+ #ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
683
678
constexpr size_t kEnableKeyLength = 16 ; // Expected byte size of the EnableKey
684
679
CHIP_ERROR err = CHIP_NO_ERROR;
685
680
size_t keyLength = 0 ;
@@ -689,7 +684,7 @@ CHIP_ERROR Storage::GetTestEventTriggerKey(MutableByteSpan & keySpan)
689
684
err = SilabsConfig::ReadConfigValueBin (SilabsConfig::kConfigKey_Test_Event_Trigger_Key , keySpan.data (), kEnableKeyLength ,
690
685
keyLength);
691
686
#ifndef NDEBUG
692
- #ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
687
+ #ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY
693
688
if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND)
694
689
{
695
690
@@ -702,11 +697,14 @@ CHIP_ERROR Storage::GetTestEventTriggerKey(MutableByteSpan & keySpan)
702
697
}
703
698
err = CHIP_NO_ERROR;
704
699
}
705
- #endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
700
+ #endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY
706
701
#endif // NDEBUG
707
702
708
703
keySpan.reduce_size (kEnableKeyLength );
709
704
return err;
705
+ #else
706
+ return CHIP_ERROR_NOT_IMPLEMENTED;
707
+ #endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
710
708
}
711
709
712
710
} // namespace Provision
0 commit comments