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
achaulk-goog and restyled-commits authored Dec 2, 2022
1 parent 5529d74 commit 013514b
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 013514b

Please sign in to comment.