From cdfcec981c44ff7454b202db21d1ef289733aaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 11 Aug 2021 14:41:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Jwt/Jwt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index a61f42c6..51fa4013 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -112,7 +112,7 @@ class Jwt extends Component $params[] = $this->jwtHeader(); $params[] = $this->jwtBody($unionId); - $params[] = hash($this->encrypt, $params[0] . $params[1]); + $params[] = hash('sha256', $params[0] . $params[1]); return implode('.', $params); } @@ -178,7 +178,7 @@ class Jwt extends Component if (count($explode = explode('.', $token)) != 3) { throw new JWTAuthTokenException('JWT Voucher Format Error.'); } - if (hash($this->encrypt, $explode[0] . $explode[1]) != $explode[2]) { + if (hash('sha256', $explode[0] . $explode[1]) != $explode[2]) { throw new JWTAuthTokenException('JWT Sign Validator Fail.'); } if (!openssl_public_decrypt(base64_decode($explode[1]), $decode, $this->public)) {