From 83a382558f222e78c2bc3d0218107668d7ababce Mon Sep 17 00:00:00 2001 From: Ricardo Casallas Date: Fri, 24 Mar 2023 13:31:51 -0400 Subject: [PATCH] SilabsDeviceAttestationCreds: Code review. --- examples/platform/silabs/SilabsDeviceAttestationCreds.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp b/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp index 95a1314d871ef8..7e4f36a3201a96 100644 --- a/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp +++ b/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp @@ -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: @@ -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); } @@ -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); } @@ -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); }