From 4e42fe6bad5fb653a7aa9b5e2af8c5e3cb26dd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E5=BF=B5=E8=8E=AB=E5=BF=B5?= <50112066+fuhouyu@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:59:07 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20[ISSUE=20#12446]=20macInstance=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=97=A5=E5=BF=97=20(#12447)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java b/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java index 335375b45..38b1e1e20 100644 --- a/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java +++ b/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java @@ -203,7 +203,9 @@ public final class NacosSignatureAlgorithm { Mac instance = Mac.getInstance(jcaName); instance.init(key); return instance; - } catch (NoSuchAlgorithmException | InvalidKeyException e) { + } catch (NoSuchAlgorithmException e) { + throw new IllegalArgumentException("No Such Algorithm: " + jcaName); + } catch (InvalidKeyException e) { throw new IllegalArgumentException("Invalid key: " + key); } }