Skip to content

Commit ef40bdb

Browse files
[SL-UP] Rename remaining deprecated define to be inline with the new standard (#516)
1 parent ae03713 commit ef40bdb

File tree

13 files changed

+86
-27
lines changed

13 files changed

+86
-27
lines changed

.github/silabs-builds-mgm24.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
{
22
"default": [
33
{
4-
"boards": ["BRD4316A", "BRD4317A", "BRD4318A", "BRD4319A", "BRD2704A"],
4+
"boards": [
5+
"BRD4316A",
6+
"BRD4317A",
7+
"BRD4318A",
8+
"BRD4319A",
9+
"BRD2704A"
10+
],
511
"arguments": ["--docker"]
612
}
13+
],
14+
"lighting-app": [
15+
{
16+
"boards": ["BRD4316A"],
17+
"arguments": [
18+
"--docker",
19+
"chip_enable_multi_ota_requestor=true",
20+
"chip_enable_multi_ota_encryption=false",
21+
"--clean"
22+
]
23+
}
724
]
8-
}
25+
}

.github/silabs-builds-siwx.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,17 @@
44
"boards": ["BRD4338A", "BRD2605A", "BRD4343A"],
55
"arguments": ["--docker", "use_rps_extension=false"]
66
}
7+
],
8+
"lighting-app": [
9+
{
10+
"boards": ["BRD4338A"],
11+
"arguments": [
12+
"--docker",
13+
"use_rps_extension=false",
14+
"chip_enable_multi_ota_requestor=true",
15+
"chip_enable_multi_ota_encryption=false",
16+
"--clean"
17+
]
18+
}
719
]
8-
}
20+
}

examples/platform/silabs/provision/ProvisionStorageDefault.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#endif // NDEBUG
3636
#if defined(SL_MATTER_ENABLE_OTA_ENCRYPTION) && SL_MATTER_ENABLE_OTA_ENCRYPTION
3737
#include <platform/silabs/multi-ota/OtaTlvEncryptionKey.h>
38-
#endif // OTA_ENCRYPTION_ENABLE
38+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
3939
#ifndef SLI_SI91X_MCU_INTERFACE
4040
#include <psa/crypto.h>
4141
#endif
@@ -726,7 +726,22 @@ CHIP_ERROR Storage::DecryptUsingOtaTlvEncryptionKey(MutableByteSpan & block, uin
726726
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
727727
#endif // SL_MBEDTLS_USE_TINYCRYPT
728728
}
729-
#endif // OTA_ENCRYPTION_ENABLE
729+
#else
730+
CHIP_ERROR Storage::SetOtaTlvEncryptionKey(const ByteSpan & value)
731+
{
732+
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
733+
}
734+
735+
CHIP_ERROR Storage::GetOtaTlvEncryptionKeyId(uint32_t & keyId)
736+
{
737+
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
738+
}
739+
740+
CHIP_ERROR Storage::DecryptUsingOtaTlvEncryptionKey(MutableByteSpan & block, uint32_t & ivOffset)
741+
{
742+
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
743+
}
744+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
730745

731746
#if defined(SL_MATTER_TEST_EVENT_TRIGGER_ENABLED) && SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
732747
CHIP_ERROR Storage::SetTestEventTriggerKey(const ByteSpan & value)

examples/platform/silabs/provision/ProvisionStorageFlash.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <string.h>
2828
#if defined(SL_MATTER_ENABLE_OTA_ENCRYPTION) && SL_MATTER_ENABLE_OTA_ENCRYPTION
2929
#include <platform/silabs/multi-ota/OtaTlvEncryptionKey.h>
30-
#endif // OTA_ENCRYPTION_ENABLE
30+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
3131

