mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
@@ -156,6 +156,7 @@ export const readMachoImage = (bytes: Buffer): BinaryContainer => {
|
||||
[0x01000007, "amd64"],
|
||||
[12, "arm"],
|
||||
[0x0100000c, "arm64"],
|
||||
[0x0200000c, "arm64_32"],
|
||||
[18, "ppc"],
|
||||
[0x01000012, "ppc64"],
|
||||
]);
|
||||
|
||||
@@ -119,6 +119,39 @@ cliTest("returns null metadata when .dep-v0 is absent", async ({ cli }) => {
|
||||
);
|
||||
});
|
||||
|
||||
cliTest(
|
||||
"keeps arm64_32 in Rust CLI Evidence when dependency metadata is absent",
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-rust-arm64-32-");
|
||||
const path = join(root, "watchos-object");
|
||||
const bytes = createRustImage({
|
||||
format: "macho",
|
||||
omitSection: true,
|
||||
includeRustc: false,
|
||||
});
|
||||
bytes.writeUInt32LE(0x0200000c, 4);
|
||||
await writeFile(path, bytes);
|
||||
|
||||
const result = await cli.run({
|
||||
arguments: ["inspect-rust-binary", path, "--json"],
|
||||
});
|
||||
|
||||
expect(result.exitCode, result.stderr).toBe(0);
|
||||
const evidence = toolContract("inspect_rust_binary").outputSchema.parse(
|
||||
result.json,
|
||||
);
|
||||
expect(evidence.subject).toMatchObject({
|
||||
format: "mach-o",
|
||||
architecture: "arm64_32",
|
||||
});
|
||||
expect(rustBinarySchema.parse(evidence.normalized_result)).toMatchObject({
|
||||
architecture: "arm64_32",
|
||||
bits: 64,
|
||||
auditable_metadata: null,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
cliTest(
|
||||
"preserves an unknown cargo-auditable revision and reports its fallback",
|
||||
async ({ cli }) => {
|
||||
|
||||
@@ -70,6 +70,23 @@ it("reads a Mach-O __DATA,.dep-v0 section", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves the arm64_32 Mach-O CPU family when dependency metadata is absent", () => {
|
||||
const bytes = createRustImage({
|
||||
format: "macho",
|
||||
omitSection: true,
|
||||
includeRustc: false,
|
||||
});
|
||||
bytes.writeUInt32LE(0x0200000c, 4);
|
||||
|
||||
expect(readRustBinaryImage(bytes)).toMatchObject({
|
||||
format: "macho",
|
||||
architecture: "arm64_32",
|
||||
bits: 64,
|
||||
auditable_metadata: null,
|
||||
rustc_commit: null,
|
||||
});
|
||||
});
|
||||
|
||||
it("ignores PE file-alignment padding after the dependency content", () => {
|
||||
const bytes = createRustImage({ format: "pe", includeRustc: false });
|
||||
const payloadBytes = rustDependencyPayload().length;
|
||||
|
||||
Reference in New Issue
Block a user