@@ -634,14 +634,7 @@ CHIP_ERROR Storage::GetDeviceAttestationCert(MutableByteSpan & value)
634
634
635
635
CHIP_ERROR Storage::SetDeviceAttestationKey (const ByteSpan & value)
636
636
{
637
- #if (defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE)
638
- uint8_t temp[kDeviceAttestationKeySizeMax ] = { 0 };
639
- MutableByteSpan private_key (temp);
640
- AttestationKey::Unwrap (value.data (), value.size (), private_key);
641
- return Flash::Set (Parameters::ID::kDacKey , private_key.data (), private_key.size ());
642
- #else
643
637
return Flash::Set (Parameters::ID::kDacKey , value.data (), value.size ());
644
- #endif // SLI_SI91X_MCU_INTERFACE
645
638
}
646
639
647
640
CHIP_ERROR Storage::GetDeviceAttestationCSR (uint16_t vid, uint16_t pid, const CharSpan & cn, MutableCharSpan & csr)
@@ -668,7 +661,10 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab
668
661
#endif // CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
669
662
ReturnErrorOnFailure (err);
670
663
#if (defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE)
671
- return AttestationKey::SignMessageWithKey (temp, message, signature);
664
+ uint8_t key_buffer[kDeviceAttestationKeySizeMax ] = { 0 };
665
+ MutableByteSpan private_key (key_buffer);
666
+ AttestationKey::Unwrap (temp, size, private_key);
667
+ return AttestationKey::SignMessageWithKey ((const uint8_t *) key_buffer, message, signature);
672
668
#else
673
669
AttestationKey key;
674
670
ReturnErrorOnFailure (key.Import (temp, size));
0 commit comments