3232
#if !(SL_MATTER_GN_BUILD || defined(SL_PROVISION_GENERATOR))
3333
#include <sl_matter_provision_config.h>
@@ -789,7 +789,22 @@ CHIP_ERROR Storage::DecryptUsingOtaTlvEncryptionKey(MutableByteSpan & block, uin
789789
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
790790
#endif // SL_MBEDTLS_USE_TINYCRYPT
791791
}
792-
#endif // OTA_ENCRYPTION_ENABLE
792+
#else
793+
CHIP_ERROR Storage::SetOtaTlvEncryptionKey(const ByteSpan & value)
794+
{
795+
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
796+
}
797+
798+
CHIP_ERROR Storage::GetOtaTlvEncryptionKeyId(uint32_t & keyId)
799+
{
800+
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
801+
}
802+
803+
CHIP_ERROR Storage::DecryptUsingOtaTlvEncryptionKey(MutableByteSpan & block, uint32_t & ivOffset)
804+
{
805+
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
806+
}
807+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
793808

794809
CHIP_ERROR Storage::SetTestEventTriggerKey(const ByteSpan & value)
795810
{

src/platform/silabs/efr32/efr32-psa-crypto-config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
#endif // SL_USE_COAP_CONFIG
3535

3636
// Multi-chip OTA encryption processing
37-
#if OTA_ENCRYPTION_ENABLE
37+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
3838
#define PSA_WANT_ALG_CTR
39-
#endif // OTA_ENCRYPTION_ENABLE
39+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
4040

4141
// Include Generated fies
4242
#include "psa_crypto_config.h"

src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CHIP_ERROR OTAFactoryDataProcessor::ProcessInternal(ByteSpan & block)
2828
CHIP_ERROR error = CHIP_NO_ERROR;
2929

3030
ReturnErrorOnFailure(mAccumulator.Accumulate(block));
31-
#if OTA_ENCRYPTION_ENABLE
31+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
3232
MutableByteSpan byteBlock = MutableByteSpan(mAccumulator.data(), mAccumulator.GetThreshold());
3333
OTATlvProcessor::vOtaProcessInternalEncryption(byteBlock);
3434
#endif

src/platform/silabs/multi-ota/OTAFirmwareProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ CHIP_ERROR OTAFirmwareProcessor::ProcessInternal(ByteSpan & block)
4747
if (!mDescriptorProcessed)
4848
{
4949
ReturnErrorOnFailure(ProcessDescriptor(block));
50-
#if OTA_ENCRYPTION_ENABLE
50+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
5151
/* 16 bytes to used to store undecrypted data because of unalignment */
5252
mAccumulator.Init(requestedOtaMaxBlockSize + 16);
5353
#endif
5454
}
55-
#if OTA_ENCRYPTION_ENABLE
55+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
5656
MutableByteSpan byteBlock = MutableByteSpan(mAccumulator.data(), mAccumulator.GetThreshold());
5757
memcpy(&byteBlock[0], &byteBlock[requestedOtaMaxBlockSize], mUnalignmentNum);
5858
memcpy(&byteBlock[mUnalignmentNum], block.data(), block.size());

src/platform/silabs/multi-ota/OTATlvProcessor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <headers/ProvisionStorage.h>
2525
#include <platform/silabs/multi-ota/OTAMultiImageProcessorImpl.h>
2626
#include <platform/silabs/multi-ota/OTATlvProcessor.h>
27-
#if OTA_ENCRYPTION_ENABLE
27+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
2828
#include <platform/silabs/multi-ota/OtaTlvEncryptionKey.h>
2929
#endif
3030

@@ -37,7 +37,7 @@ CHIP_ERROR OTATlvProcessor::Init()
3737
{
3838
VerifyOrReturnError(mCallbackProcessDescriptor != nullptr, CHIP_OTA_PROCESSOR_CB_NOT_REGISTERED);
3939
mAccumulator.Init(GetAccumulatorLength());
40-
#ifdef OTA_ENCRYPTION_ENABLE
40+
#ifdef SL_MATTER_ENABLE_OTA_ENCRYPTION
4141
mUnalignmentNum = 0;
4242
#endif
4343
return CHIP_NO_ERROR;
@@ -48,7 +48,7 @@ CHIP_ERROR OTATlvProcessor::Clear()
4848
OTATlvProcessor::ClearInternal();
4949
mAccumulator.Clear();
5050
mDescriptorProcessed = false;
51-
#ifdef OTA_ENCRYPTION_ENABLE
51+
#ifdef SL_MATTER_ENABLE_OTA_ENCRYPTION
5252
mUnalignmentNum = 0;
5353
#endif
5454
return CHIP_NO_ERROR;
@@ -90,7 +90,7 @@ void OTATlvProcessor::ClearInternal()
9090
mProcessedLength = 0;
9191
mWasSelected = false;
9292
mLastBlock = false;
93-
#if OTA_ENCRYPTION_ENABLE
93+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
9494
mIVOffset = 0;
9595
#endif
9696
}
@@ -137,7 +137,7 @@ CHIP_ERROR OTADataAccumulator::Accumulate(ByteSpan & block)
137137
return CHIP_NO_ERROR;
138138
}
139139

