From ee0f2e0389efaf93cd4e64b08b13f01cf6eccaf7 Mon Sep 17 00:00:00 2001 From: cryptochecktool Date: Thu, 28 Nov 2024 09:55:37 +0800 Subject: [PATCH] Update CommentPublicQueryServiceImpl.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提升安全性 将MD5切换为sha256 --- .../app/theme/finders/impl/CommentPublicQueryServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java b/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java index 8655f8be97..1f06e3209e 100644 --- a/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java +++ b/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java @@ -172,7 +172,7 @@ private Mono filterCommentSensitiveData(CommentVo commentVo specOwner.setName(""); var email = owner.getEmail(); if (StringUtils.isNotBlank(email)) { - var emailHash = DigestUtils.md5DigestAsHex(email.getBytes()); + var emailHash = DigestUtils.sha256DigestAsHex(email.getBytes()); if (specOwner.getAnnotations() == null) { specOwner.setAnnotations(new HashMap<>(2)); } @@ -224,7 +224,7 @@ private Mono filterReplySensitiveData(ReplyVo replyVo) { specOwner.setName(""); var email = owner.getEmail(); if (StringUtils.isNotBlank(email)) { - var emailHash = DigestUtils.md5DigestAsHex(email.getBytes()); + var emailHash = DigestUtils.sha256DigestAsHex(email.getBytes()); if (specOwner.getAnnotations() == null) { specOwner.setAnnotations(new HashMap<>(2)); }