From 91a383aaab15334c44f140fa3fd1a4ff6827cc76 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Mon, 14 Sep 2020 10:39:28 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=E4=BF=AE=E6=94=B9AES128?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E7=A0=81=202.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E8=A7=A3=E5=AF=86=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/dispose/common/ErrorCode.java | 4 ++-- .../dispose/service/impl/ProtocolSecurityServiceImpl.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/dispose/common/ErrorCode.java b/src/main/java/com/dispose/common/ErrorCode.java index 1d558ffa..b0b65aa3 100644 --- a/src/main/java/com/dispose/common/ErrorCode.java +++ b/src/main/java/com/dispose/common/ErrorCode.java @@ -176,11 +176,11 @@ public enum ErrorCode { /** * Err decrypt aes 256 error code. */ - ERR_DECRYPT_AES256(102, "AES256解密失败"), + ERR_DECRYPT_AES128(102, "AES128解密失败"), /** * Err encrypt aes 256 error code. */ - ERR_ENCRYPT_AES256(103, "AES256加密失败"), + ERR_ENCRYPT_AES128(103, "AES128加密失败"), /** * Err decrypt 3 des error code. */ diff --git a/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java b/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java index 7fd56904..95c1130b 100644 --- a/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java +++ b/src/main/java/com/dispose/service/impl/ProtocolSecurityServiceImpl.java @@ -74,7 +74,7 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { decryptContent = CryptoHelper.aes128Decryption(base64Decode, SecurityConfigValue.AES_KEY); } catch (Exception e) { log.error("AES128 decode message error: {}", base64Decode); - throw new SecurityProtocolException(ErrorCode.ERR_DECRYPT_AES256); + throw new SecurityProtocolException(ErrorCode.ERR_DECRYPT_AES128); } } else if (proReq.getCryptoType() == ProtoCryptoType.CRYPTO_DES.getCode()) { try { @@ -128,7 +128,7 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { cipherText = CryptoHelper.base64Encryption(encode); } catch (Exception e) { log.error("AES128 encode message error: {}", plainText); - throw new SecurityProtocolException(ErrorCode.ERR_DECRYPT_AES256); + throw new SecurityProtocolException(ErrorCode.ERR_ENCRYPT_AES128); } } else if (cryptoType == ProtoCryptoType.CRYPTO_DES.getCode()) { try { @@ -137,7 +137,7 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { cipherText= CryptoHelper.base64Encryption(encode); } catch (Exception e) { log.error("DES encode message error: {}", plainText); - throw new SecurityProtocolException(ErrorCode.ERR_DECRYPT_3DES); + throw new SecurityProtocolException(ErrorCode.ERR_ENCRYPT_3DES); } } else { log.error("Unknown protocol security type: {}, {}", cryptoType, plainText);