140-
#if OTA_ENCRYPTION_ENABLE
140+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
141141
CHIP_ERROR OTATlvProcessor::vOtaProcessInternalEncryption(MutableByteSpan & block)
142142
{
143143
#if defined(SL_MBEDTLS_USE_TINYCRYPT)
@@ -181,5 +181,5 @@ CHIP_ERROR OTATlvProcessor::RemovePadding(MutableByteSpan & block)
181181
block.reduce_size(block.size() - padLength);
182182
return CHIP_NO_ERROR;
183183
}
184-
#endif // OTA_ENCRYPTION_ENABLE
184+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
185185
} // namespace chip

src/platform/silabs/multi-ota/OTATlvProcessor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class OTATlvProcessor
154154
bool IsValidTag(OTAProcessorTag tag);
155155
bool IsLastBlock() const { return mLastBlock; }
156156

157-
#ifdef OTA_ENCRYPTION_ENABLE
157+
#ifdef SL_MATTER_ENABLE_OTA_ENCRYPTION
158158
CHIP_ERROR vOtaProcessInternalEncryption(MutableByteSpan & block);
159159
/**
160160
* @brief Remove padding from the given block.
@@ -198,7 +198,7 @@ class OTATlvProcessor
198198
bool IsError(CHIP_ERROR & status);
199199
virtual uint32_t GetAccumulatorLength() const { return sizeof(Descriptor); }
200200

201-
#ifdef OTA_ENCRYPTION_ENABLE
201+
#ifdef SL_MATTER_ENABLE_OTA_ENCRYPTION
202202
/*ota decryption*/
203203
uint32_t mIVOffset = 0;
204204
/* Expected byte size of the OTAEncryptionKeyLength */

src/platform/silabs/multi-ota/SiWx917/OTAWiFiFirmwareProcessor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ CHIP_ERROR OTAWiFiFirmwareProcessor::ProcessInternal(ByteSpan & block)
3737
if (!mDescriptorProcessed)
3838
{
3939
ReturnErrorOnFailure(ProcessDescriptor(block));
40-
#if OTA_ENCRYPTION_ENABLE
40+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
4141
/* 16 bytes to used to store undecrypted data because of unalignment */
4242
mAccumulator.Init(requestedOtaMaxBlockSize + 16);
43-
#endif // OTA_ENCRYPTION_ENABLE
43+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
4444
}
4545

46-
#if OTA_ENCRYPTION_ENABLE
46+
#if SL_MATTER_ENABLE_OTA_ENCRYPTION
4747
MutableByteSpan byteBlock = MutableByteSpan(mAccumulator.data(), mAccumulator.GetThreshold());
4848
memcpy(&byteBlock[0], &byteBlock[requestedOtaMaxBlockSize], mUnalignmentNum);
4949
memcpy(&byteBlock[mUnalignmentNum], block.data(), block.size());
@@ -70,7 +70,7 @@ CHIP_ERROR OTAWiFiFirmwareProcessor::ProcessInternal(ByteSpan & block)
7070
ChipLogError(SoftwareUpdate, "Failed to remove padding"));
7171
}
7272
block = byteBlock;
73-
#endif // OTA_ENCRYPTION_ENABLE
73+
#endif // SL_MATTER_ENABLE_OTA_ENCRYPTION
7474

7575
if (mFWchunkType == SL_FWUP_RPS_HEADER)
7676
{

0 commit comments

Comments
 (0)