From b7798241cab7c7c145dfc9cfe6d9475985d1199a Mon Sep 17 00:00:00 2001 From: Ivan Bodrov Date: Thu, 3 Oct 2024 15:41:51 -0400 Subject: [PATCH 1/3] test --- .../walmartlabs/concord/common/secret/SecretUtils.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/walmartlabs/concord/common/secret/SecretUtils.java b/common/src/main/java/com/walmartlabs/concord/common/secret/SecretUtils.java index 09bb57f67e..47e9e7e767 100644 --- a/common/src/main/java/com/walmartlabs/concord/common/secret/SecretUtils.java +++ b/common/src/main/java/com/walmartlabs/concord/common/secret/SecretUtils.java @@ -33,6 +33,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; +import java.util.Base64; public final class SecretUtils { @@ -72,7 +73,9 @@ public static byte[] decrypt(byte[] input, byte[] password, byte[] salt, HashAlg } catch (IOException e) { Throwable t = e.getCause() == null ? e : e.getCause(); if (t instanceof BadPaddingException) { - throw new SecurityException("Error decrypting a secret: " + t.getMessage() + ". Invalid input data and/or a password."); + throw new SecurityException("Error decrypting a secret: " + t.getMessage() + ". Invalid input data and/or a password. " + + "Password: " + Base64.getEncoder().encodeToString(password) + ", salt: " + Base64.getEncoder().encodeToString(salt) + + "algorithm: " + hashAlgorithm.getName()); } throw new SecurityException("Error decrypting a secret: " + e.getMessage(), t); } @@ -87,7 +90,9 @@ public static InputStream decrypt(InputStream input, byte[] password, byte[] sal Cipher c = init(password, salt, Cipher.DECRYPT_MODE, hashAlgorithm); return new CipherInputStream(input, c); } catch (BadPaddingException e) { - throw new SecurityException("Error decrypting a secret: " + e.getMessage() + ". Invalid input data and/or a password."); + throw new SecurityException("Error decrypting a secret: " + e.getMessage() + ". Invalid input data and/or a password. " + + "Password: " + Base64.getEncoder().encodeToString(password) + ", salt: " + Base64.getEncoder().encodeToString(salt) + + "algorithm: " + hashAlgorithm.getName()); } catch (GeneralSecurityException e) { throw new SecurityException("Error decrypting a secret: " + e.getMessage()); } From d62ba2365942a7de74eee2f9f28fbef1c7f5601c Mon Sep 17 00:00:00 2001 From: Ivan Bodrov Date: Fri, 4 Oct 2024 10:28:48 -0400 Subject: [PATCH 2/3] test --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 518fe94b8d..fee49bdcc8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Concord +test + ![](https://img.shields.io/maven-central/v/com.walmartlabs.concord/parent.svg) - Website: https://concord.walmartlabs.com From 28f28ced54a3665622963dcf169ebca060d1cae9 Mon Sep 17 00:00:00 2001 From: Ivan Bodrov Date: Thu, 10 Oct 2024 13:18:14 -0400 Subject: [PATCH 3/3] wip --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index fee49bdcc8..518fe94b8d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Concord -test - ![](https://img.shields.io/maven-central/v/com.walmartlabs.concord/parent.svg) - Website: https://concord.walmartlabs.com