Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from project-chip:master #573

Merged
merged 10 commits into from
May 13, 2024

Conversation

pull[bot]
Copy link

@pull pull bot commented May 13, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

jtung-apple and others added 5 commits May 13, 2024 03:58
…n NetworkCommissioning Cluster code. (#33268)

* Adding config checks for fucntions specific to only wifi and thread in NetworkCommissioning

* Restlyed
)

* [k32w] Add mShouldNotApply flag in OTATlvProcessor interface

OTATlvProcessor::ApplyAction now has a default implementation,
but derived classes are still able to overwrite this.

The flag is used by the default ApplyAction implementation.
If something goes wrong during ExitAction of the TLV processor,
then mShouldNotApply should be set to true and the image processor
should abort. In this case, the BDX transfer was already finished
and calling CancelImageUpdate will not abort the transfer, hence
the device will reboot even though it should not have. If ApplyAction
fails during HandleApply, then the process will be aborted.

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* [k32w0] Use mShouldNotApply flag in ExitAction

During ExitAction, set mShouldNotApply to true if an error occurs.
This ensures that the OTA will be aborted and the device does not
reboot.

Also remove the ApplyAction override, since the default implementation
is enough.

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* [k32w1] Use mShouldNotApply during ExitAction

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* [k32w] Update OTA error naming

All OTA errors should be prefixed with CHIP_ERROR.

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* [k32w] Replace boolean mShouldNotApply with an enum class

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

---------

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
This is a basic version of compile support and only x86 simulator
lightning-app is supported now

The compilation method is shown below:
./scripts/build/build_examples.py --target nuttx-x64-light build
and compiled binaries are in the out/nuttx-x64-light directory.

Detailed introduction about NuttX system can refer to this link:
https://github.com/apache/nuttx

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Copy link

guardrails bot commented May 13, 2024

⚠️ We detected 13 security issues in this pull request:

Hard-Coded Secrets (1)
Severity Details Docs
Medium Title: Base64 High Entropy String
'-DCMAKE_CXX_COMPILER=/opt/nuttx/gcc-13/bin/g++',
📚

More info on how to fix Hard-Coded Secrets in General.


Insecure Processing of Data (12)
Severity Details Docs
Medium Title: Pointer subtraction
size_t lengthWithoutProtocol = (dotPos != nullptr) ? static_cast<size_t>(dotPos - typeAndProtocol) : N;
📚
High Title: Return address of stack variable
return &gChipLinuxFactoryStorage;
📚
High Title: Return address of stack variable
return &gChipLinuxConfigStorage;
📚
High Title: Return address of stack variable
return &gChipLinuxCountersStorage;
📚
Medium Title: Inherently dangerous strcpy family function
strcpy(buf, mDeviceName);
📚
Medium Title: Inherently dangerous strcpy family function
strcpy(mDeviceName, deviceName);
📚
Medium Title: Inherently dangerous strcpy family function
strcpy(req.ifr_name, ifname);
📚
High Title: Variable format string for printf functions
snprintf(buf, sizeof(buf), "%" PRIu32, val);
📚
High Title: Variable format string for printf functions
snprintf(buf, sizeof(buf), "%" PRIu64, val);
📚
High Title: Variable format string for printf functions
📚
High Title: Variable format string for printf functions
vsnprintf(formattedMsg + len, sizeof(formattedMsg) - len, msg, v);
📚
Medium Title: Inherently dangerous sprintf family function
sprintf(cmdBuffer, CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD, sWiFiIfName);
📚

More info on how to fix Insecure Processing of Data in C/C++.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

Resolver list is a fixed size always, so a message of "inactive" tagged
as an error seems to just fill up logs (especially seen in python repl)

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
* Use asyncio sleep to unblock asyncio event loop

* Avoid fixed sleep in TestCaseEviction

Use asyncio Event and wait_for to wait for the change and continue
immediately when received.

* Make TestSubscription an async test

The current test implementation starves the asyncio event loop by
synchronously waiting for the threading.Condition. This prevents
making the SubscriptionTransaction fully leveraging the async
paradigm.

It probably would be possible to mix asyncio.sleep() and threading,
but instead embrace the async pradigm for this test.

* Make TestSubscriptionResumption an async test

The current test implementation starves the asyncio event loop by
synchronously waiting for the threading.Condition. This prevents
making the SubscriptionTransaction fully leveraging the async
paradigm.

It probably would be possible to mix asyncio.sleep() and threading,
but instead embrace the async pradigm for this test.

* Make TestSubscriptionResumptionCapacityStep1 an async test

Eliminate use of ZCLSubscribeAttribute and embrace asyncio.

* Make TestSubscriptionResumptionCapacityStep2 an async test

Eliminate use of ZCLSubscribeAttribute and embrace asyncio.

* Remove ZCLSubscribeAttribute from subscription_resumption_timeout_test

Use ReadAttribute with asyncio in subscription_resumption_timeout_test
as well.

* Rewrite TestWriteBasicAttributes to drop ZCLRead/WriteAttribute

* Improve wait for end of update task in TestSubscription
#33371)

* Converted src/controller/tests/data_model from NL to PW.

* Updated to accomodate the fact that AppContext and LoopbackMessagingContext now have SetUp/SetUpTestSuite returning void.

* Comment cleanup.

* Reordered tests to fix dependency.

* Formatting

* Formatting

* Added comment warning of order dependence.

* Formatting

* Removed unneeded conditions from SetUpTestSuite/TearDownTestSuite.
feasel0 and others added 2 commits May 13, 2024 15:09
* Converted controller/tests from NL to PW unit tests.

* Formatting

* Omitted ControllerTests from test_components.txt
@woody-apple woody-apple merged commit fb0394d into woody-apple:master May 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants