Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Check err output for tamper errors #220

Merged
merged 4 commits into from
Nov 5, 2024
Merged
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
3 changes: 3 additions & 0 deletions xtest/test_tdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def test_tdf_with_unbound_policy(encrypt_sdk, decrypt_sdk, pt_file, tmp_dir):
assert False, "decrypt succeeded unexpectedly"
except subprocess.CalledProcessError as exc:
assert b"wrap" in exc.output
assert b"tamper" in exc.output or b"InvalidFileError" in exc.output


def test_tdf_with_altered_root_sig(encrypt_sdk, decrypt_sdk, pt_file, tmp_dir):
Expand All @@ -135,6 +136,7 @@ def test_tdf_with_altered_root_sig(encrypt_sdk, decrypt_sdk, pt_file, tmp_dir):
assert False, "decrypt succeeded unexpectedly"
except subprocess.CalledProcessError as exc:
assert b"root" in exc.output
assert b"tamper" in exc.output or b"IntegrityError" in exc.output


def test_tdf_with_altered_seg_sig(encrypt_sdk, decrypt_sdk, pt_file, tmp_dir):
Expand All @@ -148,6 +150,7 @@ def test_tdf_with_altered_seg_sig(encrypt_sdk, decrypt_sdk, pt_file, tmp_dir):
assert False, "decrypt succeeded unexpectedly"
except subprocess.CalledProcessError as exc:
assert b"signature" in exc.output
assert b"tamper" in exc.output or b"IntegrityError" in exc.output


def test_tdf_assertions(encrypt_sdk, decrypt_sdk, pt_file, tmp_dir):
Expand Down