Skip to content

Commit

Permalink
Get rid of some debug cruft.
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Jan 24, 2022
1 parent 51b8892 commit 90ecc76
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/credentials/examples/DefaultDeviceAttestationVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,6 @@ CHIP_ERROR DefaultDACVerifier::VerifyNodeOperationalCSRInformation(const ByteSpa
const ByteSpan & attestationSignatureBuffer,
const P256PublicKey & dacPublicKey, const ByteSpan & csrNonce)
{
ChipLogProgress(Controller, "veryfy %d %d %d %d", nocsrElementsBuffer.empty(), attestationChallengeBuffer.empty(),
attestationSignatureBuffer.empty(), csrNonce.empty());
VerifyOrReturnError(!nocsrElementsBuffer.empty() && !attestationChallengeBuffer.empty() &&
!attestationSignatureBuffer.empty() && !csrNonce.empty(),
CHIP_ERROR_INVALID_ARGUMENT);
Expand All @@ -411,25 +409,20 @@ CHIP_ERROR DefaultDACVerifier::VerifyNodeOperationalCSRInformation(const ByteSpa
ByteSpan vendorReserved1Span;
ByteSpan vendorReserved2Span;
ByteSpan vendorReserved3Span;
ChipLogProgress(Controller, "1");
ReturnErrorOnFailure(DeconstructNOCSRElements(nocsrElementsBuffer, csrSpan, csrNonceSpan, vendorReserved1Span,
vendorReserved2Span, vendorReserved3Span));

// Verify that Nonce matches with what we sent
ChipLogProgress(Controller, "2");
VerifyOrReturnError(csrNonceSpan.data_equal(csrNonce), CHIP_ERROR_INVALID_ARGUMENT);

// Validate overall attestation signature on attestation information
P256ECDSASignature signature;
// SetLength will fail if signature doesn't fit
ChipLogProgress(Controller, "3");
ReturnErrorOnFailure(signature.SetLength(attestationSignatureBuffer.size()));
memcpy(signature.Bytes(), attestationSignatureBuffer.data(), attestationSignatureBuffer.size());

ChipLogProgress(Controller, "4");
ReturnErrorOnFailure(ValidateAttestationSignature(dacPublicKey, nocsrElementsBuffer, attestationChallengeBuffer, signature));

ChipLogProgress(Controller, "5");
return CHIP_NO_ERROR;
}

Expand Down

0 comments on commit 90ecc76

Please sign in to comment.