Skip to content

Commit 4605913

Browse files
m
1 parent eefdb4f commit 4605913

File tree

50 files changed

+463
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+463
-457
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@
168168
<scope>test</scope>
169169
</dependency>
170170

171+
<dependency>
172+
<groupId>org.junit-pioneer</groupId>
173+
<artifactId>junit-pioneer</artifactId>
174+
<version>1.9.1</version>
175+
<scope>test</scope>
176+
</dependency>
171177
</dependencies>
172178

173179
<build>

src/test/java/software/amazon/encryption/s3/AdditionalDecryptionKeyMaterialTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
package software.amazon.encryption.s3;
44

55
import org.junit.jupiter.api.BeforeAll;
6-
import org.junit.jupiter.api.Test;
6+
import org.junitpioneer.jupiter.RetryingTest;
77
import software.amazon.awssdk.core.ResponseBytes;
88
import software.amazon.awssdk.core.sync.RequestBody;
99
import software.amazon.awssdk.services.s3.S3Client;
@@ -64,7 +64,7 @@ public static void setUp() throws NoSuchAlgorithmException {
6464
* Test AES keyring with null additionalDecryptionKeyMaterial map.
6565
* This tests the default behavior when no additional key material is provided.
6666
*/
67-
@Test
67+
@RetryingTest(3)
6868
public void testAesKeyringWithNullAdditionalKeyMaterial() {
6969
final String objectKey = appendTestSuffix("aes-null-additional-key-material");
7070
final String input = "AES with null additional key material";
@@ -124,7 +124,7 @@ public void testAesKeyringWithNullAdditionalKeyMaterial() {
124124
* Test AES keyring with empty additionalDecryptionKeyMaterial map.
125125
* This tests the behavior when an empty map is provided.
126126
*/
127-
@Test
127+
@RetryingTest(3)
128128
public void testAesKeyringWithEmptyAdditionalKeyMaterial() {
129129
final String objectKey = appendTestSuffix("aes-empty-additional-key-material");
130130
final String input = "AES with empty additional key material";
@@ -185,7 +185,7 @@ public void testAesKeyringWithEmptyAdditionalKeyMaterial() {
185185
* Test AES keyring with a singleton additionalDecryptionKeyMaterial map.
186186
* This tests the behavior when a single additional key material is provided.
187187
*/
188-
@Test
188+
@RetryingTest(3)
189189
public void testAesKeyringWithSingletonAdditionalKeyMaterial() {
190190
final String objectKey = appendTestSuffix("aes-singleton-additional-key-material");
191191
final String input = "AES with singleton additional key material";
@@ -252,7 +252,7 @@ public void testAesKeyringWithSingletonAdditionalKeyMaterial() {
252252
* Test AES keyring with multiple entries in the additionalDecryptionKeyMaterial map.
253253
* This tests the behavior when multiple additional key materials are provided.
254254
*/
255-
@Test
255+
@RetryingTest(3)
256256
public void testAesKeyringWithMultipleAdditionalKeyMaterials() {
257257
final String objectKey = appendTestSuffix("aes-multiple-additional-key-materials");
258258
final String input = "AES with multiple additional key materials";
@@ -331,7 +331,7 @@ public void testAesKeyringWithMultipleAdditionalKeyMaterials() {
331331
* Test AES keyring with additionalDecryptionKeyMaterial that doesn't match.
332332
* This tests the behavior when no matching key material is found and it should fall back to the default key.
333333
*/
334-
@Test
334+
@RetryingTest(3)
335335
public void testAesKeyringWithNonMatchingAdditionalKeyMaterial() {
336336
final String objectKey = appendTestSuffix("aes-non-matching-additional-key-material");
337337
final String input = "AES with non-matching additional key material";
@@ -402,7 +402,7 @@ public void testAesKeyringWithNonMatchingAdditionalKeyMaterial() {
402402
* Test AES keyring with additionalDecryptionKeyMaterial that doesn't match and a wrong default key.
403403
* This tests the behavior when no matching key material is found and the default key is also wrong.
404404
*/
405-
@Test
405+
@RetryingTest(3)
406406
public void testAesKeyringWithNonMatchingAdditionalKeyMaterialAndWrongDefaultKey() {
407407
final String objectKey = appendTestSuffix("aes-non-matching-additional-key-material-wrong-default");
408408
final String input = "AES with non-matching additional key material and wrong default key";
@@ -469,7 +469,7 @@ public void testAesKeyringWithNonMatchingAdditionalKeyMaterialAndWrongDefaultKey
469469
* Test RSA keyring with null additionalDecryptionKeyMaterial map.
470470
* This tests the default behavior when no additional key material is provided.
471471
*/
472-
@Test
472+
@RetryingTest(3)
473473
public void testRsaKeyringWithNullAdditionalKeyMaterial() {
474474
final String objectKey = appendTestSuffix("rsa-null-additional-key-material");
475475
final String input = "RSA with null additional key material";
@@ -535,7 +535,7 @@ public void testRsaKeyringWithNullAdditionalKeyMaterial() {
535535
* Test RSA keyring with empty additionalDecryptionKeyMaterial map.
536536
* This tests the behavior when an empty map is provided.
537537
*/
538-
@Test
538+
@RetryingTest(3)
539539
public void testRsaKeyringWithEmptyAdditionalKeyMaterial() {
540540
final String objectKey = appendTestSuffix("rsa-empty-additional-key-material");
541541
final String input = "RSA with empty additional key material";
@@ -602,7 +602,7 @@ public void testRsaKeyringWithEmptyAdditionalKeyMaterial() {
602602
* Test RSA keyring with a singleton additionalDecryptionKeyMaterial map.
603603
* This tests the behavior when a single additional key material is provided.
604604
*/
605-
@Test
605+
@RetryingTest(3)
606606
public void testRsaKeyringWithSingletonAdditionalKeyMaterial() {
607607
final String objectKey = appendTestSuffix("rsa-singleton-additional-key-material");
608608
final String input = "RSA with singleton additional key material";
@@ -678,7 +678,7 @@ public void testRsaKeyringWithSingletonAdditionalKeyMaterial() {
678678
* Test RSA keyring with multiple entries in the additionalDecryptionKeyMaterial map.
679679
* This tests the behavior when multiple additional key materials are provided.
680680
*/
681-
@Test
681+
@RetryingTest(3)
682682
public void testRsaKeyringWithMultipleAdditionalKeyMaterials() {
683683
final String objectKey = appendTestSuffix("rsa-multiple-additional-key-materials");
684684
final String input = "RSA with multiple additional key materials";
@@ -769,7 +769,7 @@ public void testRsaKeyringWithMultipleAdditionalKeyMaterials() {
769769
* Test RSA keyring with additionalDecryptionKeyMaterial that doesn't match.
770770
* This tests the behavior when no matching key material is found and it should fall back to the default key.
771771
*/
772-
@Test
772+
@RetryingTest(3)
773773
public void testRsaKeyringWithNonMatchingAdditionalKeyMaterial() {
774774
final String objectKey = appendTestSuffix("rsa-non-matching-additional-key-material");
775775
final String input = "RSA with non-matching additional key material";
@@ -849,7 +849,7 @@ public void testRsaKeyringWithNonMatchingAdditionalKeyMaterial() {
849849
* Test RSA keyring with additionalDecryptionKeyMaterial that doesn't match and a wrong default key.
850850
* This tests the behavior when no matching key material is found and the default key is also wrong.
851851
*/
852-
@Test
852+
@RetryingTest(3)
853853
public void testRsaKeyringWithNonMatchingAdditionalKeyMaterialAndWrongDefaultKey() {
854854
final String objectKey = appendTestSuffix("rsa-non-matching-additional-key-material-wrong-default");
855855
final String input = "RSA with non-matching additional key material and wrong default key";

src/test/java/software/amazon/encryption/s3/ParameterMalleabilityTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package software.amazon.encryption.s3;
22

33
import org.junit.jupiter.api.BeforeAll;
4-
import org.junit.jupiter.api.Test;
4+
import org.junitpioneer.jupiter.RetryingTest;
55
import software.amazon.awssdk.core.ResponseInputStream;
66
import software.amazon.awssdk.core.sync.RequestBody;
77
import software.amazon.awssdk.services.s3.S3Client;
@@ -30,7 +30,7 @@ public static void setUp() throws NoSuchAlgorithmException {
3030
AES_KEY = keyGen.generateKey();
3131
}
3232

33-
@Test
33+
@RetryingTest(3)
3434
public void contentEncryptionDowngradeAttackFails() {
3535
final String objectKey = appendTestSuffix("content-downgrade-attack-fails");
3636
S3Client s3Client = S3EncryptionClient.builderV4()
@@ -74,7 +74,7 @@ public void contentEncryptionDowngradeAttackFails() {
7474
s3Client.close();
7575
}
7676

77-
@Test
77+
@RetryingTest(3)
7878
public void keyWrapRemovalAttackFails() {
7979
final String objectKey = appendTestSuffix("keywrap-removal-attack-fails");
8080
S3Client s3Client = S3EncryptionClient.builderV4()
@@ -116,7 +116,7 @@ public void keyWrapRemovalAttackFails() {
116116
s3Client.close();
117117
}
118118

119-
@Test
119+
@RetryingTest(3)
120120
public void keyWrapDowngradeAesWrapAttackFails() {
121121
final String objectKey = appendTestSuffix("keywrap-downgrade-aeswrap-attack-fails");
122122
S3Client s3Client = S3EncryptionClient.builderV4()
@@ -159,7 +159,7 @@ public void keyWrapDowngradeAesWrapAttackFails() {
159159
s3Client.close();
160160
}
161161

162-
@Test
162+
@RetryingTest(3)
163163
public void keyWrapDowngradeAesAttackFails() {
164164
final String objectKey = appendTestSuffix("keywrap-downgrade-aes-attack-fails");
165165
S3Client s3Client = S3EncryptionClient.builderV4()

0 commit comments

Comments
 (0)