File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -553,6 +553,8 @@ def _prep_message(self):
553553 request = encryption_materials_request
554554 )
555555
556+ validate_commitment_policy_on_encrypt (self .config .commitment_policy , self ._encryption_materials .algorithm )
557+
556558 if self .config .algorithm is not None and self ._encryption_materials .algorithm != self .config .algorithm :
557559 raise ActionNotAllowedError (
558560 (
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ def test_encrypt_with_different_kc_clients_sharing_materials_yield_error():
234234 commitment_policy = CommitmentPolicy .FORBID_ENCRYPT_ALLOW_DECRYPT
235235 )
236236 required_encrypting_client = aws_encryption_sdk .EncryptionSDKClient (
237- commitment_policy = CommitmentPolicy .FORBID_ENCRYPT_ALLOW_DECRYPT
237+ commitment_policy = CommitmentPolicy .REQUIRE_ENCRYPT_REQUIRE_DECRYPT
238238 )
239239
240240 provider = StaticRawMasterKeyProvider (
@@ -250,7 +250,6 @@ def test_encrypt_with_different_kc_clients_sharing_materials_yield_error():
250250 plaintext = b"Yellow Submarine"
251251
252252 ciphertext , _ = forbid_encrypting_client .encrypt (source = plaintext , materials_manager = ccmm )
253- ciphertext2 , _ = required_encrypting_client .encrypt (source = plaintext , materials_manager = ccmm )
254253 with pytest .raises (ActionNotAllowedError ) as excinfo :
255254 required_encrypting_client .encrypt (source = plaintext , materials_manager = ccmm )
256255 excinfo .match ("Configuration conflict. Cannot encrypt due to .* requiring only committed messages" )
You can’t perform that action at this time.
0 commit comments