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

Allow partial validation of DAC and CD (for external cloud or custom app based validation) #21725

Merged
merged 9 commits into from
Aug 16, 2022

Conversation

chrisdecenzo
Copy link
Contributor

When PAA list is not local, clients will want to perform as much local validation as possible.

Problem

  • Current default DAC verifier assumes local list of CSA and PAA keys

Change overview

  • Provide setting on DefaultDACVerifier to disable checks that depend upon local keys

Testing

  • Tested using android app

…station verification logic to allow cloud verifier to leverage it
…station verification logic to allow cloud verifier to leverage it
@chrisdecenzo chrisdecenzo changed the title Draft: Allow partial validation of DAC and CD Allow partial validation of DAC and CD (for external cloud or custom app based validation) Aug 12, 2022
@woody-apple woody-apple enabled auto-merge (squash) August 15, 2022 23:36
@woody-apple
Copy link
Contributor

Fast tracking, given this has had enough time for review

@woody-apple woody-apple merged commit 488262f into master Aug 16, 2022
@woody-apple woody-apple deleted the tvapps-android21 branch August 16, 2022 02:53
}

exit:
onCompletion->mCall(onCompletion->mContext, attestationError); // TODO: is this check getting done?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revisit this TODO?

namespace chip {
namespace Credentials {

class PartialDACVerifier : public DefaultDACVerifier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing docs and comments about the limitations

// As per specifications section 11.22.5.1. Constant RESP_MAX
constexpr size_t kMaxResponseLength = 900;

void PartialDACVerifier::VerifyAttestationInformation(const DeviceAttestationVerifier::AttestationInfo & info,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is missing comments about the limitations

@@ -202,8 +203,13 @@ CHIP_ERROR AndroidOperationalCredentialsIssuer::CallbackGenerateNOCChain(const B
jbyteArray javaCsr;
JniReferences::GetInstance().N2J_ByteArray(env, csr.data(), csr.size(), javaCsr);

P256PublicKey pubkey;
ReturnErrorOnFailure(VerifyCertificateSigningRequest(csr.data(), csr.size(), pubkey));
// TODO: verify signed by DAC creds?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO intended to remain?


if (useCallback)
{
// if we are assigning a callback, then make the device commissioner delegate verification to the cloud
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no cloud involved. Suggest removing the word cloud

if (useCallback)
{
// if we are assigning a callback, then make the device commissioner delegate verification to the cloud
wrapper->Controller()->SetDeviceAttestationVerifier(wrapper->GetPartialDACVerifier());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This forces usage of "PartialDACVerifier" for auto-commissioner all the time, which may override a prior call to SetDeviceAttestationVerifier. This is not explained in the API contract of the method

isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…app based validation) (project-chip#21725)

* Draft: Allow partial validation of DAC and CD (when PAA list is not local)

* Draft: Allow partial validation of DAC and CD (when PAA list is not local)

* Move cloud attestation to a separate class, re-structure default attestation verification logic to allow cloud verifier to leverage it

* straggler

* address feedback

* address feedback

* straggler

* fix builds, integration tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants