From a4adf0e6da74bbab99fb7f5f90d8f8e1c8e28121 Mon Sep 17 00:00:00 2001
From: zhaoyz <11@11.com>
Date: Fri, 12 Apr 2024 18:39:28 +0800
Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81=E8=A7=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
auth/pom.xml | 16 ++++++++++++----
.../core/RaxDaoAuthenticationProvider.java | 4 +++-
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/auth/pom.xml b/auth/pom.xml
index a48394a..8532500 100644
--- a/auth/pom.xml
+++ b/auth/pom.xml
@@ -54,10 +54,18 @@
-
- cn.hutool
- hutool-crypto
-
+
+
+ cn.hutool
+ hutool-crypto
+ 5.8.27
+
+
+
+ org.bouncycastle
+ bcprov-jdk15to18
+ 1.68
+
diff --git a/auth/src/main/java/com/rax/auth/support/core/RaxDaoAuthenticationProvider.java b/auth/src/main/java/com/rax/auth/support/core/RaxDaoAuthenticationProvider.java
index 73ce999..04bd187 100644
--- a/auth/src/main/java/com/rax/auth/support/core/RaxDaoAuthenticationProvider.java
+++ b/auth/src/main/java/com/rax/auth/support/core/RaxDaoAuthenticationProvider.java
@@ -206,7 +206,9 @@ public class RaxDaoAuthenticationProvider extends AbstractUserDetailsAuthenticat
// 构建前端对应解密AES 因子
String key = SpringContextHolder.getBean(Environment.class)
.getProperty("gateway.encodeKey", "raxsraxsraxsraxs");
- AES aes = new AES(Mode.CFB, Padding.NoPadding, new SecretKeySpec(key.getBytes(), "AES"),
+ /*AES aes = new AES(Mode.CFB, Padding.PKCS5Padding, new SecretKeySpec(key.getBytes(), "AES"),
+ new IvParameterSpec(key.getBytes()));*/
+ AES aes = new AES("CBC", "PKCS7Padding", new SecretKeySpec(key.getBytes(), "AES"),
new IvParameterSpec(key.getBytes()));
return aes.decryptStr(presentedPassword);
}