跳到主要内容

OCSP_check_nonce

API 概述

OCSP_check_nonceopenssl 中的一个API。该规属于return value check 类型。该规则是使用 AURC 生成的。

规则描述

提示

OCSP_check_nonce() returns the result of the nonce comparison between B<req> and B<resp>. The return value indicates the result of the comparison. If nonces are present and equal 1 is returned. If the nonces are absent 2 is returned. If a nonce is present in the response only 3 is returned. If nonces are present and unequal 0 is returned. If the nonce is present in the request only then -1 is returned.

信息

标签:return value check

参数下标:N/A

CWE类别:CWE-253

规则代码

import cpp

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

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