Skip to content

Commit

Permalink
SilabsDeviceAttestationCreds: Code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcasallas-silabs committed Mar 24, 2023
1 parent 777f514 commit 83a3825
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/platform/silabs/SilabsDeviceAttestationCreds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace {

class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
{
// Miss-aligned certificates is a common error, and printing the first few bytes is
// useful to verify proper alignment. Eight bytes is enough for this purpose.
static constexpr size_t kDebugLength = 8;

public:
Expand All @@ -55,7 +57,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
uint8_t * address = _credentials_address + offset;
ByteSpan cd_span(address, size);
ChipLogProgress(DeviceLayer, "GetCertificationDeclaration, addr:%p, size:%lu", address, size);
ChipLogByteSpan(Zcl, ByteSpan(cd_span.data(), kDebugLength));
ChipLogByteSpan(DeviceLayer, ByteSpan(cd_span.data(), kDebugLength));
return CopySpanToMutableSpan(cd_span, out_span);
}

Expand All @@ -81,7 +83,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
uint8_t * address = _credentials_address + offset;
ByteSpan cert_span(address, size);
ChipLogProgress(DeviceLayer, "GetDeviceAttestationCert, addr:%p, size:%lu", address, size);
ChipLogByteSpan(Zcl, ByteSpan(cert_span.data(), kDebugLength));
ChipLogByteSpan(DeviceLayer, ByteSpan(cert_span.data(), kDebugLength));
return CopySpanToMutableSpan(cert_span, out_span);
}

Expand All @@ -100,7 +102,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
uint8_t * address = _credentials_address + offset;
ByteSpan cert_span(address, size);
ChipLogProgress(DeviceLayer, "GetProductAttestationIntermediateCert, addr:%p, size:%lu", address, size);
ChipLogByteSpan(Zcl, ByteSpan(cert_span.data(), kDebugLength));
ChipLogByteSpan(DeviceLayer, ByteSpan(cert_span.data(), kDebugLength));
return CopySpanToMutableSpan(cert_span, out_span);
}

Expand Down

0 comments on commit 83a3825

Please sign in to comment.