Skip to content

Commit c57f203

Browse files
authored
Merge branch 'master' into camera-webrtc-server
2 parents 8ad4efd + a3a443a commit c57f203

File tree

295 files changed

+8405
-6394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+8405
-6394
lines changed

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,7 @@ rebase
11951195
recommand
11961196
recommanded
11971197
recurse
1198+
refrigeratoralarm
11981199
regen
11991200
registerAttributeAccessOverride
12001201
RegisterCommandHandler

build/chip/esp32/esp32_codegen.cmake

-77
This file was deleted.

docs/platforms/nxp/nxp_manufacturing_flow.md

+49-66
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ Here is the interpretation of the **required** parameters:
103103
--hw_version -> Hardware Version as number
104104
--hw_version_str -> Hardware Version as string
105105
--cert_declaration -> path to the Certification Declaration (der format) location
106-
--dac_cert -> path to the DAC (der format) location
107-
--dac_key -> path to the DAC key (der format) location
108106
--pai_cert -> path to the PAI (der format) location
109107
--spake2p_path -> path to the spake2p tool
110108
--out -> name of the binary that will be used for storing all the generated data
@@ -113,6 +111,11 @@ Here is the interpretation of the **required** parameters:
113111
Here is the interpretation of the **optional** parameters:
114112

115113
```shell
114+
--dac_cert -> path to the DAC certificate (der format) location
115+
--dac_key -> path to the DAC key (der format) location
116+
--EL2GO_bin -> path to the EdgeLock 2Go binary (bin format) location
117+
--EL2GO_DAC_KEY_ID -> DAC key ID configured into EdgeLock 2Go as hex value
118+
--EL2GO_DAC_CERT_ID -> DAC certificate ID configured into EdgeLock 2Go as hex value
116119
--dac_key_password -> Password to decode DAC key
117120
--dac_key_use_sss_blob -> Used when --dac_key contains a path to an encrypted blob, instead of the
118121
actual DAC private key. The blob metadata size is 24, so the total length
@@ -182,17 +185,56 @@ Also, demo **DAC**, **PAI** and **PAA** certificates needed in case
182185

183186
## 6. Increased security for DAC private key
184187

185-
### 6.1 SSS-based platforms
188+
### 6.1 SSS-based with EdgeLock2go support
189+
190+
EdgeLock2go services could be used to securely provisioned DAC key/cert during
191+
manufacturing.
192+
193+
Prior to the generation of the factory data binary. `EL2GO` data needs to be
194+
generated following `EL2GO` process.
195+
196+
For the factory data generation following option need to be added:
197+
198+
`--EL2GO_bin ~/secure_objects.bin` containing `EL2GO` information including
199+
encrypted DAC private key and certificate. `--EL2GO_DAC_KEY_ID 1234` containing
200+
corresponding to the ID of the DAC key chosen during `EL2GO` key generation.
201+
`--EL2GO_DAC_CERT_ID 4321` containing corresponding to the ID of the DAC
202+
certification chosen during `EL2GO` key generation.
203+
204+
Reference factory data generation command:
205+
206+
```shell
207+
python3 ./scripts/tools/nxp/factory_data_generator/generate.py -i 10000 -s UXKLzwHdN3DZZLBaL2iVGhQi/OoQwIwJRQV4rpEalbA= -p ${passcode} -d ${discriminator} --vid "0x$VID" --pid "0x$PID" --vendor_name "NXP Semiconductors" --product_name "Thermostat" --serial_num "12345678" --date "$DATE" --hw_version 1 --hw_version_str "1.0" --cert_declaration $FACTORY_DATA_DEST/Chip-Test-CD-$VID-$PID.der --EL2GO_bin ~/secure_objects.bin --EL2GO_DAC_KEY_ID 1234 --EL2GO_DAC_CERT_ID 4321 --pai_cert $FACTORY_DATA_DEST/Chip-PAI-NXP-$VID-$PID-Cert.der --spake2p_path ./out/spake2p --unique_id "00112233445566778899aabbccddeeff" --out $FACTORY_DATA_DEST/factory_data.bin
208+
```
209+
210+
Supported platforms:
211+
212+
- `rw61x`
213+
214+
In addition to the GN flag `nxp_use_factory_data=true`, a Matter application
215+
needs to be built with `nxp_enable_secure_EL2GO_factory_data=true` to allow
216+
loading of EdgeLock2go data to the secure element.
217+
218+
In this mode EdgeLock2go keys will always remain encrypted and only usable by
219+
the `SSS`. In this case, all operations that requires DAC private access will be
220+
transferred to the `SSS`.
221+
222+
### 6.2 SSS-based without EdgeLock2go support for DAC private key secure storage
186223

187224
Supported platforms:
188225

189226
- `k32w1`
190227
- `mcxw71`
228+
- `rw61x`
191229

192230
For platforms that have a secure subsystem (`SSS`), the DAC private key can be
193231
converted to an encrypted blob. This blob will overwrite the DAC private key in
194-
factory data and will be imported in the `SSS` at initialization, by the factory
195-
data provider instance.
232+
factory data and will be imported in the `SSS` by the factory data provider
233+
instance.
234+
235+
In this architecture, outside of the manufacturing flow, the DAC private will
236+
always remain usable only by the `SSS`. In this case, all operations that
237+
requires DAC private access will be transferred to the `SSS`.
196238

197239
The application will check at initialization whether the DAC private key has
198240
been converted or not and convert it if needed. However, the conversion process
@@ -226,64 +268,5 @@ Please note that `--dac_key` now points to a binary file that contains the
226268
encrypted blob.
227269

228270
The user can use the DAC private in plain text instead of using the `SSS` by
229-
adding the following gn argument `chip_use_plain_dac_key=true`.
230-
231-
### 6.2 RW61X
232-
233-
Supported platforms:
234-
235-
- RW61X
236-
237-
there are three implementations for factory data protection
238-
239-
- whole factory data protection with AES encryption (
240-
nxp_use_factory_data=true nxp_enable_secure_whole_factory_data=true )
241-
`examples/platform/nxp/rt/rw61x/factory_data/source/AppFactoryDataExample.cpp`\
242-
`src/platform/nxp/rt/rw61x/FactoryDataProviderEncImpl.cpp`
243-
244-
- only dac private key protection ( nxp_use_factory_data=true
245-
nxp_enable_secure_dac_private_key_storage=true )
246-
`examples/platform/nxp/rt/rw61x/factory_data/source/AppFactoryDataExample.cpp`
247-
\
248-
`src/platform/nxp/rt/rw61x/FactoryDataProviderImpl.cpp`
249-
250-
- whole factory data protection with hard-coded AES key (
251-
nxp_use_factory_data=true )
252-
`examples/platform/nxp/common/factory_data/source/AppFactoryDataDefaultImpl.cpp`
253-
\
254-
`src/platform/nxp/common/factory_data/FactoryDataProviderFwkImpl.cpp`
255-
256-
for the first one, the whole factory data is encrypted by an AES-256 key, the
257-
AES key can be passed through serial link when in factory production mode, and
258-
will be provisioned into Edge Lock, and the returned AES Key blob (wrapped key)
259-
can be stored in the end of factory data region in TLV format. for the
260-
decryption process, the blob is retrieved and provisioned into Edge Lock and the
261-
whole factory data can be decrypted using the returned key index in Edge Lock.
262-
Compared with only dac private key protection solution, this solution can avoid
263-
tampering with the original factory data.
264-
265-
the factory data should be encrypted by an AES-256 key using "--aes256_key"
266-
option in "generate.py" script file.
267-
268-
it will check whether there is AES key blob in factory data region when in each
269-
initialization, if not, the default AES key is converted and the result is
270-
stored into flash, it run only once.
271-
272-
for the second one, it only protect the dac private key inside the factory data,
273-
the dac private key is retrieved and provisioned into Edge Lock, the returned
274-
key blob replace the previous dac private key, and also update the overall size
275-
and hash, and re-write the factory data. when device is doing matter
276-
commissioning, the blob is retrieved and provisioned into Edge Lock and the
277-
signing can be done using the returned key index in Edge Lock.
278-
279-
the factory data should be plain text for the first programming. it will check
280-
whether there is dac private key blob (base on the size of blob, should be 48)
281-
in factory data when in each initialization, if not, the dac private key is
282-
converted and the result is stored into flash, it run only once.
283-
284-
for the third one, it is a little similar to the first one, the whole factory
285-
data is encrypted by an AES key, but there are two differences:
286-
287-
- the AES key is hard-coded and not provisioned into Edge Lock
288-
- the factory data should be encrypted by AES-128 key using "--aes128_key"
289-
option in "generate.py" script file.
271+
adding the following gn argument `chip_use_plain_dac_key=true` (not supported on
272+
rw61x).

docs/testing/fuzz_testing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ for an example of a simple fuzz test.
7979
- Another example:
8080
[src/setup_payload/tests/BUILD.gn](https://github.com/project-chip/connectedhomeip/blob/b367512f519e5e109346e81a0d84fd85cd9192f7/src/setup_payload/tests/BUILD.gn#L43)
8181
82-
- Add to `src/BUILD.gn`
82+
- Add to `${chip_root}/BUILD.gn`
8383
8484
- Add the Fuzzing Target in this part of the code :
85-
[src/BUILD.gn](https://github.com/project-chip/connectedhomeip/blob/b367512f519e5e109346e81a0d84fd85cd9192f7/BUILD.gn#L52)
85+
[\${chip_root}/BUILD.gn](https://github.com/project-chip/connectedhomeip/blob/b367512f519e5e109346e81a0d84fd85cd9192f7/BUILD.gn#L52)
8686
8787
- Add Fuzzing Target like that
8888

docs/testing/python.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Each `Clusters.<ClusterName>.Structs.<StructName>` has:
217217

218218
Example:
219219

220-
```
220+
```python
221221
Clusters.BasicInformation.Structs.ProductAppearanceStruct(
222222
finish=Clusters.BasicInformation.Enums.ProductFinishEnum.kFabric,
223223
primaryColor=Clusters.BasicInformation.Enums.ColorEnum.kBlack)
@@ -293,7 +293,7 @@ Multi-path
293293

294294
Example:
295295

296-
```
296+
```python
297297
urgent = 1
298298

299299
await dev_ctrl ReadEvent(node_id, [(1,
@@ -359,7 +359,7 @@ asserts.assert_equal(ret[0].status, Status.Success, “write failed”)
359359

360360
Example:
361361

362-
```
362+
```python
363363
pai = await dev_ctrl.SendCommand(nodeid, 0, Clusters.OperationalCredentials.Commands.CertificateChainRequest(2))
364364
```
365365

