executor: 移除冗余 Image::from 前置校验,信任链统一由 Machine::create 报告
This commit is contained in:
@@ -259,12 +259,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
bytes.assign(std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>());
|
||||
}
|
||||
// 结构校验(Image::from)+ 型号/SHA-256 校验(Machine::create)
|
||||
const vm::Image img = vm::Image::from(bytes);
|
||||
if (!img.ok()) {
|
||||
std::fprintf(stderr, "error: %s\n", img.error().c_str());
|
||||
return 1;
|
||||
}
|
||||
// 信任链(Machine::create 内统一完成):Image::from 结构校验 → SHA-256 → 型号匹配
|
||||
vm::Machine machine;
|
||||
if (!vm::Machine::create(bytes, &machine, &err)) {
|
||||
std::fprintf(stderr, "error: %s\n", err.c_str());
|
||||
|
||||
Reference in New Issue
Block a user