Skip to content

Commit 9ee291e

Browse files
committed
AesBytesEncryptorTests Check Key Strength
Fixes: gh-6121
1 parent 7232dab commit 9ee291e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crypto/src/test/java/org/springframework/security/crypto/encrypt/AesBytesEncryptorTests.java

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void setUp() {
4646

4747
@Test
4848
public void roundtripWhenUsingDefaultsThenEncryptsAndDecrypts() {
49+
CryptoAssumptions.assumeCBCJCE();
4950
AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt);
5051
byte[] encryption = encryptor.encrypt(this.secret.getBytes());
5152
byte[] decryption = encryptor.decrypt(encryption);
@@ -54,6 +55,7 @@ public void roundtripWhenUsingDefaultsThenEncryptsAndDecrypts() {
5455

5556
@Test
5657
public void roundtripWhenUsingDefaultCipherThenEncryptsAndDecrypts() {
58+
CryptoAssumptions.assumeCBCJCE();
5759
AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt, this.generator);
5860
byte[] encryption = encryptor.encrypt(this.secret.getBytes());
5961
assertThat(new String(Hex.encode(encryption)))
@@ -65,6 +67,7 @@ public void roundtripWhenUsingDefaultCipherThenEncryptsAndDecrypts() {
6567

6668
@Test
6769
public void roundtripWhenUsingGcmThenEncryptsAndDecrypts() {
70+
CryptoAssumptions.assumeGCMJCE();
6871
AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt, this.generator, GCM);
6972
byte[] encryption = encryptor.encrypt(this.secret.getBytes());
7073
assertThat(new String(Hex.encode(encryption)))

0 commit comments

Comments
 (0)