diff options
author | Neil Derraugh <neil.derraugh@yoppworks.com> | 2020-06-08 10:40:10 -0400 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-06-10 08:23:27 +0000 |
commit | 6cfebc0867b2f21a401f55734aba30eb245e3c70 (patch) | |
tree | fcbed2057758d87703104cccaacb302f082d9f19 /openecomp-be/backend/openecomp-sdc-security-util/src/test/java | |
parent | 8a0f58a005175959f5b56c0840ee9980f0d68c01 (diff) |
Fix security issue in SecurityUtil
- Specified mode and padding to address risky algorithm
- Corrected unit test for different exception message
- Moved tests to package
Issue-ID: SDC-3105
Signed-off-by: Neil Derraugh <neil.derraugh@yoppworks.com>
Change-Id: I5773ab555a5468362c775cf99795df4eb8c52136
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-security-util/src/test/java')
5 files changed, 11 insertions, 3 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/AuthenticationCookieUtilsTest.java b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/AuthenticationCookieUtilsTest.java index 402803479f..6c1e6cb849 100644 --- a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/AuthenticationCookieUtilsTest.java +++ b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/AuthenticationCookieUtilsTest.java @@ -18,6 +18,8 @@ * ============LICENSE_END========================================================= */ +package org.openecomp.sdc.securityutil; + import org.junit.Test; import javax.servlet.http.Cookie; diff --git a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/CipherUtilTest.java b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/CipherUtilTest.java index 888c888d42..437974de02 100644 --- a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/CipherUtilTest.java +++ b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/CipherUtilTest.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ +package org.openecomp.sdc.securityutil; + import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.RandomStringUtils; import org.junit.Test; -import org.openecomp.sdc.securityutil.CipherUtil; -import org.openecomp.sdc.securityutil.CipherUtilException; import static org.junit.Assert.*; @@ -67,7 +67,7 @@ public class CipherUtilTest { CipherUtil.decryptPKC(DATA, KEY); fail(); } catch (CipherUtilException ex) { - assertTrue(ex.getMessage().contains("Wrong IV length")); + assertTrue(ex.getMessage().contains("Input too short")); } } } diff --git a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/PasswordsTest.java b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/PasswordsTest.java index d3ba3bbe4e..34a0c52604 100644 --- a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/PasswordsTest.java +++ b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/PasswordsTest.java @@ -18,6 +18,8 @@ * ============LICENSE_END========================================================= */ +package org.openecomp.sdc.securityutil; + import org.junit.Test; import org.openecomp.sdc.securityutil.Passwords; diff --git a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/RepresentationUtilsTest.java b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/RepresentationUtilsTest.java index 5960c82130..f7af4a9318 100644 --- a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/RepresentationUtilsTest.java +++ b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/RepresentationUtilsTest.java @@ -18,6 +18,8 @@ * ============LICENSE_END========================================================= */ +package org.openecomp.sdc.securityutil; + import org.junit.Test; import java.io.IOException; diff --git a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/SessionValidationFilterTest.java b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/filters/SessionValidationFilterTest.java index 07151bc4d5..cb11ef97f4 100644 --- a/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/SessionValidationFilterTest.java +++ b/openecomp-be/backend/openecomp-sdc-security-util/src/test/java/org/openecomp/sdc/securityutil/filters/SessionValidationFilterTest.java @@ -18,6 +18,8 @@ * ============LICENSE_END========================================================= */ +package org.openecomp.sdc.securityutil.filters; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; |