|
@@ -27,6 +27,7 @@ from package_review_compact_contract import ( # noqa: E402
|
|
|
DEFAULT_REVIEW_COMPACT_INCLUDE_GIT_BUNDLE,
|
|
DEFAULT_REVIEW_COMPACT_INCLUDE_GIT_BUNDLE,
|
|
|
REVIEW_COMPACT_PROFILE,
|
|
REVIEW_COMPACT_PROFILE,
|
|
|
adversarial_fixture_relatives,
|
|
adversarial_fixture_relatives,
|
|
|
|
|
+ adversarial_private_key_bytes,
|
|
|
assert_no_full_git_bundle,
|
|
assert_no_full_git_bundle,
|
|
|
handoff_profiles,
|
|
handoff_profiles,
|
|
|
intended_review_compact_exclusion_reason,
|
|
intended_review_compact_exclusion_reason,
|
|
@@ -295,7 +296,7 @@ class TipFailClosedAdversarialTests(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_private_key_pem_content_fails_closed(self) -> None:
|
|
def test_private_key_pem_content_fails_closed(self) -> None:
|
|
|
handoff = load_handoff()
|
|
handoff = load_handoff()
|
|
|
- marker = b"-----BEGIN PRIVATE KEY-----\nsecret\n-----END PRIVATE KEY-----\n"
|
|
|
|
|
|
|
+ marker = adversarial_private_key_bytes()
|
|
|
with self.assertRaises(handoff.PackagingError):
|
|
with self.assertRaises(handoff.PackagingError):
|
|
|
handoff.scan_secret_markers(marker, b"", "docs/leaked.pem")
|
|
handoff.scan_secret_markers(marker, b"", "docs/leaked.pem")
|
|
|
|
|
|
|
@@ -353,7 +354,7 @@ class TipFailClosedAdversarialTests(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_nested_archive_secret_fails_closed_on_audit(self) -> None:
|
|
def test_nested_archive_secret_fails_closed_on_audit(self) -> None:
|
|
|
handoff = load_handoff()
|
|
handoff = load_handoff()
|
|
|
- marker = b"-----BEGIN PRIVATE KEY-----\nsecret\n-----END PRIVATE KEY-----\n"
|
|
|
|
|
|
|
+ marker = adversarial_private_key_bytes()
|
|
|
with tempfile.TemporaryDirectory() as tmp:
|
|
with tempfile.TemporaryDirectory() as tmp:
|
|
|
source = Path(tmp) / "source"
|
|
source = Path(tmp) / "source"
|
|
|
buf_path = source / "docs" / "nested-secret.bin"
|
|
buf_path = source / "docs" / "nested-secret.bin"
|