Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【bug】src/Pay/Validator.php的 openssl_verify函数返回值 #2843

Closed
ledccn opened this issue Oct 6, 2024 · 2 comments · Fixed by #2844
Closed

【bug】src/Pay/Validator.php的 openssl_verify函数返回值 #2843

ledccn opened this issue Oct 6, 2024 · 2 comments · Fixed by #2844

Comments

@ledccn
Copy link
Contributor

ledccn commented Oct 6, 2024

我用的环境

  • PHP 版本:8.3
  • overtrue/wechat 版本:6.15.2
  • 是否使用了框架?框架名称:webman

问题及现象

vendor/w7corp/easywechat/src/Pay/Validator.php的 openssl_verify函数返回值:
如果签名正确返回 1,签名错误返回 0,错误时返回 -1 或 [false]
应改为:

if (\openssl_verify(
    $message,
    base64_decode($signature),
    strval($publicKey),
    OPENSSL_ALGO_SHA256
) !== 1) {
    throw new InvalidSignatureException('Invalid Signature');
}
@overtrue
Copy link
Collaborator

overtrue commented Oct 6, 2024

直接 PR 一个?

ledccn added a commit to ledccn/easywechat that referenced this issue Oct 6, 2024
@ledccn
Copy link
Contributor Author

ledccn commented Oct 8, 2024

直接 PR 一个?
已PR,盼审批。(:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants