From fc700831825a906bbf6d64ef015666e02b111993 Mon Sep 17 00:00:00 2001 From: shgutte <102281713+shgutte@users.noreply.github.com> Date: Thu, 27 Oct 2022 01:37:28 +0530 Subject: [PATCH] Added fix for WF200 certificate injection (#23012) * Added fix for WF200 certificate injection * Adds changes according to comments * Adds changes according to comments * Add restyled changes according to comment Co-authored-by: riwaghe Co-authored-by: Andrei Litvin --- .../platform/efr32/EFR32DeviceAttestationCreds.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/platform/efr32/EFR32DeviceAttestationCreds.cpp b/examples/platform/efr32/EFR32DeviceAttestationCreds.cpp index 942505bd82e81c..f68f0b892be1d6 100644 --- a/examples/platform/efr32/EFR32DeviceAttestationCreds.cpp +++ b/examples/platform/efr32/EFR32DeviceAttestationCreds.cpp @@ -23,7 +23,7 @@ #include "efr32_creds.h" #include "psa/crypto.h" -extern uint32_t __attestation_credentials_base; +extern uint8_t __attestation_credentials_base[]; namespace chip { namespace Credentials { @@ -37,7 +37,7 @@ class DeviceAttestationCredsEFR32 : public DeviceAttestationCredentialsProvider public: CHIP_ERROR GetCertificationDeclaration(MutableByteSpan & out_buffer) override { - ByteSpan cd_span(((uint8_t *) &__attestation_credentials_base) + EFR32_CREDENTIALS_CD_OFFSET, EFR32_CREDENTIALS_CD_SIZE); + ByteSpan cd_span(((uint8_t *) __attestation_credentials_base) + EFR32_CREDENTIALS_CD_OFFSET, EFR32_CREDENTIALS_CD_SIZE); return CopySpanToMutableSpan(cd_span, out_buffer); } @@ -50,15 +50,13 @@ class DeviceAttestationCredsEFR32 : public DeviceAttestationCredentialsProvider CHIP_ERROR GetDeviceAttestationCert(MutableByteSpan & out_buffer) override { - ByteSpan cert_span(((uint8_t *) &__attestation_credentials_base) + EFR32_CREDENTIALS_DAC_OFFSET, - EFR32_CREDENTIALS_DAC_SIZE); + ByteSpan cert_span(((uint8_t *) __attestation_credentials_base) + EFR32_CREDENTIALS_DAC_OFFSET, EFR32_CREDENTIALS_DAC_SIZE); return CopySpanToMutableSpan(cert_span, out_buffer); } CHIP_ERROR GetProductAttestationIntermediateCert(MutableByteSpan & out_pai_buffer) override { - ByteSpan cert_span(((uint8_t *) &__attestation_credentials_base) + EFR32_CREDENTIALS_PAI_OFFSET, - EFR32_CREDENTIALS_PAI_SIZE); + ByteSpan cert_span(((uint8_t *) __attestation_credentials_base) + EFR32_CREDENTIALS_PAI_OFFSET, EFR32_CREDENTIALS_PAI_SIZE); return CopySpanToMutableSpan(cert_span, out_pai_buffer); }