@@ -324,7 +324,9 @@ def test_encrypt_ciphertext_message(frame_length, algorithm, encryption_context)
324
324
(WrappingAlgorithm .RSA_OAEP_SHA1_MGF1 , EncryptionKeyType .PUBLIC , EncryptionKeyType .PRIVATE ),
325
325
),
326
326
)
327
- def test_encryption_cycle_raw_mkp (wrapping_algorithm , encryption_key_type , decryption_key_type ):
327
+ def test_encryption_cycle_raw_mkp (caplog , wrapping_algorithm , encryption_key_type , decryption_key_type ):
328
+ caplog .set_level (logging .DEBUG )
329
+
328
330
encrypting_key_provider = build_fake_raw_key_provider (wrapping_algorithm , encryption_key_type )
329
331
decrypting_key_provider = build_fake_raw_key_provider (wrapping_algorithm , decryption_key_type )
330
332
ciphertext , _ = aws_encryption_sdk .encrypt (
@@ -334,7 +336,10 @@ def test_encryption_cycle_raw_mkp(wrapping_algorithm, encryption_key_type, decry
334
336
frame_length = 0 ,
335
337
)
336
338
plaintext , _ = aws_encryption_sdk .decrypt (source = ciphertext , key_provider = decrypting_key_provider )
339
+
337
340
assert plaintext == VALUES ["plaintext_128" ]
341
+ for member in encrypting_key_provider ._members :
342
+ assert repr (member .config .wrapping_key ._wrapping_key )[2 :- 1 ] not in caplog .text
338
343
339
344
340
345
@pytest .mark .skipif (
@@ -687,6 +692,9 @@ def _prep_plaintext_and_logs(log_catcher, plaintext_length):
687
692
def _look_in_logs (log_catcher , plaintext ):
688
693
# Verify that no plaintext chunks are in the logs
689
694
logs = log_catcher .text
695
+ # look for all fake KMS data keys
696
+ for keysize , args in VALUES ["data_keys" ].items ():
697
+ assert repr (args ["plaintext" ])[2 :- 1 ] not in logs
690
698
# look for every possible 32-byte chunk
691
699
start = 0
692
700
end = 32
0 commit comments