|
@@ -187,9 +187,18 @@ def assert_no_full_git_bundle(members: list[str], *, testcase) -> None:
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def _adversarial_private_key_bytes() -> bytes:
|
|
|
|
|
+ """Load PEM-like fixture bytes without embedding secret markers in this module.
|
|
|
|
|
+
|
|
|
|
|
+ The payload file basename ``id_ed25519`` is path-excluded from packaging; keeping
|
|
|
|
|
+ the PEM text out of this helper avoids content-scan false positives on the helper.
|
|
|
|
|
+ """
|
|
|
|
|
+ path = ROOT / "tests" / "fixtures" / "package_adversarial" / "payloads" / "id_ed25519"
|
|
|
|
|
+ return path.read_bytes()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def adversarial_fixture_relatives() -> dict[str, bytes]:
|
|
def adversarial_fixture_relatives() -> dict[str, bytes]:
|
|
|
"""Canonical sneaky paths planted into disposable source trees."""
|
|
"""Canonical sneaky paths planted into disposable source trees."""
|
|
|
- private_key = b"-----BEGIN PRIVATE KEY-----\nADVERSARIAL_FIXTURE_NOT_A_REAL_KEY\n-----END PRIVATE KEY-----\n"
|
|
|
|
|
return {
|
|
return {
|
|
|
"reference/original/board/sneaky-main.brd": b"%ADV-BRD-FIXTURE%\n",
|
|
"reference/original/board/sneaky-main.brd": b"%ADV-BRD-FIXTURE%\n",
|
|
|
"reference/original/schematics/sneaky-schematic.pdf": b"%PDF-1.4 ADV-FIXTURE\n",
|
|
"reference/original/schematics/sneaky-schematic.pdf": b"%PDF-1.4 ADV-FIXTURE\n",
|
|
@@ -204,7 +213,7 @@ def adversarial_fixture_relatives() -> dict[str, bytes]:
|
|
|
"anlogic_cd/installer/setup.exe": b"MZADV-INSTALLER",
|
|
"anlogic_cd/installer/setup.exe": b"MZADV-INSTALLER",
|
|
|
"reference/original/local_archives/Anlogic.lic": b"ADV-LICENSE-KEY\n",
|
|
"reference/original/local_archives/Anlogic.lic": b"ADV-LICENSE-KEY\n",
|
|
|
"config/.env": b"SECRET=should-never-pack\n",
|
|
"config/.env": b"SECRET=should-never-pack\n",
|
|
|
- "secrets/id_ed25519": private_key,
|
|
|
|
|
|
|
+ "secrets/id_ed25519": _adversarial_private_key_bytes(),
|
|
|
"node_modules/left-pad/index.js": b"module.exports=function(){}\n",
|
|
"node_modules/left-pad/index.js": b"module.exports=function(){}\n",
|
|
|
".venv/bin/python": b"#!/adversarial-venv\n",
|
|
".venv/bin/python": b"#!/adversarial-venv\n",
|
|
|
"venv/lib/site.py": b"# adversarial venv\n",
|
|
"venv/lib/site.py": b"# adversarial venv\n",
|