Skip to content

Commit

Permalink
Fix -Wsign-conversion report in OpenSSL usage (#23839)
Browse files Browse the repository at this point in the history
* Fix -Wsign-conversion report in OpenSSL usage

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jun 16, 2023
1 parent 71db643 commit 2638690
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/crypto/CHIPCryptoPALOpenSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation
{
bool keyCertSignFlag = keyUsage & X509v3_KU_KEY_CERT_SIGN;
bool crlSignFlag = keyUsage & X509v3_KU_CRL_SIGN;
bool otherFlags = keyUsage & ~(X509v3_KU_CRL_SIGN | X509v3_KU_KEY_CERT_SIGN | X509v3_KU_DIGITAL_SIGNATURE);
bool otherFlags = keyUsage &
~static_cast<uint32_t>(X509v3_KU_CRL_SIGN | X509v3_KU_KEY_CERT_SIGN | X509v3_KU_DIGITAL_SIGNATURE);
VerifyOrExit(keyCertSignFlag && crlSignFlag && !otherFlags, err = CHIP_ERROR_INTERNAL);
}
}
Expand Down

0 comments on commit 2638690

Please sign in to comment.