refactor(native): own signing policy and bind capture target versions

This commit is contained in:
morluto
2026-10-08 18:14:58 +08:00
parent c202ee9479
commit f1f2aa3d86
8 changed files with 635 additions and 416 deletions
+8 -1
View File
@@ -252,13 +252,19 @@ export const unconfirmedNestedCode = async (
): Promise<string[]> => {
const missing: string[] = [];
const ambiguous: string[] = [];
const denied: string[] = [];
for (const validatedPath of verification.validated_nested_code) {
try {
await lstat(validatedPath);
} catch (cause: unknown) {
const code = errorCode(cause);
// A denied lookup cannot confirm the path, but is no sign of a split one.
if (code === "EACCES" || code === "EPERM") continue;
if (code === "EACCES" || code === "EPERM") {
denied.push(
`Could not confirm completeness of codesign nested path ${JSON.stringify(validatedPath)}: permission denied (${code}); the reported path may be a fragment.`,
);
continue;
}
if (code !== "ENOENT" && code !== "ENOTDIR") throw cause;
missing.push(validatedPath);
continue;
@@ -268,6 +274,7 @@ export const unconfirmedNestedCode = async (
}
}
return [
...denied,
...missing.map(
(path) =>
`codesign reported validated nested code at ${JSON.stringify(path)}, which does not exist; a nested path probably contains a newline, so validated_nested_code and diagnostics hold fragments of it.`,