Open
Description
Affected page
https://www.php.net/manual/en/function.openssl-x509-verify.php
Current issue
Returns 1 if the signature is correct, 0 if it is incorrect, and -1 on error.
This means that both the success case and the error cases are truthy, which makes code like:
if (openssl_x509_verify()) { … }
dangerous.
Suggested improvement
A warning should be added to always compare === 1
. The code example should be updated to === 1
instead of == 1
as well.
Additional context
Same applies to openssl_verify()
and possibly others.