mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
* refactor(native): bind producer_limits and max_input_bytes as the per-call controls of pwntools and Apple dispatch refusals producerLimitControl in src/domain/producerResourceLimits.ts names one producer budget as producer_limits.<field>; the shared provider outcome classifier now carries a resource signal's limit. Pwntools file-size, CPU and output refusals and the Apple dispatch input refusal bind their control, and their remediation no longer names CLI flags. * fix(native): report the selected output allowance as the omitted file_bytes default * fix(native): bind producer_limits.diagnostic_bytes as the pwntools command output-limit control * refactor(rust): bind producer_limits as the per-call control of Rust input and report refusals (#11458) * refactor(rust): bind producer_limits as the per-call control of Rust input and report refusals * test(rust): cover the complete-report refusal's producer_limits control * refactor(browser): bind caller-selectable browser deadlines as per-call controls instead of naming CLI flags (#11466) * refactor(rust): bind producer_limits as the per-call control of Rust input and report refusals * test(rust): cover the complete-report refusal's producer_limits control * refactor(browser): bind caller-selectable browser deadlines as per-call controls instead of naming CLI flags deadlineParameterLimit in src/domain/analysisResourceLimits.ts owns the millisecond deadline control that nativeDeadlineRecovery and the browser recoveries share. CDP command and discovery, web bundle per-script and total, network capture and source-map decode deadlines now carry it; browserDeadlineIncrease no longer takes CLI flag text. * fix(browser): record a per-script deadline's parameter control in partial web bundle results * refactor(providers): bind Wabt, SQLite, EVMole, Apktool and Go controls instead of naming CLI commands (#11472) * refactor(providers): bind Wabt, SQLite, EVMole and Apktool deadline and byte controls instead of naming CLI commands These remediation strings named rea commands and flags through template text the cli-option guard did not count. Wabt byte refusals and output limits bind max_input_bytes, max_tool_bytes or max_output_bytes while a larger value is selectable; SQLite worker_timeout_ms, EVMole timeout_ms and Apktool decode_timeout_ms bind through deadlineParameterLimit; the shared provider outcome classifier now carries an output limit's control. * refactor(go): bind Go analysis budgets as per-call controls instead of naming CLI flags * fix(providers): keep the typed primary when Wabt, EVMole or pwntools command cleanup fails * ci(guards): count template-built CLI option and command text outside the CLI layer (#11478) * refactor(providers): bind Wabt, SQLite, EVMole and Apktool deadline and byte controls instead of naming CLI commands These remediation strings named rea commands and flags through template text the cli-option guard did not count. Wabt byte refusals and output limits bind max_input_bytes, max_tool_bytes or max_output_bytes while a larger value is selectable; SQLite worker_timeout_ms, EVMole timeout_ms and Apktool decode_timeout_ms bind through deadlineParameterLimit; the shared provider outcome classifier now carries an output limit's control. * refactor(go): bind Go analysis budgets as per-call controls instead of naming CLI flags * fix(providers): keep the typed primary when Wabt, EVMole or pwntools command cleanup fails * ci(guards): count template-built CLI option and command text outside the CLI layer The cli-option-text-outside-cli pattern now also matches "(CLI ...", "on the CLI", "or use rea ..." and backticked `rea <command>` references, so remediation built from a template such as --${name} or rea inspect-... <path> is counted. Doctor.ts is exempt: setup and doctor run only through the CLI. The baseline records the newly counted pre-existing sites (22 -> 45 across 21 files). * ci(guards): extract the CLI text matcher, exempt host-only commands with written reasons, and test each spelling * ci(guards): exempt a host-only command and its own arguments in any matched CLI phrase * fix(native): bind producer_limits.output_bytes for oversized pwndbg debugger replies through one owner * fix(cli): name an Evidence target source failure's control by the source option that sets it * feat(cli): render the flags of result-recorded controls in the full-output envelope (#11507) * feat(cli): render the flags of result-recorded controls in the full-output envelope * fix(cli): collect result controls only for a full-output envelope, in its requested format, past undefined values * ci(guards): end a host-only command's arguments before the next CLI command * refactor(reverse): record the output budget that stopped a one-shot command as a parameter control (#11528) * fix(cli): read result controls only at positions the output schema declares as recorded controls * refactor(providers): record the controls that bounded Rust compiler paths and kernel module text instead of naming CLI options (#11532) * refactor(rust): record the control that bounded compiler-path coverage instead of naming CLI options * refactor(native): record the controls that omitted kernel module .modinfo text instead of naming CLI options (#11534) * fix(rust): describe compiler coverage from the retained result after report trimming * refactor(providers): record managed representation and JavaScript semantic ceiling controls instead of naming CLI options (#11537) * refactor(managed): record the representation budget on a resource-limit issue instead of naming its CLI option * refactor(javascript): record the semantic retention ceilings that stopped a graph instead of naming CLI options (#11540) * fix(cli): name a composed command's source options for the controls its result records * fix(cli): read result controls from the delivered Evidence when a summary wraps it * fix(rust): keep the report-byte control recorded when trimming omits every compiler path When the complete-report allowance left room for no compiler path, rustc_commit became null and its coverage.limit was lost, so --full-output could not name the option that raises the allowance. The report now records rustc_commit_omission { reason, limit } outside the dropped record, and the summary view carries it. * refactor(flutter): record the string-pool budgets that left a projection partial instead of naming the CLI option (#11541) * refactor(flutter): record the string-pool budgets that left a projection partial instead of naming the CLI option * test(flutter): assert the complete set of recorded string-pool budgets * feat(cli): name the options of controls a failure's partial Evidence records (#11557) meta.cli_controls was collected only from a successful result. A failure whose partial observation is Evidence of the command's own operation is now read the same way, at the positions the output schema declares as recorded controls; Evidence of another operation or a retained reference is not read. When --evidence_output publishes the partial, the delivery records it before replacing it. * refactor(javascript): record the evaluator budgets that limited sources instead of naming the CLI option (#11564) Per-value unknown reasons and the Electron wrapper limitation named --semantic-precision. The static examination now records the semantic_precision controls that limited a source (examination.controls), and analyze_javascript_application's semantic_graph.coverage.controls records every evaluator budget that limited any source (examination and semantic IR coverage), beside the retention ceilings. The CLI renders --semantic-precision from those records in meta.cli_controls; the reason texts name only the contract field.
445 lines
14 KiB
TypeScript
445 lines
14 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import { fat } from "../../../src/domain/binaryTarget.fixture.js";
|
|
import {
|
|
createRustImage,
|
|
createRustImageWithGoSection,
|
|
createRustHashOverflowImage,
|
|
compressRustElfSectionNames,
|
|
rustElfSectionNameFixture,
|
|
RUSTC_HASH,
|
|
rustDependencyPayload,
|
|
} from "../../fixtures/rust/image.js";
|
|
import { readRustBinaryImage } from "../../../src/rust/RustBinaryImage.js";
|
|
import { readBinaryContainer } from "../../../src/domain/native/readBinaryContainer.js";
|
|
import { readGoBinaryImage } from "../../../src/go/GoBinaryImage.js";
|
|
import { ParseFailureError } from "../../../src/domain/parseFailure.js";
|
|
|
|
const packages = [
|
|
{
|
|
name: "itoa",
|
|
version: "1.0.18",
|
|
source: "crates.io",
|
|
kind: null,
|
|
dependencies: [],
|
|
features: null,
|
|
root: false,
|
|
},
|
|
{
|
|
name: "sample",
|
|
version: "0.1.0",
|
|
source: "local",
|
|
kind: null,
|
|
dependencies: [0],
|
|
features: null,
|
|
root: true,
|
|
},
|
|
];
|
|
|
|
it.each([
|
|
["named", ".rodata"],
|
|
["empty", ""],
|
|
["unavailable", null],
|
|
] as const)(
|
|
"retains read-only ELF section bytes with a %s name",
|
|
(name, expectedName) => {
|
|
const bytes = rustElfSectionNameFixture(name);
|
|
const container = readBinaryContainer(bytes);
|
|
expect(container.load_regions?.every(({ write }) => write)).toBe(true);
|
|
expect(container.sections).toContainEqual(
|
|
expect.objectContaining({
|
|
format: "elf",
|
|
name: expectedName,
|
|
offset: 2048,
|
|
read_only: true,
|
|
file_backed: true,
|
|
}),
|
|
);
|
|
expect(readRustBinaryImage(bytes).rustc_commit?.hashes).toEqual([
|
|
{ hash: RUSTC_HASH, file_offset: 2048 },
|
|
]);
|
|
},
|
|
);
|
|
|
|
it.each([
|
|
["writable", 1, 3n],
|
|
["executable", 1, 6n],
|
|
["unallocated", 1, 0n],
|
|
["NOBITS", 8, 2n],
|
|
["NULL", 0, 2n],
|
|
] as const)(
|
|
"does not scan unnamed ELF %s sections for compiler paths",
|
|
(_kind, type, flags) => {
|
|
const bytes = rustElfSectionNameFixture("empty");
|
|
bytes.writeUInt32LE(type, 384 + 4);
|
|
bytes.writeBigUInt64LE(flags, 384 + 8);
|
|
expect(readBinaryContainer(bytes).sections).not.toContainEqual(
|
|
expect.objectContaining({ offset: 2048, read_only: true }),
|
|
);
|
|
expect(readRustBinaryImage(bytes).rustc_commit).toBeNull();
|
|
},
|
|
);
|
|
|
|
it("does not scan an unnamed ELF section whose declared range leaves the file", () => {
|
|
const bytes = rustElfSectionNameFixture("empty");
|
|
// The compiler path still exists at 2048, but its declared section no longer fits.
|
|
bytes.writeBigUInt64LE(BigInt(bytes.length), 384 + 32);
|
|
expect(readBinaryContainer(bytes).sections).not.toContainEqual(
|
|
expect.objectContaining({ read_only: true }),
|
|
);
|
|
expect(readRustBinaryImage(bytes).rustc_commit).toBeNull();
|
|
});
|
|
|
|
it.each(["elf", "pe"] as const)(
|
|
"reads a .dep-v0 section and an inferred rustc hash from %s",
|
|
(format) => {
|
|
const image = readRustBinaryImage(createRustImage({ format }));
|
|
expect(image.format).toBe(format);
|
|
expect(image.auditable_metadata).toMatchObject({
|
|
section_name: ".dep-v0",
|
|
file_offset: 1024,
|
|
section_bytes: rustDependencyPayload().length,
|
|
format_version: 1,
|
|
root_package_index: 1,
|
|
packages,
|
|
dependency_edges: [{ from_index: 1, to_index: 0 }],
|
|
});
|
|
expect(image.rustc_commit).toEqual({
|
|
evidence_kind: "inferred",
|
|
hashes: [{ hash: RUSTC_HASH, file_offset: 2048 }],
|
|
});
|
|
},
|
|
);
|
|
|
|
it.each([
|
|
["\\", [{ hash: RUSTC_HASH, file_offset: 2048 }]],
|
|
["-", undefined],
|
|
] as const)(
|
|
"reads a rustc hash followed by %s only when it is a path separator",
|
|
(separator, hashes) => {
|
|
// Windows builds store /rustc/<hash>\library\...; the fixture path is at 2048.
|
|
const bytes = createRustImage({ format: "pe" });
|
|
bytes.write(
|
|
separator,
|
|
2048 + "/rustc/".length + RUSTC_HASH.length,
|
|
"latin1",
|
|
);
|
|
expect(readRustBinaryImage(bytes).rustc_commit?.hashes).toEqual(hashes);
|
|
},
|
|
);
|
|
|
|
it("reads a Mach-O __DATA,.dep-v0 section", () => {
|
|
const image = readRustBinaryImage(createRustImage({ format: "macho" }));
|
|
expect(image).toMatchObject({
|
|
format: "macho",
|
|
architecture: "arm64",
|
|
auditable_metadata: {
|
|
section_name: "__DATA,.dep-v0",
|
|
file_offset: 1024,
|
|
root_package_index: 1,
|
|
packages,
|
|
},
|
|
rustc_commit: {
|
|
evidence_kind: "inferred",
|
|
hashes: [{ hash: RUSTC_HASH, file_offset: 2048 }],
|
|
},
|
|
});
|
|
});
|
|
|
|
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("uses the shared ELF classifier for Rust image architecture", () => {
|
|
const bytes = createRustImage({
|
|
format: "elf",
|
|
omitSection: true,
|
|
includeRustc: true,
|
|
});
|
|
bytes.writeUInt16LE(164, 18); // ELF EM_HEXAGON.
|
|
expect(readRustBinaryImage(bytes)).toMatchObject({
|
|
format: "elf",
|
|
architecture: "hexagon",
|
|
auditable_metadata: null,
|
|
});
|
|
});
|
|
|
|
it("ignores PE file-alignment padding after the dependency content", () => {
|
|
const bytes = createRustImage({ format: "pe", includeRustc: false });
|
|
const payloadBytes = rustDependencyPayload().length;
|
|
const entry = 264;
|
|
expect(bytes.readUInt32LE(entry + 8)).toBe(payloadBytes);
|
|
bytes.writeUInt32LE(512, entry + 16);
|
|
const image = readRustBinaryImage(bytes);
|
|
expect(image.auditable_metadata).toMatchObject({
|
|
section_name: ".dep-v0",
|
|
section_bytes: payloadBytes,
|
|
packages,
|
|
});
|
|
});
|
|
|
|
it("recognizes zero-virtual-size PE raw padding without accepting payload junk", () => {
|
|
const payloadBytes = rustDependencyPayload().length;
|
|
const entry = 264;
|
|
const bytes = createRustImage({ format: "pe", includeRustc: false });
|
|
bytes.writeUInt32LE(0, entry + 8);
|
|
bytes.writeUInt32LE(512, entry + 16);
|
|
bytes.writeUInt32LE(512, 188); // Optional-header FileAlignment.
|
|
expect(readRustBinaryImage(bytes).auditable_metadata).toMatchObject({
|
|
section_bytes: 512,
|
|
compressed_bytes: payloadBytes,
|
|
packages,
|
|
});
|
|
|
|
const payloadOffset = bytes.readUInt32LE(entry + 20);
|
|
const nonzeroSuffix = Buffer.from(bytes);
|
|
nonzeroSuffix[payloadOffset + payloadBytes] = 1;
|
|
expect(() => readRustBinaryImage(nonzeroSuffix)).toThrow(
|
|
/bytes after the zlib stream/u,
|
|
);
|
|
|
|
const truncated = Buffer.from(bytes);
|
|
truncated[payloadOffset + payloadBytes - 1] =
|
|
truncated[payloadOffset + payloadBytes - 1]! ^ 0xff;
|
|
expect(() => readRustBinaryImage(truncated)).toThrow(/complete zlib stream/u);
|
|
|
|
const nonzeroVirtualSize = Buffer.from(bytes);
|
|
nonzeroVirtualSize.writeUInt32LE(payloadBytes + 1, entry + 8);
|
|
expect(() => readRustBinaryImage(nonzeroVirtualSize)).toThrow(
|
|
/bytes after the zlib stream/u,
|
|
);
|
|
|
|
const unknownAlignment = Buffer.from(bytes);
|
|
unknownAlignment.writeUInt32LE(0, 188);
|
|
expect(() => readRustBinaryImage(unknownAlignment)).toThrow(
|
|
/bytes after the zlib stream/u,
|
|
);
|
|
});
|
|
|
|
it("returns null metadata when the dependency section is absent", () => {
|
|
const image = readRustBinaryImage(
|
|
createRustImage({ format: "elf", omitSection: true }),
|
|
);
|
|
expect(image.auditable_metadata).toBeNull();
|
|
expect(image.rustc_commit?.hashes).toEqual([
|
|
{ hash: RUSTC_HASH, file_offset: 2048 },
|
|
]);
|
|
});
|
|
|
|
it.each([1, 2])(
|
|
"reads dependency metadata through ELF section-name compression %i",
|
|
(compressionType) => {
|
|
const image = readRustBinaryImage(
|
|
compressRustElfSectionNames(
|
|
createRustImage({ format: "elf" }),
|
|
compressionType,
|
|
),
|
|
);
|
|
expect(image.auditable_metadata).toMatchObject({
|
|
section_name: ".dep-v0",
|
|
file_offset: 1024,
|
|
packages,
|
|
dependency_edges: [{ from_index: 1, to_index: 0 }],
|
|
});
|
|
},
|
|
);
|
|
|
|
it("keeps dependency presence unknown for unsupported ELF name compression", () => {
|
|
const image = readRustBinaryImage(
|
|
compressRustElfSectionNames(createRustImage({ format: "elf" }), 3),
|
|
);
|
|
expect(image.auditable_metadata).toBeNull();
|
|
expect(image.section_names_limitation).toMatch(
|
|
/compression type 3 is unsupported/u,
|
|
);
|
|
expect(image.rustc_commit?.hashes).toEqual([
|
|
{ hash: RUSTC_HASH, file_offset: 2048 },
|
|
]);
|
|
});
|
|
|
|
it("keeps dependency presence unknown when its ELF name offset is unreadable", () => {
|
|
const bytes = createRustImage({ format: "elf" });
|
|
bytes.writeUInt32LE(0xffff, 384);
|
|
|
|
const image = readRustBinaryImage(bytes);
|
|
expect(image.auditable_metadata).toBeNull();
|
|
expect(image.section_names_limitation).toMatch(/outside its string table/u);
|
|
expect(image.rustc_commit?.hashes).toEqual([
|
|
{ hash: RUSTC_HASH, file_offset: 2048 },
|
|
]);
|
|
});
|
|
|
|
it("finds rustc paths in read-only ELF load data without section headers", () => {
|
|
const bytes = createRustImage({
|
|
format: "elf",
|
|
omitSection: true,
|
|
includeRustc: true,
|
|
});
|
|
bytes.writeBigUInt64LE(0n, 40);
|
|
bytes.writeUInt16LE(0, 60);
|
|
bytes.writeUInt16LE(0, 62);
|
|
bytes.writeUInt32LE(4, 132); // PF_R, no write or execute permission.
|
|
|
|
expect(readRustBinaryImage(bytes)).toMatchObject({
|
|
auditable_metadata: null,
|
|
rustc_commit: {
|
|
evidence_kind: "inferred",
|
|
hashes: [{ hash: RUSTC_HASH, file_offset: 2048 }],
|
|
},
|
|
});
|
|
|
|
bytes.writeUInt32LE(6, 132); // PF_R | PF_W is not read-only data.
|
|
expect(readRustBinaryImage(bytes).rustc_commit).toBeNull();
|
|
});
|
|
|
|
it("refuses a universal Mach-O container", () => {
|
|
expect(() => readRustBinaryImage(fat([0x0100000c]))).toThrow(
|
|
ParseFailureError,
|
|
);
|
|
expect(() => readRustBinaryImage(fat([0x0100000c]))).toThrow(/thin slice/);
|
|
});
|
|
|
|
it("keeps the container's truncated failure and its facts unchanged", () => {
|
|
const bytes = createRustImage({ format: "elf" });
|
|
// The fixture's first program header is at byte 128; p_filesz and
|
|
// p_memsz are at +32 and +40.
|
|
bytes.writeBigUInt64LE(BigInt(bytes.length) * 2n, 128 + 32);
|
|
bytes.writeBigUInt64LE(BigInt(bytes.length) * 2n, 128 + 40);
|
|
const thrown = (read: () => unknown): unknown => {
|
|
try {
|
|
read();
|
|
} catch (cause: unknown) {
|
|
return cause;
|
|
}
|
|
throw new Error("expected a container failure");
|
|
};
|
|
const container = thrown(() => readBinaryContainer(bytes));
|
|
const rust = thrown(() => readRustBinaryImage(bytes));
|
|
expect(rust).toBeInstanceOf(ParseFailureError);
|
|
expect((rust as ParseFailureError).failure).toEqual(
|
|
(container as ParseFailureError).failure,
|
|
);
|
|
expect((rust as ParseFailureError).failure).toMatchObject({
|
|
kind: "truncated",
|
|
format: "elf",
|
|
offset: expect.any(Number),
|
|
field: expect.any(String),
|
|
});
|
|
});
|
|
|
|
it("does not read SHT_NOBITS dependency sections as stored bytes", () => {
|
|
const bytes = createRustImage({ format: "elf" });
|
|
// The fixture writes the .dep-v0 section header at byte 384.
|
|
bytes.writeUInt32LE(8, 384 + 4);
|
|
let metadata: unknown;
|
|
try {
|
|
metadata = readRustBinaryImage(bytes).auditable_metadata;
|
|
} catch (cause: unknown) {
|
|
expect(cause).toBeInstanceOf(ParseFailureError);
|
|
return;
|
|
}
|
|
expect(metadata).toBeNull();
|
|
});
|
|
|
|
it("reads a rustc path from a read-only ELF section whose name exceeds 64 bytes", () => {
|
|
const bytes = createRustImage({ format: "elf", omitSection: true });
|
|
// omitSection places the rustc section header at 384 and shstrtab at 320.
|
|
const nameOffset = bytes.readUInt32LE(384);
|
|
const tableOffset = Number(bytes.readBigUInt64LE(320 + 24));
|
|
const longName = Buffer.concat([Buffer.alloc(65, 0x61), Buffer.from([0])]);
|
|
longName.copy(bytes, tableOffset + nameOffset);
|
|
bytes.writeBigUInt64LE(BigInt(nameOffset + longName.length), 320 + 32);
|
|
const image = readRustBinaryImage(bytes);
|
|
expect(image.auditable_metadata).toBeNull();
|
|
expect(image.rustc_commit).toEqual({
|
|
evidence_kind: "inferred",
|
|
hashes: [{ hash: RUSTC_HASH, file_offset: 2048 }],
|
|
});
|
|
});
|
|
|
|
it("retains dependency facts when compiler paths exceed the selected prefix", () => {
|
|
const bytes = createRustHashOverflowImage();
|
|
const partial = readRustBinaryImage(bytes);
|
|
expect(partial.auditable_metadata?.packages.map(({ name }) => name)).toEqual([
|
|
"itoa",
|
|
"sample",
|
|
]);
|
|
expect(partial.rustc_commit?.hashes).toHaveLength(64);
|
|
expect(partial.rustc_commit?.coverage).toEqual({
|
|
status: "partial",
|
|
reason: "max_rustc_hashes",
|
|
effective_limit: 64,
|
|
limit: {
|
|
control_kind: "parameter",
|
|
parameter: "max_rustc_hashes",
|
|
effective_value: 64,
|
|
unit: "count",
|
|
minimum: 1,
|
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
default_value: 64,
|
|
applies_at: "next_call",
|
|
},
|
|
});
|
|
const recovered = readRustBinaryImage(bytes, 65);
|
|
expect(recovered.rustc_commit?.hashes).toHaveLength(65);
|
|
expect(recovered.rustc_commit).not.toHaveProperty("coverage");
|
|
expect(recovered.auditable_metadata).toEqual(partial.auditable_metadata);
|
|
});
|
|
|
|
it.each([
|
|
["elf", "compressed"],
|
|
["elf", "unmapped"],
|
|
["elf", "zero-fill"],
|
|
["elf", "duplicate"],
|
|
["elf", "out-of-file"],
|
|
["elf", "zero-address"],
|
|
["macho", "unmapped"],
|
|
["macho", "zero-fill"],
|
|
["macho", "duplicate"],
|
|
["macho", "out-of-file"],
|
|
] as const)(
|
|
"retains Rust evidence beside an unrelated %s %s Go section",
|
|
(format, fault) => {
|
|
const bytes = createRustImageWithGoSection(format, fault);
|
|
const control = Buffer.from(bytes);
|
|
const sectionOffset = format === "elf" ? 768 + 11 : 408;
|
|
const sectionName = Buffer.from(
|
|
(format === "elf" ? ".other\0" : "__other\0").padEnd(
|
|
format === "elf" ? 13 : 16,
|
|
"\0",
|
|
),
|
|
"ascii",
|
|
);
|
|
if (format === "elf") {
|
|
const nameOffset = Number(bytes.readBigUInt64LE(320 + 32));
|
|
sectionName.copy(control, 768 + nameOffset);
|
|
} else {
|
|
sectionName.copy(control, sectionOffset);
|
|
}
|
|
expect(readBinaryContainer(bytes).load_regions).toEqual(
|
|
readBinaryContainer(control).load_regions,
|
|
);
|
|
expect(() => readGoBinaryImage(bytes)).toThrow(/build-info|mapped/i);
|
|
expect(readRustBinaryImage(bytes)).toMatchObject({
|
|
format,
|
|
auditable_metadata: { file_offset: 1024, packages },
|
|
rustc_commit: {
|
|
evidence_kind: "inferred",
|
|
hashes: [{ hash: RUSTC_HASH, file_offset: 2048 }],
|
|
},
|
|
});
|
|
},
|
|
);
|