Skip to content

Commit a2845d9

Browse files
[SL-UP] Revert provision keystore to maintain backward compatibility (#205)
1 parent a68091a commit a2845d9

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

examples/platform/silabs/provision/ProvisionStorageFlash.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,7 @@ CHIP_ERROR Storage::GetDeviceAttestationCert(MutableByteSpan & value)
634634

635635
CHIP_ERROR Storage::SetDeviceAttestationKey(const ByteSpan & value)
636636
{
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
643637
return Flash::Set(Parameters::ID::kDacKey, value.data(), value.size());
644-
#endif // SLI_SI91X_MCU_INTERFACE
645638
}
646639

647640
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
668661
#endif // CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
669662
ReturnErrorOnFailure(err);
670663
#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);
672668
#else
673669
AttestationKey key;
674670
ReturnErrorOnFailure(key.Import(temp, size));

0 commit comments

Comments
 (0)