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

Use SecureSessionHandle to indicate if the peer's group key message c… #5368

Merged
merged 1 commit into from
Mar 16, 2021
Merged

Use SecureSessionHandle to indicate if the peer's group key message c… #5368

merged 1 commit into from
Mar 16, 2021

Conversation

yufengwangca
Copy link
Contributor

…ounter is not synchronized.

Problem

This is the follow-up of one of review comments in #4932, we are storing the IsPeerGroupMsgIdNotSynchronized state in the PacketHeader, which seems like as lightly odd place to put it and requires const_cast. We should not be adding const_cast to the code.

// For all group messages, Set flag if peer group key message counter is not synchronized.
if (ChipKeyId::IsAppGroupKey(packetHeader.GetEncryptionKeyID()))
{
    const_cast<PacketHeader &>(packetHeader).SetPeerGroupMsgIdNotSynchronized(true);
}

Summary of Changes

Use SecureSessionHandle to indicate if the peer's group key message counter is not synchronized.

Fixes #5367

@github-actions
Copy link

Size increase report for "esp32-example-build" from cf7aa2d

File Section File VM
chip-all-clusters-app.elf .flash.text -16 -16
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_abbrev,0,20
.xt.prop._ZTVN4chip11DeviceLayer37DeviceNetworkProvisioningDelegateImplE,0,-2
.flash.text,-16,-16
.debug_line,0,-91
.debug_loc,0,-173
.debug_str,0,-1271
.debug_info,0,-10231

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize


@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from cf7aa2d

File Section File VM
chip-lock.elf text -4 -4
chip-lock.elf shell_root_cmds_sections -12 -12
chip-lighting.elf shell_root_cmds_sections 4 4
chip-lighting.elf text -4 -4
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_abbrev,0,20
text,-4,-4
.debug_ranges,0,-8
shell_root_cmds_sections,-12,-12
.debug_line,0,-57
.debug_loc,0,-145
.debug_str,0,-1271
.debug_info,0,-10427

Comparing ./master_artifact/chip-lighting.elf and ./pull_artifact/chip-lighting.elf:

sections,vmsize,filesize
.debug_abbrev,0,20
shell_root_cmds_sections,4,4
text,-4,-4
.debug_ranges,0,-8
.debug_line,0,-57
.debug_loc,0,-137
.debug_str,0,-1271
.debug_info,0,-10427


Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This makes a lot more sense to me.

@andy31415 andy31415 merged commit a0dd7af into project-chip:master Mar 16, 2021
@yufengwangca yufengwangca deleted the pr/mcsp/flags branch March 16, 2021 17:20
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.

We should not use const_cast for PacketHeader to set PeerGroupMsgIdNotSynchronized state
5 participants