File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
src/main/java/software/amazon/encryption/s3/materials Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public EncryptionMaterials onEncrypt(EncryptionMaterials materials) {
8181 @ Override
8282 public DecryptionMaterials onDecrypt (final DecryptionMaterials materials , List <EncryptedDataKey > encryptedDataKeys ) {
8383 if (materials .plaintextDataKey () != null ) {
84- return materials ;
84+ throw new S3EncryptionClientException ( "Decryption materials already contains a plaintext data key." ) ;
8585 }
8686
8787 for (EncryptedDataKey encryptedDataKey : encryptedDataKeys ) {
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public EncryptionMaterials onEncrypt(EncryptionMaterials materials) {
8686 @ Override
8787 public DecryptionMaterials onDecrypt (final DecryptionMaterials materials , List <EncryptedDataKey > encryptedDataKeys ) {
8888 if (materials .plaintextDataKey () != null ) {
89- return materials ;
89+ throw new S3EncryptionClientException ( "Decryption materials already contains a plaintext data key." ) ;
9090 }
9191
9292 for (EncryptedDataKey encryptedDataKey : encryptedDataKeys ) {
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public EncryptionMaterials onEncrypt(EncryptionMaterials materials) {
8686 @ Override
8787 public DecryptionMaterials onDecrypt (final DecryptionMaterials materials , List <EncryptedDataKey > encryptedDataKeys ) {
8888 if (materials .plaintextDataKey () != null ) {
89- return materials ;
89+ throw new S3EncryptionClientException ( "Decryption materials already contains a plaintext data key." ) ;
9090 }
9191
9292 for (EncryptedDataKey encryptedDataKey : encryptedDataKeys ) {
You can’t perform that action at this time.
0 commit comments