소스 검색

AesBytesEncryptorTests Check Key Strength

Fixes: gh-6121
Josh Cummings 6 년 전
부모
커밋
9ee291e659
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      crypto/src/test/java/org/springframework/security/crypto/encrypt/AesBytesEncryptorTests.java

+ 3 - 0
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)))