Skip to content

Commit cd873a0

Browse files
m
1 parent cb56504 commit cd873a0

File tree

1 file changed

+18
-16
lines changed
  • test_vector_handlers/src/awses_test_vectors/manifests/full_message

1 file changed

+18
-16
lines changed

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

+18-16
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)