From 7402c798aa992f7d4f5acab574572bfe31512464 Mon Sep 17 00:00:00 2001 From: Ricardo Casallas Date: Mon, 22 Aug 2022 14:29:01 -0400 Subject: [PATCH] [EFR32] Fix CSR length. --- src/platform/EFR32/Efr32PsaOpaqueKeypair.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/EFR32/Efr32PsaOpaqueKeypair.cpp b/src/platform/EFR32/Efr32PsaOpaqueKeypair.cpp index b1c32dc028471d..da72af848bab51 100644 --- a/src/platform/EFR32/Efr32PsaOpaqueKeypair.cpp +++ b/src/platform/EFR32/Efr32PsaOpaqueKeypair.cpp @@ -407,7 +407,9 @@ CHIP_ERROR EFR32OpaqueP256Keypair::Deserialize(P256SerializedKeypair & input) CHIP_ERROR EFR32OpaqueP256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const { MutableByteSpan csr(out_csr, csr_length); - return GenerateCertificateSigningRequest(this, csr); + CHIP_ERROR err = GenerateCertificateSigningRequest(this, csr); + csr_length = (CHIP_NO_ERROR == err) ? csr.size() : 0; + return err; } CHIP_ERROR EFR32OpaqueP256Keypair::ECDSA_sign_msg(const uint8_t * msg, size_t msg_length, P256ECDSASignature & out_signature) const