Skip to content

Commit d1ac307

Browse files
committed
option to configure the revocation set file in chip-tool
1 parent 7c4c7a6 commit d1ac307

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

examples/chip-tool/commands/common/CHIPCommand.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(CommissionerIdentity & identity,
452452

453453
ReturnLogErrorOnFailure(mCredIssuerCmds->SetupDeviceAttestation(commissionerParams, sTrustStore));
454454

455+
mCredIssuerCmds->SetupDeviceAttestationRevocationSetPath(mDacRevocationSetPath.ValueOr(nullptr));
456+
455457
chip::Crypto::P256Keypair ephemeralKey;
456458

457459
if (fabricId != chip::kUndefinedFabricId)

examples/chip-tool/commands/common/CHIPCommand.h

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ class CHIPCommand : public Command
8686
AddArgument("only-allow-trusted-cd-keys", 0, 1, &mOnlyAllowTrustedCdKeys,
8787
"Only allow trusted CD verifying keys (disallow test keys). If not provided or 0 (\"false\"), untrusted CD "
8888
"verifying keys are allowed. If 1 (\"true\"), test keys are disallowed.");
89+
AddArgument("dac-revocation-set-path", &mDacRevocationSetPath,
90+
"Path to json file containing the device attestation revocation set.");
8991
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
9092
AddArgument("trace_file", &mTraceFile);
9193
AddArgument("trace_log", 0, 1, &mTraceLog);
@@ -222,6 +224,7 @@ class CHIPCommand : public Command
222224
chip::Optional<char *> mCDTrustStorePath;
223225
chip::Optional<bool> mUseMaxSizedCerts;
224226
chip::Optional<bool> mOnlyAllowTrustedCdKeys;
227+
chip::Optional<char *> mDacRevocationSetPath;
225228

226229
// Cached trust store so commands other than the original startup command
227230
// can spin up commissioners as needed.

examples/chip-tool/commands/common/CredentialIssuerCommands.h

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ class CredentialIssuerCommands
6262
virtual CHIP_ERROR SetupDeviceAttestation(chip::Controller::SetupParams & setupParams,
6363
const chip::Credentials::AttestationTrustStore * trustStore) = 0;
6464

65+
/**
66+
* @brief
67+
* This function is used to set the path to Device Attestation revocation set JSON file.
68+
*
69+
* @param[in] path Path to the JSON file containing list of revoked DACs or PAIs.
70+
* It can be generated using credentials/generate-revocation-set.py script
71+
*/
72+
virtual void SetupDeviceAttestationRevocationSetPath(const char * path) = 0;
73+
6574
/**
6675
* @brief Add a list of additional non-default CD verifying keys (by certificate)
6776
*

examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h

+11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ class ExampleCredentialIssuerCommands : public CredentialIssuerCommands
4444

4545
return CHIP_NO_ERROR;
4646
}
47+
48+
void SetupDeviceAttestationRevocationSetPath(const char * path) override
49+
{
50+
if (path)
51+
{
52+
// As we know that we are using DefaultDACVerifier, we can downcast from
53+
// DeviceAttestationVerifier to DefaultDACVerifier to set the revocation set
54+
static_cast<chip::Credentials::DefaultDACVerifier *>(mDacVerifier)->SetDeviceAttestationRevocationSetPath(path);
55+
}
56+
}
57+
4758
chip::Controller::OperationalCredentialsDelegate * GetCredentialIssuer() override { return &mOpCredsIssuer; }
4859
void SetCredentialIssuerCATValues(chip::CATValues cats) override { mOpCredsIssuer.SetCATValuesForNextNOCRequest(cats); }
4960
CHIP_ERROR GenerateControllerNOCChain(chip::NodeId nodeId, chip::FabricId fabricId, const chip::CATValues & cats,

0 commit comments

Comments
 (0)