Skip to content

Commit

Permalink
modified zap files in some examples
Browse files Browse the repository at this point in the history
changed error code to be more conforming

Added TODO comments in constructor PR project-chip#9544
  • Loading branch information
Marty Leisner authored and Marty Leisner committed Sep 20, 2021
1 parent 98a164f commit b3e4d24
Show file tree
Hide file tree
Showing 13 changed files with 570 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/lighting-app/lighting-common/lighting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2990,7 +2990,7 @@
"outgoing": 1
},
{
"name": "CertChainRequest",
"name": "CertificateChainRequest",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down Expand Up @@ -3089,7 +3089,7 @@
"outgoing": 1
},
{
"name": "CertChainResponse",
"name": "CertificateChainResponse",
"code": 3,
"mfgCode": null,
"source": "server",
Expand Down
32 changes: 32 additions & 0 deletions examples/tv-app/tv-common/tv-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -3152,6 +3152,22 @@
"side": "client",
"enabled": 1,
"commands": [
{
"name": "AttestationRequest",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "CertificateChainRequest",
"code": 2,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "OpCSRRequest",
"code": 4,
Expand Down Expand Up @@ -3235,6 +3251,22 @@
"side": "server",
"enabled": 1,
"commands": [
{
"name": "AttestationResponse",
"code": 1,
"mfgCode": null,
"source": "server",
"incoming": 1,
"outgoing": 1
},
{
"name": "CertificateChainResponse",
"code": 3,
"mfgCode": null,
"source": "server",
"incoming": 1,
"outgoing": 1
},
{
"name": "OpCSRResponse",
"code": 5,
Expand Down
32 changes: 32 additions & 0 deletions examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -3272,6 +3272,22 @@
"side": "client",
"enabled": 0,
"commands": [
{
"name": "AttestationRequest",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "CertificateChainRequest",
"code": 2,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "OpCSRRequest",
"code": 4,
Expand Down Expand Up @@ -3355,6 +3371,22 @@
"side": "server",
"enabled": 1,
"commands": [
{
"name": "AttestationResponse",
"code": 1,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
},
{
"name": "CertificateChainResponse",
"code": 3,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
},
{
"name": "OpCSRResponse",
"code": 5,
Expand Down
5 changes: 5 additions & 0 deletions src/credentials/DeviceAttestationConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ CHIP_ERROR DeconstructAttestationElements(const ByteSpan & attestationElements,
ReturnErrorOnFailure(tlvReader.EnterContainer(containerType));

CHIP_ERROR error = CHIP_NO_ERROR;

// TODO: per conversation with Tennessee, shold be two consecutive loops (rather than one big
// loop, since the contextTags come before the profileTags)
while ((error = tlvReader.Next()) == CHIP_NO_ERROR)
{
uint64_t tag = tlvReader.GetTag();
Expand Down Expand Up @@ -139,6 +142,8 @@ CHIP_ERROR DeconstructAttestationElements(const ByteSpan & attestationElements,
}

// TODO: have independent vendorId and profileNum entries map to each vendor Reserved entry
// Have a class for vendor reserved data, discussed in:
// https://github.com/project-chip/connectedhomeip/issues/9825
CHIP_ERROR ConstructAttestationElements(const ByteSpan & certificationDeclaration, const ByteSpan & attestationNonce,
uint32_t timestamp, const ByteSpan & firmwareInfo, ByteSpan * vendorReservedArray,
size_t vendorReservedArraySize, uint16_t vendorId, uint16_t profileNum,
Expand Down
13 changes: 6 additions & 7 deletions src/credentials/DeviceAttestationVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ enum class AttestationVerificationResult : uint16_t
kFirmwareInformationMismatch = 400,
kFirmwareInformationMissing = 401,

kCertificationDeclarationMissing = 500,
kCertificationDeclarationMissing = 500,
kAttestationSignatureInvalid = 501,
kAttestationElementsMalformed = 502,
kAttestationNonceMismatch = 503,
kAttestationSignatureInvalidFormat = 504,

kAttestationSignatureInvalid = 600,
kAttestationElementsMalformed = 601,
kAttestationNonceMismatch = 602,
kAttestationSignatureInvalidFormat = 603,

kNoMemory = 700,
kNoMemory = 600,

kNotImplemented = 0xFFFFU,

Expand Down
29 changes: 29 additions & 0 deletions zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions zzz_generated/tv-app/zap-generated/CHIPClusters.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions zzz_generated/tv-app/zap-generated/CHIPClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3e4d24

Please sign in to comment.