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

Update CASE session to match latest specifications #9904

Merged
merged 7 commits into from
Sep 28, 2021

Conversation

pan-apple
Copy link
Contributor

Problem

The CASE Sigma protocol message definitions have been updated in the spec, and SDK code needs update.

Change overview

Update message definition to match the specification
Also update state machine in lieu of Status Report, and CASE resume messages.

Pending: Add mechanism to trigger CASE resumption, and corresponding tests

Testing

Ran TestCASESession unit tests to make sure the tests continue to work with updated message definitions.

@todo
Copy link

todo bot commented Sep 22, 2021

Add support for optional MRP parameters

// TODO: Add support for optional MRP parameters
ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType));
ReturnErrorOnFailure(tlvWriter.Finalize(&msg_R2_resume));
mState = kSentSigma2Resume;
// Call delegate to send the msg to peer
ReturnErrorOnFailure(mExchangeCtxt->SendMessage(Protocols::SecureChannel::MsgType::CASE_Sigma2Resume, std::move(msg_R2_resume),
SendFlags(SendMessageFlags::kExpectResponse)));


This comment was generated by todo based on a TODO comment in 017b46f in #9904. cc @pan-apple.

@todo
Copy link

todo bot commented Sep 24, 2021

Set timestamp on the new session, to allow selecting a least-recently-used session for eviction

// TODO: Set timestamp on the new session, to allow selecting a least-recently-used session for eviction
// on running out of session contexts.
mPairingComplete = true;
// Forget our exchange, as no additional messages are expected from the peer
mExchangeCtxt = nullptr;
// Call delegate to indicate session establishment is successful
mDelegate->OnSessionEstablished();


This comment was generated by todo based on a TODO comment in 6dc0d2a in #9904. cc @pan-apple.

@todo
Copy link

todo bot commented Sep 24, 2021

Set timestamp on the new session, to allow selecting a least-recently-used session for eviction

// TODO: Set timestamp on the new session, to allow selecting a least-recently-used session for eviction
// on running out of session contexts.
}
CHIP_ERROR CASESession::OnFailureStatusReport(Protocols::SecureChannel::GeneralStatusCode generalCode, uint16_t protocolCode)
{
CHIP_ERROR err = CHIP_NO_ERROR;
switch (protocolCode)
{
case kProtocolCodeInvalidParam:
err = CHIP_ERROR_INVALID_CASE_PARAMETER;


This comment was generated by todo based on a TODO comment in 6dc0d2a in #9904. cc @pan-apple.

@github-actions
Copy link

Size increase report for "gn_qpg-example-build" from 0e52970

File Section File VM
chip-qpg6100-lighting-example.out .text 1888 1888
chip-qpg6100-lighting-example.out .bss 0 40
chip-qpg6100-lighting-example.out .heap 0 -40
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lighting-example.out.map and ./pull_artifact/chip-qpg6100-lighting-example.out.map:

BLOAT EXECUTION FAILED WITH CODE 1:
bloaty: unknown file type for file './pull_artifact/chip-qpg6100-lighting-example.out.map'

Comparing ./master_artifact/chip-qpg6100-lighting-example.out and ./pull_artifact/chip-qpg6100-lighting-example.out:

sections,vmsize,filesize
.debug_info,0,26127
.debug_loc,0,13899
.debug_line,0,5072
.debug_ranges,0,2200
.text,1888,1888
.debug_str,0,1490
.strtab,0,1480
.symtab,0,896
.debug_frame,0,596
.debug_abbrev,0,528
.debug_aranges,0,176
.bss,40,0
.heap,-40,0
[Unmapped],0,-1888


@github-actions
Copy link

Size increase report for "esp32-example-build" from 0e52970

File Section File VM
chip-all-clusters-app.elf .flash.text 1704 1704
chip-all-clusters-app.elf .flash.rodata 280 280
chip-all-clusters-app.elf .dram0.bss 0 40
chip-all-clusters-app.elf .dram0.heap_start 0 -8
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_loc,0,6659
.debug_line,0,4861
.debug_ranges,0,2416
.flash.text,1704,1704
.debug_str,0,1388
.strtab,0,1235
.debug_frame,0,564
.debug_abbrev,0,561
.symtab,0,288
.flash.rodata,280,280
.debug_aranges,0,144
.dram0.bss,40,0
.shstrtab,0,1
.riscv.attributes,0,-1
.dram0.heap_start,-8,0
[Unmapped],0,-1984
.debug_info,0,-20588


@pan-apple
Copy link
Contributor Author

@msandstedt , @saurabhst , @LuDuda , do you have any review feedback?

@woody-apple
Copy link
Contributor

@saurabhst @Damian-Nordic ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants