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

Device Attestation (Modular) #9617

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bf5c1c8
Added DeconstructAttestationElements/ConstructAttestationElements
Sep 8, 2021
d5e476f
Added CertChainRequest and AttestationRequest commands to lighting-ap…
Sep 9, 2021
99b1fa3
Merge commit '78469bb8012524e5921216783937cc7349ac2628' of https://gi…
Sep 10, 2021
cfedec6
Merge commit '44f8ea7bbb0f7eae47c504ccd2a3f39d8f6ea74a' of https://gi…
Sep 10, 2021
6e779a2
Address review comments
Sep 10, 2021
38454ea
Merge commit '44f8ea7bbb0f7eae47c504ccd2a3f39d8f6ea74a' of https://gi…
Sep 10, 2021
adb5725
minor changes (mainly review rework of Constructor/Deconstructor) and
Sep 10, 2021
4129a20
Merge commit 'e945d1659445642ab1df8f992958129d3cf5ba69' of https://gi…
Sep 14, 2021
df2736c
address review comments
Sep 14, 2021
4176afb
Merge commit '64d8f135b21331ce2092fb62980ee5d8eb8319ed' of https://gi…
Sep 14, 2021
21edbfb
change enum type to uint32_t to avoid unsigned to signed conversion e…
Sep 14, 2021
be71f55
Merge commit '64d8f135b21331ce2092fb62980ee5d8eb8319ed' of https://gi…
Sep 15, 2021
97b6af6
updates to PR #9544
Sep 15, 2021
1ab46e9
Merge commit '8a20f68cdaf3f7b5a0e8e9de06b65fb2967cbdf8' of https://gi…
Sep 15, 2021
7c39a02
removed unneded header
Sep 15, 2021
dc5b682
Merge commit '8e86c9ef292e4809e591ae1854ee13367f9103d1' of https://gi…
Sep 16, 2021
8efbc48
Merge branch 'feature/DA-constructors' into feature/device_attestatio…
Sep 17, 2021
8c8607d
remove status var in operational-credentials-server.cpp.
Sep 19, 2021
ecc8349
reran zap
Sep 19, 2021
98a164f
Merge commit '5bb3ae31834dfbc075abfdf09bb3663a5871d0b5' of github.com…
Sep 20, 2021
b3e4d24
modified zap files in some examples
Sep 20, 2021
9af7ab9
restyling whitespace, clang-format
Sep 20, 2021
de1590b
two more zap generated files changed
Sep 21, 2021
dbd9c3b
move DAC Verifier config to examples
Sep 21, 2021
dfc5c80
Merge branch 'master' into feature/device_attestation_complete
Sep 22, 2021
d6b2539
Merge branch 'master' into feature/device_attestation_complete
Sep 22, 2021
969c05c
moved local variables closer to where used
Sep 22, 2021
df6b8ce
reran zap
Sep 22, 2021
bd2699b
undid last commit -- regenerated zap to use 9/20 version versus 9/1
Sep 22, 2021
5fad0be
Merge branch 'master' into feature/device_attestation_complete
Sep 22, 2021
9237e6b
Add DAC Verifier Setup command to Android, Darwin and Python builds.
Sep 22, 2021
015573c
Merge branch 'master' into feature/device_attestation_complete
Sep 22, 2021
8110d5c
Merge commit 'a9ce3207a39de030ddd86e286696c928d5a5d0d4' of github.com…
Sep 23, 2021
866a1c8
move GetAttestationChallenge method to new CryptoContext class. Adapt…
Sep 23, 2021
a61c1f1
rerun zap
Sep 23, 2021
b080b4b
Merge commit 'e1f3aa1bb4084f89b3762b346f67da2350cadadb' of github.com…
Sep 23, 2021
c9f00f8
reran zap
Sep 23, 2021
4d1d0d0
Attestation failure shouldn't break the SessionEstablishment flow
Sep 24, 2021
d80b25d
Merge branch 'master' into feature/device_attestation_complete
Sep 24, 2021
c224eb0
Merge branch 'master' into feature/device_attestation_complete
Sep 27, 2021
b9e3deb
Send CSR Request even if Attestation Information fails to be validated.
Sep 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed unneded header
clang-format did a number of reformats

Updated firmwareInfoTestVector
  • Loading branch information
Marty Leisner authored and Marty Leisner committed Sep 15, 2021
commit 7c39a02a01399433f79351a7e698113ec972da3b
1 change: 0 additions & 1 deletion src/credentials/DeviceAttestationConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <lib/support/logging/CHIPLogging.h>

#include <cstdint>
#include <iostream>

namespace chip {
namespace Credentials {
Expand Down
50 changes: 30 additions & 20 deletions src/credentials/tests/TestDeviceAttestationConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,24 @@ static void TestAttestationElements_Roundtrip(nlTestSuite * inSuite, void * inCo
{
MutableByteSpan attestationElementsSpan(attestationElements.Get(), attestationElementsLen);

// test wrong size nonce
// Test wrong size nonce
err = ConstructAttestationElements(
ByteSpan(certificationDeclaration), ByteSpan(attestationNonce, sizeof(attestationNonce) - 1), timestamp, ByteSpan(),
vendorReservedArray, ArraySize(vendorReservedArray), vendorId, profileNum, attestationElementsSpan);
NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT);

// test with missing mandatory TLV entries
// Test with missing mandatory TLV entries
err = ConstructAttestationElements(ByteSpan(), ByteSpan(attestationNonce), timestamp, ByteSpan(), vendorReservedArray,
ArraySize(vendorReservedArray), vendorId, profileNum, attestationElementsSpan);
NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT);

// test with missing mandatory TLV entries
// Test with missing mandatory TLV entries
err =
ConstructAttestationElements(ByteSpan(certificationDeclaration), ByteSpan(), timestamp, ByteSpan(), vendorReservedArray,
ArraySize(vendorReservedArray), vendorId, profileNum, attestationElementsSpan);
NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT);

// Test for success with entirely valid arguments
err = ConstructAttestationElements(ByteSpan(certificationDeclaration), ByteSpan(attestationNonce), timestamp, ByteSpan(),
vendorReservedArray, ArraySize(vendorReservedArray), vendorId, profileNum,
attestationElementsSpan);
Expand Down Expand Up @@ -240,19 +241,23 @@ static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite *
CHIP_ERROR err = CHIP_NO_ERROR;

uint8_t attestationElementsTestVectorWithFirmwareInfo[] = {
0x15, 0x30, 0x01, 0x70, 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0,
0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16,
0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c,
0x03, 0x64, 0x0b, 0x28, 0x67, 0x02, 0xbd, 0x6b, 0xba, 0x48, 0xac, 0x7c, 0x83, 0x54, 0x9b, 0x68, 0x73, 0x29, 0x47,
0x48, 0xb9, 0x51, 0xd5, 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78,
0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d,
0x30, 0xaa, 0x30, 0x02, 0x20, 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d,
0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, 0x26,
0x03, 0xfd, 0xc6, 0x5b, 0x28, 0x30, 0x04, 0x14, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x72, 0x6d,
0x77, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0xd0, 0xf1, 0xff, 0x3e, 0x00, 0x01, 0x00, 0x17, 0x73, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
0x64, 0x31, 0xd0, 0xf1, 0xff, 0x3e, 0x00, 0x03, 0x00, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65,
0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18
0x15, 0x30, 0x01, 0x70, 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58,
0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05,
0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b,
0x28, 0x67, 0x02, 0xbd, 0x6b, 0xba, 0x48, 0xac, 0x7c, 0x83, 0x54, 0x9b, 0x68, 0x73, 0x29, 0x47, 0x48, 0xb9, 0x51, 0xd5,
0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae,
0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa, 0x30, 0x02, 0x20, 0xe0,
0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d,
0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, 0x26, 0x03, 0xfd, 0xc6, 0x5b, 0x28, 0x30, 0x04, 0x69,
0x30, 0x67, 0x80, 0x01, 0x05, 0xA1, 0x62, 0x30, 0x2F, 0xA0, 0x0B, 0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04,
0x02, 0x01, 0x81, 0x20, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x30, 0x2F, 0xA0, 0x0B,
0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A,
0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0xd0, 0xf1, 0xff, 0x3e, 0x00, 0x01, 0x00, 0x17, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f,
0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, 0xd0, 0xf1, 0xff, 0x3e,
0x00, 0x03, 0x00, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33,
0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18
};
uint8_t certificationDeclarationTestVector[] = {
0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25,
Expand All @@ -262,12 +267,17 @@ static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite *
0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67,
0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa
};
uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d,
uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d,
0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a,
0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 };
uint32_t timestampTestVector = 677103357;
uint8_t firmwareInfoTestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x72,
0x6d, 0x77, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f };
uint32_t timestampTestVector = 677103357;
uint8_t firmwareInfoTestVector[] = { 0x30, 0x67, 0x80, 0x01, 0x05, 0xA1, 0x62, 0x30, 0x2F, 0xA0, 0x0B, 0x80, 0x09, 0x60, 0x86,
0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44,
0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x30, 0x2F, 0xA0, 0x0B,
0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F };
uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f,
0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 };
uint8_t vendorReserved3TestVector[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72,
Expand Down