parent
6100401b85
commit
91a383aaab
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue