Skip to main content

x509_check_host

API Overview

X509_check_host is an API in openssl. This rule belongs to the return value check type. This rule is generated using AURC.

Rule Description

tip

All functions can also return -2 if the input is malformed. For example, X509_check_host() returns -2 if the provided B<name> contains embedded NULs.

info
  • Tags: return value check
  • Parameter Index: N/A
  • CWE Type: CWE-253

Rule Code

import cpp

class OpenSSLFunctionCall extends FunctionCall {
OpenSSLFunctionCall() {
this.getTarget().hasName("X509_check_host")
}
}

from OpenSSLFunctionCall call, UnaryOperation uop
where
uop.getOperator() = "!" and
uop.getOperand() = call.getAnAccess()
select uop, "This negation checks the return value of X509_check_host."