Skip to content

Commit 601d738

Browse files
Merge branch 'mpl-reviewed' into golden-manifest
2 parents d3dec8a + 8383b06 commit 601d738

File tree

2 files changed

+19
-17
lines changed
  • src/aws_encryption_sdk/internal/formatting
  • test_vector_handlers/src/awses_test_vectors/manifests/full_message

2 files changed

+19
-17
lines changed

src/aws_encryption_sdk/internal/formatting/deserialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def deserialize_frame(stream, header, verifier=None):
467467
(content_length,) = unpack_values(">I", stream, verifier)
468468
if content_length > header.frame_length:
469469
raise SerializationError(
470-
"Invalid final frame length: {final} >= {normal}".format(
470+
"Invalid final frame length: {final} > {normal}".format(
471471
final=content_length, normal=header.frame_length
472472
)
473473
)

test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -630,21 +630,11 @@ def from_file(cls, input_file, keyrings):
630630
client_name = raw_manifest["client"]["name"] # type: str
631631
client_version = raw_manifest["client"]["version"] # type: str
632632
raw_scenarios = raw_manifest["tests"] # type: Dict[str, DECRYPT_SCENARIO_SPEC]
633-
test_scenarios = {
634-
name: MessageDecryptionTestScenario.from_scenario(
635-
scenario=scenario,
636-
plaintext_reader=root_reader,
637-
ciphertext_reader=root_reader,
638-
keys=keys,
639-
keyrings=False,
640-
keys_uri=keys_abs_path,
641-
)
642-
for name, scenario in raw_scenarios.items()
643-
}
644-
# If optional keyrings argument is true,
645-
# also add scenarios to decrypt with keyrings.
633+
634+
# If optional keyrings argument is specified,
635+
# decrypt with keyrings
646636
if keyrings:
647-
keyrings_test_scenarios = {
637+
test_scenarios = {
648638
name + "-keyring": MessageDecryptionTestScenario.from_scenario(
649639
scenario=scenario,
650640
plaintext_reader=root_reader,
@@ -655,8 +645,20 @@ def from_file(cls, input_file, keyrings):
655645
)
656646
for name, scenario in raw_scenarios.items()
657647
}
658-
# Merge keyring scenarios into test_scenarios
659-
test_scenarios = {**keyrings_test_scenarios, **test_scenarios}
648+
# If optional keyrings argument is not specified,
649+
# decrypt with master key providers.
650+
else:
651+
test_scenarios = {
652+
name: MessageDecryptionTestScenario.from_scenario(
653+
scenario=scenario,
654+
plaintext_reader=root_reader,
655+
ciphertext_reader=root_reader,
656+
keys=keys,
657+
keyrings=False,
658+
keys_uri=keys_abs_path,
659+
)
660+
for name, scenario in raw_scenarios.items()
661+
}
660662

661663
# Remove any `None` scenarios from test scenarios.
662664
# `None` scenarios indicate the loader determined the scenario is invalid.

0 commit comments

Comments
 (0)