From aa733351d9cf605345fe68a53c22682474506de0 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Sat, 3 Sep 2022 02:35:17 +0800 Subject: [PATCH] AttestationVerifier: Do not return error when ExtractSKIDFromX509Cert fails (#22301) --- .../attestation_verifier/FileAttestationTrustStore.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/credentials/attestation_verifier/FileAttestationTrustStore.cpp b/src/credentials/attestation_verifier/FileAttestationTrustStore.cpp index 922f2c9521de0a..147f97ce08bd04 100644 --- a/src/credentials/attestation_verifier/FileAttestationTrustStore.cpp +++ b/src/credentials/attestation_verifier/FileAttestationTrustStore.cpp @@ -104,9 +104,10 @@ CHIP_ERROR FileAttestationTrustStore::GetProductAttestationAuthorityCert(const B { uint8_t skidBuf[Crypto::kSubjectKeyIdentifierLength] = { 0 }; MutableByteSpan candidateSkidSpan{ skidBuf }; - VerifyOrReturnError(CHIP_NO_ERROR == - Crypto::ExtractSKIDFromX509Cert(ByteSpan{ candidate.data(), candidate.size() }, candidateSkidSpan), - CHIP_ERROR_INTERNAL); + if (CHIP_NO_ERROR != Crypto::ExtractSKIDFromX509Cert(ByteSpan{ candidate.data(), candidate.size() }, candidateSkidSpan)) + { + continue; + } if (skid.data_equal(candidateSkidSpan)) {