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

Set Credential Response should return failure when UserStatus and UserType is not Null for an existing User #25259

Closed
sumaky opened this issue Feb 22, 2023 · 0 comments · Fixed by #25264

Comments

@sumaky
Copy link
Contributor

sumaky commented Feb 22, 2023

Reproduction steps

Commands to reproduce this issue:


  1. Clear all Credentials and User
  2. /chip-tool doorlock set-user 0 1 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000
  3. ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1 , "credentialIndex" : 2 }' 123456 1 1 1 1 1
    --timedInteractionTimeoutMs** 1000
    Note: observe UserStatus and User Type are set to 1

Supporting Logs


grl@noob-master-69:~/CHIP1.1/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool doorlock set-user 0 1 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000
hange: 27652i, Delegate: 0x7f5568021418
[1677090350.568710][6007:6009] CHIP:EM: Rxd Ack; Removing MessageCounter:208291226 from Retrans Table on exchange 27652i
[1677090350.568714][6007:6009] CHIP:DMG: ICR moving to [ResponseRe]
[1677090350.568721][6007:6009] CHIP:DMG: InvokeResponseMessage =
[1677090350.568723][6007:6009] CHIP:DMG: {
[1677090350.568726][6007:6009] CHIP:DMG: suppressResponse = false,
[1677090350.568729][6007:6009] CHIP:DMG: InvokeResponseIBs =
[1677090350.568734][6007:6009] CHIP:DMG: [
[1677090350.568736][6007:6009] CHIP:DMG: InvokeResponseIB =
[1677090350.568751][6007:6009] CHIP:DMG: {
[1677090350.568753][6007:6009] CHIP:DMG: CommandStatusIB =
[1677090350.568756][6007:6009] CHIP:DMG: {
[1677090350.568759][6007:6009] CHIP:DMG: CommandPathIB =
[1677090350.568763][6007:6009] CHIP:DMG: {
[1677090350.568766][6007:6009] CHIP:DMG: EndpointId = 0x1,
[1677090350.568770][6007:6009] CHIP:DMG: ClusterId = 0x101,
[1677090350.568774][6007:6009] CHIP:DMG: CommandId = 0x1a,
[1677090350.568777][6007:6009] CHIP:DMG: },
[1677090350.568781][6007:6009] CHIP:DMG:
[1677090350.568783][6007:6009] CHIP:DMG: StatusIB =
[1677090350.568786][6007:6009] CHIP:DMG: {
[1677090350.568789][6007:6009] CHIP:DMG: status = 0x00 (SUCCESS),
[1677090350.568792][6007:6009] CHIP:DMG: },
[1677090350.568796][6007:6009] CHIP:DMG:
[1677090350.568798][6007:6009] CHIP:DMG: },
[1677090350.568802][6007:6009] CHIP:DMG:
[1677090350.568804][6007:6009] CHIP:DMG: },
[1677090350.568809][6007:6009] CHIP:DMG:
[1677090350.568811][6007:6009] CHIP:DMG: ],
[1677090350.568815][6007:6009] CHIP:DMG:
[1677090350.568817][6007:6009] CHIP:DMG: InteractionModelRevision = 1
[1677090350.568819][6007:6009] CHIP:DMG: },
[1677090350.568829][6007:6009] CHIP:DMG: Received Command Response Status for
grl@noob-master-69:~/CHIP1.1/connectedhomeip/examples/chip-tool/out/debug$ ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1 , "credentialIndex" : 2 }' 123456 1 1 1 1 1 --timedInteractionTimeoutMs 1000

[1677090400.061504][6017:6019] CHIP:EM: Rxd Ack; Removing MessageCounter:56985971 from Retrans Table on exchange 34966i
[1677090400.061526][6017:6019] CHIP:DMG: ICR moving to [ResponseRe]
[1677090400.061548][6017:6019] CHIP:DMG: InvokeResponseMessage =
[1677090400.061556][6017:6019] CHIP:DMG: {
[1677090400.061563][6017:6019] CHIP:DMG: suppressResponse = false,
[1677090400.061570][6017:6019] CHIP:DMG: InvokeResponseIBs =
[1677090400.061582][6017:6019] CHIP:DMG: [
[1677090400.061589][6017:6019] CHIP:DMG: InvokeResponseIB =
[1677090400.061600][6017:6019] CHIP:DMG: {
[1677090400.061607][6017:6019] CHIP:DMG: CommandDataIB =
[1677090400.061615][6017:6019] CHIP:DMG: {
[1677090400.061625][6017:6019] CHIP:DMG: CommandPathIB =
[1677090400.061637][6017:6019] CHIP:DMG: {
[1677090400.061646][6017:6019] CHIP:DMG: EndpointId = 0x1,
[1677090400.061654][6017:6019] CHIP:DMG: ClusterId = 0x101,
[1677090400.061662][6017:6019] CHIP:DMG: CommandId = 0x23,
[1677090400.061669][6017:6019] CHIP:DMG: },
[1677090400.061677][6017:6019] CHIP:DMG:
[1677090400.061685][6017:6019] CHIP:DMG: CommandFields =
[1677090400.061693][6017:6019] CHIP:DMG: {
[1677090400.061702][6017:6019] CHIP:DMG: 0x0 = 0,
[1677090400.061711][6017:6019] CHIP:DMG: 0x1 = NULL
[1677090400.061719][6017:6019] CHIP:DMG: 0x2 = 3,
[1677090400.061727][6017:6019] CHIP:DMG: },
[1677090400.061734][6017:6019] CHIP:DMG: },
[1677090400.061744][6017:6019] CHIP:DMG:
[1677090400.061752][6017:6019] CHIP:DMG: },
[1677090400.061760][6017:6019] CHIP:DMG:
[1677090400.061764][6017:6019] CHIP:DMG: ],
[1677090400.061772][6017:6019] CHIP:DMG:
[1677090400.061777][6017:6019] CHIP:DMG: InteractionModelRevision = 1
[1677090400.061781][6017:6019] CHIP:DMG: },
[1677090400.061806][6017:6019] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023
[1677090400.061828][6017:6019] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023
[1677090400.061858][6017:6019] CHIP:TOO: SetCredentialResponse: {
[1677090400.061876][6017:6019] CHIP:TOO: status: 0
[1677090400.061886][6017:6019] CHIP:TOO: userIndex: null
[1677090400.061897][6017:6019] CHIP:TOO: nextCredentialIndex: 3

[1677090400.061906][6017:6019] CHIP:TOO: }
[1677090400.061931][6017:6019] CHIP:DMG: ICR moving to [AwaitingDe]
[1677090400.061982][6017:6019] CHIP:EM: <<< [E:34966i S:56498 M:56985972

Bug prevalence

Whne executed manually

GitHub hash of the SDK that was being used

NA

Platform

other

Platform Version(s)

No response

Anything else?

No response

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 22, 2023
* When Set Credential happens with OperationType set to Modify and
  UserIndex set to null, that means we are modifying the credential
  for the programming user.  In this case, UserStatus must be null and
  UserType must be ProgrammingUser, but we were not checking that.
* When Set Credential happens with OperationType set to Modify and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were incorrectly allowing UserType to be ProgrammingUser in this case.
* When Set Credential happens with OperationType set to Add and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were not checking for this at all.

Fixes project-chip#25259
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 22, 2023
* When Set Credential happens with OperationType set to Modify and
  UserIndex set to null, that means we are modifying the credential
  for the programming user.  In this case, UserStatus must be null and
  UserType must be ProgrammingUser, but we were not checking that.
* When Set Credential happens with OperationType set to Modify and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were incorrectly allowing UserType to be ProgrammingUser in this case.
* When Set Credential happens with OperationType set to Add and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were not checking for this at all.

Fixes project-chip#25259
andy31415 pushed a commit that referenced this issue Feb 23, 2023
* When Set Credential happens with OperationType set to Modify and
  UserIndex set to null, that means we are modifying the credential
  for the programming user.  In this case, UserStatus must be null and
  UserType must be ProgrammingUser, but we were not checking that.
* When Set Credential happens with OperationType set to Modify and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were incorrectly allowing UserType to be ProgrammingUser in this case.
* When Set Credential happens with OperationType set to Add and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were not checking for this at all.

Fixes #25259
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
* When Set Credential happens with OperationType set to Modify and
  UserIndex set to null, that means we are modifying the credential
  for the programming user.  In this case, UserStatus must be null and
  UserType must be ProgrammingUser, but we were not checking that.
* When Set Credential happens with OperationType set to Modify and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were incorrectly allowing UserType to be ProgrammingUser in this case.
* When Set Credential happens with OperationType set to Add and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were not checking for this at all.

Fixes project-chip/connectedhomeip#25259
kkasperczyk-no pushed a commit to kkasperczyk-no/sdk-connectedhomeip that referenced this issue Mar 15, 2023
* When Set Credential happens with OperationType set to Modify and
  UserIndex set to null, that means we are modifying the credential
  for the programming user.  In this case, UserStatus must be null and
  UserType must be ProgrammingUser, but we were not checking that.
* When Set Credential happens with OperationType set to Modify and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were incorrectly allowing UserType to be ProgrammingUser in this case.
* When Set Credential happens with OperationType set to Add and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were not checking for this at all.

Fixes project-chip/connectedhomeip#25259
lecndav pushed a commit to lecndav/connectedhomeip that referenced this issue Mar 22, 2023
…#25264)

* When Set Credential happens with OperationType set to Modify and
  UserIndex set to null, that means we are modifying the credential
  for the programming user.  In this case, UserStatus must be null and
  UserType must be ProgrammingUser, but we were not checking that.
* When Set Credential happens with OperationType set to Modify and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were incorrectly allowing UserType to be ProgrammingUser in this case.
* When Set Credential happens with OperationType set to Add and
  UserIndex not null, UserStatus and UserType must both be null.  We
  were not checking for this at all.

Fixes project-chip#25259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant