From 5bd656864b6d09a329121dca2831a18c44aecefa Mon Sep 17 00:00:00 2001 From: shripad621git Date: Wed, 22 Nov 2023 15:08:03 +0530 Subject: [PATCH] fixed the esp_secure_cert api --- src/platform/ESP32/ESP32SecureCertDACProvider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/ESP32/ESP32SecureCertDACProvider.cpp b/src/platform/ESP32/ESP32SecureCertDACProvider.cpp index f7de0bd9992090..1b06224318231c 100644 --- a/src/platform/ESP32/ESP32SecureCertDACProvider.cpp +++ b/src/platform/ESP32/ESP32SecureCertDACProvider.cpp @@ -79,8 +79,8 @@ CHIP_ERROR ESP32SecureCertDACProvider ::GetDeviceAttestationCert(MutableByteSpan { ESP_FAULT_ASSERT(err == ESP_OK && dac_cert != NULL && dac_len != 0); VerifyOrReturnError(dac_len <= kMaxDERCertLength, CHIP_ERROR_UNSUPPORTED_CERT_FORMAT, - esp_secure_cert_free_ca_cert(dac_cert)); - VerifyOrReturnError(dac_len <= outBuffer.size(), CHIP_ERROR_BUFFER_TOO_SMALL, esp_secure_cert_free_ca_cert(dac_cert)); + esp_secure_cert_free_device_cert(dac_cert)); + VerifyOrReturnError(dac_len <= outBuffer.size(), CHIP_ERROR_BUFFER_TOO_SMALL, esp_secure_cert_free_device_cert(dac_cert)); memcpy(outBuffer.data(), dac_cert, outBuffer.size()); outBuffer.reduce_size(dac_len); esp_secure_cert_free_device_cert(dac_cert);