From 2a8edb6d4e91fd61517d3b6d4ec2300809c6ead4 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 10:00:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=A3=E5=AF=86=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/utils/Rsa.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crmeb/crmeb/utils/Rsa.php b/crmeb/crmeb/utils/Rsa.php index a02074676..f688a2c5f 100644 --- a/crmeb/crmeb/utils/Rsa.php +++ b/crmeb/crmeb/utils/Rsa.php @@ -13,6 +13,8 @@ namespace crmeb\utils; +use think\exception\ValidateException; + /** * Class Rsa * @author 等风来 @@ -186,7 +188,11 @@ class Rsa $this->exportOpenSSLFile(); } - openssl_private_decrypt(base64_decode($data), $decryptedData, file_get_contents($this->privateKey)); + $res = openssl_private_decrypt(base64_decode($data), $decryptedData, file_get_contents($this->privateKey)); + + if (false === $res) { + throw new ValidateException('RSA:解密失败'); + } return $decryptedData; }