[secure-transport] remove redundant null check (#10254)

This commit is contained in:
Jonathan Hui
2024-05-16 18:19:34 -07:00
committed by GitHub
parent c8e2eb868b
commit 8c92497a7b
+3 -5
View File
@@ -638,15 +638,13 @@ Error SecureTransport::GetPeerSubjectAttributeByOid(const char *aOid,
VerifyOrExit(aAttributeBuffer != nullptr, error = kErrorNoBufs);
VerifyOrExit(peerCert != nullptr, error = kErrorInvalidState);
data = mbedtls_asn1_find_named_data(&peerCert->subject, aOid, aOidLength);
VerifyOrExit(data != nullptr, error = kErrorNotFound);
length = data->val.len;
VerifyOrExit(length <= attributeBufferSize, error = kErrorNoBufs);
if (aAttributeLength != nullptr)
{
*aAttributeLength = length;
}
*aAttributeLength = length;
if (aAsn1Type != nullptr)
{