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

ChipDeviceController sendMessage defaults to sending over unsecured transport #2219

Closed
bhaskar-apple opened this issue Aug 18, 2020 · 1 comment · Fixed by #2658
Closed
Assignees
Labels
bug Something isn't working

Comments

@bhaskar-apple
Copy link
Contributor

Problem

Looking at the code looks like ChipDeviceController::sendMessage defaults to sending over the unsecure channel if there is one

CHIP_ERROR ChipDeviceController::SendMessage(void * appReqState, PacketBuffer * buffer)
{
    CHIP_ERROR err = CHIP_NO_ERROR;

    VerifyOrExit(mRemoteDeviceId.HasValue(), err = CHIP_ERROR_INCORRECT_STATE);

    mAppReqState = appReqState;

    if (mUnsecuredTransport != NULL)
    {
        VerifyOrExit(IsConnected(), err = CHIP_ERROR_INCORRECT_STATE);
        // Unsecured transport does not use a MessageHeader, but the Transport::Base API expects one, so
        // let build an empty one for now.
        MessageHeader header;
        Transport::PeerAddress peerAddress = Transport::PeerAddress::BLE();
        err                                = mUnsecuredTransport->SendMessage(header, peerAddress, buffer);
    }
    else
    {
        VerifyOrExit(IsSecurelyConnected(), err = CHIP_ERROR_INCORRECT_STATE);
        err = mSessionManager->SendMessage(mRemoteDeviceId.Value(), buffer);
    }

Pankaj mentioned this code is temporary and will be removed once some rendezvous pieces land.
Filing this issue to make sure this is tracked explicitly.

Proposed Solution

Only use secure transport post pairing.

@vivien-apple @shana-apple

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Aug 18, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.80. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

manjunath-grl added a commit to manjunath-grl/connectedhomeip that referenced this issue Sep 9, 2022
woody-apple pushed a commit that referenced this issue Sep 9, 2022
* Modified Manual and automation script
Test_TC_CC_4_5
Test_TC_CC_5_4
Test_TC_CC_7_5
Test_TC_DRLK_2_2
Test_TC_G_3_2
Test_TC_IDM_4_1
Test_TC_LTIME_1_1
Test_TC_LUNIT_1_1
Test_TC_LVL_2_3
Test_TC_LVL_8_1
Test_TC_OPCREDS_3_3
Test_TC_SC_4_7
Test_TC_ULABEL_3_1
Test_TC_OO_1_1
Test_TC_DGTHREAD_1_1
Test_TC_DGTHREAD_2_1

* Auto generated files

* Restyled by whitespace

* Modified DGTHREAD.S.F.00 PICS

* Auto generated files

* Modified CC scripts

* Auto generated files

* Modified scripts Sep 7
Test_TC_BIND_2_3.yaml
Test_TC_CADMIN_1_1.yaml
Test_TC_CADMIN_1_2.yaml
Test_TC_CADMIN_1_7.yaml
Test_TC_CADMIN_1_8.yaml
Test_TC_CADMIN_1_9.yaml
Test_TC_CADMIN_1_10.yaml
Test_TC_CADMIN_1_11.yaml
Test_TC_CADMIN_1_12.yaml
Test_TC_CADMIN_1_13.yaml
Test_TC_CADMIN_1_14.yaml
Test_TC_CADMIN_1_15.yaml
Test_TC_CADMIN_1_16.yaml
Test_TC_CADMIN_1_17.yaml
Test_TC_CADMIN_1_18.yaml
Test_TC_CNET_1_3.yaml
Test_TC_CNET_4_1.yaml
Test_TC_CNET_4_2.yaml
Test_TC_CNET_4_3.yaml
Test_TC_CNET_4_10.yaml
Test_TC_CNET_4_11.yaml
Test_TC_CNET_4_12.yaml
Test_TC_CNET_4_15.yaml
Test_TC_CNET_4_16.yaml
Test_TC_CNET_4_17.yaml
Test_TC_CNET_4_18.yaml
Test_TC_CNET_4_19.yaml
Test_TC_CNET_4_20.yaml
Test_TC_CNET_4_21.yaml
Test_TC_DA_1_1.yaml
Test_TC_DA_1_4.yaml
Test_TC_DA_1_6.yaml
Test_TC_DA_1_7.yaml
Test_TC_DD_1_5.yaml
Test_TC_DD_1_8.yaml
Test_TC_DD_1_9.yaml
Test_TC_DD_1_13.yaml
Test_TC_DD_2_1.yaml
Test_TC_DD_3_1.yaml
Test_TC_DD_3_5.yaml
Test_TC_DD_3_8.yaml
Test_TC_DD_3_9.yaml
Test_TC_DD_3_17.yaml
Test_TC_DD_3_19.yaml
Test_TC_DGGEN_3_1.yaml
Test_TC_DGTHREAD_3_1.yaml
Test_TC_DGTHREAD_3_2.yaml
Test_TC_DGTHREAD_3_3.yaml
Test_TC_DGTHREAD_3_4.yaml
Test_TC_DGWIFI_3_1.yaml
Test_TC_DGWIFI_3_2.yaml
Test_TC_IDM_6_1.yaml
Test_TC_IDM_6_2.yaml
Test_TC_IDM_8_1.yaml
Test_TC_OCC_2_4.yaml
Test_TC_OPCREDS_3_1.yaml
Test_TC_OPCREDS_3_4.yaml
Test_TC_OPCREDS_3_5.yaml
Test_TC_PS_2_2.yaml
Test_TC_PSCFG_2_2.yaml
Test_TC_ULABEL_3_1.yaml
Test_TC_WNCV_5_1.yaml
Test_TC_WNCV_7_1.yaml

* Auto generated files

* Restyled by whitespace

* Modified DGGEN-2.2 Manual script

* Modified CC and DRLK-2.9 script

* Auto generated files

* Fixed issue #2216 and #2219

* Auto generated files

Co-authored-by: Restyled.io <[email protected]>
github-actions bot pushed a commit that referenced this issue Sep 9, 2022
* Modified Manual and automation script
Test_TC_CC_4_5
Test_TC_CC_5_4
Test_TC_CC_7_5
Test_TC_DRLK_2_2
Test_TC_G_3_2
Test_TC_IDM_4_1
Test_TC_LTIME_1_1
Test_TC_LUNIT_1_1
Test_TC_LVL_2_3
Test_TC_LVL_8_1
Test_TC_OPCREDS_3_3
Test_TC_SC_4_7
Test_TC_ULABEL_3_1
Test_TC_OO_1_1
Test_TC_DGTHREAD_1_1
Test_TC_DGTHREAD_2_1

* Auto generated files

* Restyled by whitespace

* Modified DGTHREAD.S.F.00 PICS

* Auto generated files

* Modified CC scripts

* Auto generated files

* Modified scripts Sep 7
Test_TC_BIND_2_3.yaml
Test_TC_CADMIN_1_1.yaml
Test_TC_CADMIN_1_2.yaml
Test_TC_CADMIN_1_7.yaml
Test_TC_CADMIN_1_8.yaml
Test_TC_CADMIN_1_9.yaml
Test_TC_CADMIN_1_10.yaml
Test_TC_CADMIN_1_11.yaml
Test_TC_CADMIN_1_12.yaml
Test_TC_CADMIN_1_13.yaml
Test_TC_CADMIN_1_14.yaml
Test_TC_CADMIN_1_15.yaml
Test_TC_CADMIN_1_16.yaml
Test_TC_CADMIN_1_17.yaml
Test_TC_CADMIN_1_18.yaml
Test_TC_CNET_1_3.yaml
Test_TC_CNET_4_1.yaml
Test_TC_CNET_4_2.yaml
Test_TC_CNET_4_3.yaml
Test_TC_CNET_4_10.yaml
Test_TC_CNET_4_11.yaml
Test_TC_CNET_4_12.yaml
Test_TC_CNET_4_15.yaml
Test_TC_CNET_4_16.yaml
Test_TC_CNET_4_17.yaml
Test_TC_CNET_4_18.yaml
Test_TC_CNET_4_19.yaml
Test_TC_CNET_4_20.yaml
Test_TC_CNET_4_21.yaml
Test_TC_DA_1_1.yaml
Test_TC_DA_1_4.yaml
Test_TC_DA_1_6.yaml
Test_TC_DA_1_7.yaml
Test_TC_DD_1_5.yaml
Test_TC_DD_1_8.yaml
Test_TC_DD_1_9.yaml
Test_TC_DD_1_13.yaml
Test_TC_DD_2_1.yaml
Test_TC_DD_3_1.yaml
Test_TC_DD_3_5.yaml
Test_TC_DD_3_8.yaml
Test_TC_DD_3_9.yaml
Test_TC_DD_3_17.yaml
Test_TC_DD_3_19.yaml
Test_TC_DGGEN_3_1.yaml
Test_TC_DGTHREAD_3_1.yaml
Test_TC_DGTHREAD_3_2.yaml
Test_TC_DGTHREAD_3_3.yaml
Test_TC_DGTHREAD_3_4.yaml
Test_TC_DGWIFI_3_1.yaml
Test_TC_DGWIFI_3_2.yaml
Test_TC_IDM_6_1.yaml
Test_TC_IDM_6_2.yaml
Test_TC_IDM_8_1.yaml
Test_TC_OCC_2_4.yaml
Test_TC_OPCREDS_3_1.yaml
Test_TC_OPCREDS_3_4.yaml
Test_TC_OPCREDS_3_5.yaml
Test_TC_PS_2_2.yaml
Test_TC_PSCFG_2_2.yaml
Test_TC_ULABEL_3_1.yaml
Test_TC_WNCV_5_1.yaml
Test_TC_WNCV_7_1.yaml

* Auto generated files

* Restyled by whitespace

* Modified DGGEN-2.2 Manual script

* Modified CC and DRLK-2.9 script

* Auto generated files

* Fixed issue #2216 and #2219

* Auto generated files

Co-authored-by: Restyled.io <[email protected]>
woody-apple added a commit that referenced this issue Sep 10, 2022
* Modified script Sep 06 (#22410)

* Modified Manual and automation script
Test_TC_CC_4_5
Test_TC_CC_5_4
Test_TC_CC_7_5
Test_TC_DRLK_2_2
Test_TC_G_3_2
Test_TC_IDM_4_1
Test_TC_LTIME_1_1
Test_TC_LUNIT_1_1
Test_TC_LVL_2_3
Test_TC_LVL_8_1
Test_TC_OPCREDS_3_3
Test_TC_SC_4_7
Test_TC_ULABEL_3_1
Test_TC_OO_1_1
Test_TC_DGTHREAD_1_1
Test_TC_DGTHREAD_2_1

* Auto generated files

* Restyled by whitespace

* Modified DGTHREAD.S.F.00 PICS

* Auto generated files

* Modified CC scripts

* Auto generated files

* Modified scripts Sep 7
Test_TC_BIND_2_3.yaml
Test_TC_CADMIN_1_1.yaml
Test_TC_CADMIN_1_2.yaml
Test_TC_CADMIN_1_7.yaml
Test_TC_CADMIN_1_8.yaml
Test_TC_CADMIN_1_9.yaml
Test_TC_CADMIN_1_10.yaml
Test_TC_CADMIN_1_11.yaml
Test_TC_CADMIN_1_12.yaml
Test_TC_CADMIN_1_13.yaml
Test_TC_CADMIN_1_14.yaml
Test_TC_CADMIN_1_15.yaml
Test_TC_CADMIN_1_16.yaml
Test_TC_CADMIN_1_17.yaml
Test_TC_CADMIN_1_18.yaml
Test_TC_CNET_1_3.yaml
Test_TC_CNET_4_1.yaml
Test_TC_CNET_4_2.yaml
Test_TC_CNET_4_3.yaml
Test_TC_CNET_4_10.yaml
Test_TC_CNET_4_11.yaml
Test_TC_CNET_4_12.yaml
Test_TC_CNET_4_15.yaml
Test_TC_CNET_4_16.yaml
Test_TC_CNET_4_17.yaml
Test_TC_CNET_4_18.yaml
Test_TC_CNET_4_19.yaml
Test_TC_CNET_4_20.yaml
Test_TC_CNET_4_21.yaml
Test_TC_DA_1_1.yaml
Test_TC_DA_1_4.yaml
Test_TC_DA_1_6.yaml
Test_TC_DA_1_7.yaml
Test_TC_DD_1_5.yaml
Test_TC_DD_1_8.yaml
Test_TC_DD_1_9.yaml
Test_TC_DD_1_13.yaml
Test_TC_DD_2_1.yaml
Test_TC_DD_3_1.yaml
Test_TC_DD_3_5.yaml
Test_TC_DD_3_8.yaml
Test_TC_DD_3_9.yaml
Test_TC_DD_3_17.yaml
Test_TC_DD_3_19.yaml
Test_TC_DGGEN_3_1.yaml
Test_TC_DGTHREAD_3_1.yaml
Test_TC_DGTHREAD_3_2.yaml
Test_TC_DGTHREAD_3_3.yaml
Test_TC_DGTHREAD_3_4.yaml
Test_TC_DGWIFI_3_1.yaml
Test_TC_DGWIFI_3_2.yaml
Test_TC_IDM_6_1.yaml
Test_TC_IDM_6_2.yaml
Test_TC_IDM_8_1.yaml
Test_TC_OCC_2_4.yaml
Test_TC_OPCREDS_3_1.yaml
Test_TC_OPCREDS_3_4.yaml
Test_TC_OPCREDS_3_5.yaml
Test_TC_PS_2_2.yaml
Test_TC_PSCFG_2_2.yaml
Test_TC_ULABEL_3_1.yaml
Test_TC_WNCV_5_1.yaml
Test_TC_WNCV_7_1.yaml

* Auto generated files

* Restyled by whitespace

* Modified DGGEN-2.2 Manual script

* Modified CC and DRLK-2.9 script

* Auto generated files

* Fixed issue #2216 and #2219

* Auto generated files

Co-authored-by: Restyled.io <[email protected]>

* ZAP restyle

Co-authored-by: manjunath-grl <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: raju-apple <[email protected]>
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this issue Sep 16, 2022
* Modified Manual and automation script
Test_TC_CC_4_5
Test_TC_CC_5_4
Test_TC_CC_7_5
Test_TC_DRLK_2_2
Test_TC_G_3_2
Test_TC_IDM_4_1
Test_TC_LTIME_1_1
Test_TC_LUNIT_1_1
Test_TC_LVL_2_3
Test_TC_LVL_8_1
Test_TC_OPCREDS_3_3
Test_TC_SC_4_7
Test_TC_ULABEL_3_1
Test_TC_OO_1_1
Test_TC_DGTHREAD_1_1
Test_TC_DGTHREAD_2_1

* Auto generated files

* Restyled by whitespace

* Modified DGTHREAD.S.F.00 PICS

* Auto generated files

* Modified CC scripts

* Auto generated files

* Modified scripts Sep 7
Test_TC_BIND_2_3.yaml
Test_TC_CADMIN_1_1.yaml
Test_TC_CADMIN_1_2.yaml
Test_TC_CADMIN_1_7.yaml
Test_TC_CADMIN_1_8.yaml
Test_TC_CADMIN_1_9.yaml
Test_TC_CADMIN_1_10.yaml
Test_TC_CADMIN_1_11.yaml
Test_TC_CADMIN_1_12.yaml
Test_TC_CADMIN_1_13.yaml
Test_TC_CADMIN_1_14.yaml
Test_TC_CADMIN_1_15.yaml
Test_TC_CADMIN_1_16.yaml
Test_TC_CADMIN_1_17.yaml
Test_TC_CADMIN_1_18.yaml
Test_TC_CNET_1_3.yaml
Test_TC_CNET_4_1.yaml
Test_TC_CNET_4_2.yaml
Test_TC_CNET_4_3.yaml
Test_TC_CNET_4_10.yaml
Test_TC_CNET_4_11.yaml
Test_TC_CNET_4_12.yaml
Test_TC_CNET_4_15.yaml
Test_TC_CNET_4_16.yaml
Test_TC_CNET_4_17.yaml
Test_TC_CNET_4_18.yaml
Test_TC_CNET_4_19.yaml
Test_TC_CNET_4_20.yaml
Test_TC_CNET_4_21.yaml
Test_TC_DA_1_1.yaml
Test_TC_DA_1_4.yaml
Test_TC_DA_1_6.yaml
Test_TC_DA_1_7.yaml
Test_TC_DD_1_5.yaml
Test_TC_DD_1_8.yaml
Test_TC_DD_1_9.yaml
Test_TC_DD_1_13.yaml
Test_TC_DD_2_1.yaml
Test_TC_DD_3_1.yaml
Test_TC_DD_3_5.yaml
Test_TC_DD_3_8.yaml
Test_TC_DD_3_9.yaml
Test_TC_DD_3_17.yaml
Test_TC_DD_3_19.yaml
Test_TC_DGGEN_3_1.yaml
Test_TC_DGTHREAD_3_1.yaml
Test_TC_DGTHREAD_3_2.yaml
Test_TC_DGTHREAD_3_3.yaml
Test_TC_DGTHREAD_3_4.yaml
Test_TC_DGWIFI_3_1.yaml
Test_TC_DGWIFI_3_2.yaml
Test_TC_IDM_6_1.yaml
Test_TC_IDM_6_2.yaml
Test_TC_IDM_8_1.yaml
Test_TC_OCC_2_4.yaml
Test_TC_OPCREDS_3_1.yaml
Test_TC_OPCREDS_3_4.yaml
Test_TC_OPCREDS_3_5.yaml
Test_TC_PS_2_2.yaml
Test_TC_PSCFG_2_2.yaml
Test_TC_ULABEL_3_1.yaml
Test_TC_WNCV_5_1.yaml
Test_TC_WNCV_7_1.yaml

* Auto generated files

* Restyled by whitespace

* Modified DGGEN-2.2 Manual script

* Modified CC and DRLK-2.9 script

* Auto generated files

* Fixed issue project-chip#2216 and project-chip#2219

* Auto generated files

Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants