Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions xtest/test_tdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,36 @@ def test_tdf_spec_target_422(
assert filecmp.cmp(pt_file, rt_file)


def test_tdf_spec_target_430(
encrypt_sdk: tdfs.SDK,
decrypt_sdk: tdfs.SDK,
pt_file: Path,
in_focus: set[tdfs.SDK],
attribute_default_rsa: Attribute,
encrypted_tdf: EncryptFactory,
):
Comment thread
dmihalcik-virtru marked this conversation as resolved.
if not in_focus & {encrypt_sdk, decrypt_sdk}:
pytest.skip("Not in focus")
if not encrypt_sdk.supports("hexaflexible"):
pytest.skip(
f"Encrypt SDK {encrypt_sdk} doesn't support targeting container format 4.3.0"
)
Comment thread
dmihalcik-virtru marked this conversation as resolved.
if not decrypt_sdk.supports("hexless"):
pytest.skip(
f"Decrypt SDK {decrypt_sdk} doesn't support hexless integrity information in container format 4.3.0"
)
Comment thread
dmihalcik-virtru marked this conversation as resolved.

ct_file = encrypted_tdf(
encrypt_sdk,
target_mode="4.3.0",
attr_values=attribute_default_rsa.value_fqns,
)

rt_file = encrypted_tdf.rt_file(ct_file, decrypt_sdk)
decrypt_sdk.decrypt(ct_file, rt_file, "ztdf")
assert filecmp.cmp(pt_file, rt_file)


def looks_like_422(manifest: tdfs.Manifest):
assert manifest.schemaVersion is None

Expand Down
Loading