From 9ee291e6591cccda53d11292d7076a77a84f3ab8 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Tue, 20 Nov 2018 10:11:01 -0700 Subject: [PATCH] AesBytesEncryptorTests Check Key Strength Fixes: gh-6121 --- .../security/crypto/encrypt/AesBytesEncryptorTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/src/test/java/org/springframework/security/crypto/encrypt/AesBytesEncryptorTests.java b/crypto/src/test/java/org/springframework/security/crypto/encrypt/AesBytesEncryptorTests.java index 183efedcdc..89752ec28f 100644 --- a/crypto/src/test/java/org/springframework/security/crypto/encrypt/AesBytesEncryptorTests.java +++ b/crypto/src/test/java/org/springframework/security/crypto/encrypt/AesBytesEncryptorTests.java @@ -46,6 +46,7 @@ public class AesBytesEncryptorTests { @Test public void roundtripWhenUsingDefaultsThenEncryptsAndDecrypts() { + CryptoAssumptions.assumeCBCJCE(); AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt); byte[] encryption = encryptor.encrypt(this.secret.getBytes()); byte[] decryption = encryptor.decrypt(encryption); @@ -54,6 +55,7 @@ public class AesBytesEncryptorTests { @Test public void roundtripWhenUsingDefaultCipherThenEncryptsAndDecrypts() { + CryptoAssumptions.assumeCBCJCE(); AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt, this.generator); byte[] encryption = encryptor.encrypt(this.secret.getBytes()); assertThat(new String(Hex.encode(encryption))) @@ -65,6 +67,7 @@ public class AesBytesEncryptorTests { @Test public void roundtripWhenUsingGcmThenEncryptsAndDecrypts() { + CryptoAssumptions.assumeGCMJCE(); AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt, this.generator, GCM); byte[] encryption = encryptor.encrypt(this.secret.getBytes()); assertThat(new String(Hex.encode(encryption)))