@@ -387,7 +387,7 @@ class provides some helpers for Mobly integration.
387387

388388
use as:
389389

390-
```
390+
```python
391391
if __name__ == "__main__":
392392
default_matter_test_main()
393393
```
@@ -479,7 +479,7 @@ See
479479

480480
To create a controller on a new fabric:
481481

482-
```
482+
```python
483483
new_CA = self.certificate_authority_manager.NewCertificateAuthority()
484484

485485
new_fabric_admin = new_certificate_authority.NewFabricAdmin(vendorId=0xFFF1,
@@ -490,7 +490,7 @@ TH2 = new_fabric_admin.NewController(nodeId=112233)
490490

491491
Open a commissioning window (ECW):
492492

493-
```
493+
```python
494494
params = self.OpenCommissioningWindow(dev_ctrl=self.default_controller, node_id=self.dut_node_id)
495495
```
496496

@@ -499,7 +499,7 @@ the fabric admin.
499499

500500
Fabric admin for default controller:
501501

502-
```
502+
```python
503503
fa = self.certificate_authority_manager.activeCaList[0].adminList[0]
504504
second_ctrl = fa.new_fabric_admin.NewController(nodeId=node_id)
505505
```
@@ -577,25 +577,24 @@ running. To compile and install the wheel, do the following:
577577

578578
First activate the matter environment using either
579579

580-
```
580+
```shell
581581
. ./scripts/bootstrap.sh
582582
```
583583

584584
or
585585

586-
```
586+
```shell
587587
. ./scripts/activate.sh
588588
```
589589

590590
bootstrap.sh should be used for for the first setup, activate.sh may be used for
591591
subsequent setups as it is faster.
592592

593-
Next build the python wheels and create / activate a venv (called `pyenv` here,
594-
but any name may be used)
593+
Next build the python wheels and create / activate a venv
595594

596-
```
595+
```shell
597596
./scripts/build_python.sh -i out/python_env
598-
source pyenv/bin/activate
597+
source out/python_env/bin/activate
599598
```
600599

601600
## Running tests
@@ -610,15 +609,15 @@ that will be commissioned either over BLE or WiFi.
610609

611610
For example, to run the TC-ACE-1.2 tests against an un-commissioned DUT:
612611

613-
```
612+
```shell
614613
python3 src/python_testing/TC_ACE_1_2.py --commissioning-method on-network --qr-code MT:-24J0AFN00KA0648G00
615614
```
616615

617616
Some tests require additional arguments (ex. PIXITs or configuration variables
618617
for the CI). These arguments can be passed as sets of key/value pairs using the
619618
`--<type>-arg:<value>` command line arguments. For example:
620619

621-
```
620+
```shell
622621
--int-arg PIXIT.ACE.APPENDPOINT:1 --int-arg PIXIT.ACE.APPDEVTYPEID:0x0100 --string-arg PIXIT.ACE.APPCLUSTER:OnOff --string-arg PIXIT.ACE.APPATTRIBUTE:OnOff
623622
```
624623

@@ -631,6 +630,12 @@ example DUT on the host and includes factory reset support
631630
./scripts/tests/run_python_test.py --factory-reset --app <your_app> --app-args "whatever" --script <your_script> --script-args "whatever"
632631
```
633632

633+
For example, to run TC-ACE-1.2 tests against the linux `chip-lighting-app`:
634+
635+
```shell
636+
./scripts/tests/run_python_test.py --factory-reset --app ./out/linux-x64-light-no-ble/chip-lighting-app --app-args "--trace-to json:log" --script src/python_testing/TC_ACE_1_2.py --script-args "--commissioning-method on-network --qr-code MT:-24J0AFN00KA0648G00"
637+
```
638+
634639
# Running tests in CI
635640

636641
- Add test to the `repl_tests_linux` section of `.github/workflows/tests.yaml`

docs/testing/yaml.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,11 @@ or
330330
bootstrap.sh should be used for for the first setup, activate.sh may be used for
331331
subsequent setups as it is faster.
332332

333-
Next build the python wheels and create a venv (called `py` here, but any name
334-
may be used)
333+
Next build the python wheels and create a venv
335334

336335
```
337336
./scripts/build_python.sh -i out/python_env
338-
source py/bin/activate
337+
source out/python_env/bin/activate
339338
```
340339

341340
Compile chip-tool:

docs/zap_and_codegen/code_generation.md

-3
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ at:
213213
- `src/app/chip_data_model.cmake`
214214
- `src/app/chip_data_model.gni`
215215

216-
Additionally, `build/chip/esp32/esp32_codegen.cmake` adds processing support for
217-
the 2-pass cmake builds used by the Espressif `idf.py` build system.
218-
219216
## Pre-generation
220217

221218
Code pre-generation can be used:

0 commit comments

Comments
 (0)