- src/vault-core: no_std 密码学核心(HKDF 派生、AES-256-GCM、两条水位线防回滚) - src/ta-vault / src/ca-vault: TA 薄壳与 selftest 客户端 - build/p1_vault_qemu.sh: QEMU 全链,判据 VAULT_ALL_OK - build/p2_ta_keys_qemu.sh: TA 公钥编进 tee.bin,默认密钥签的被拒 - build/gen_ta_keys.sh: 自建签名密钥 - docs/07-VAULT-TA.md: 设计 + 已验证/未验证清单 - CLAUDE.md 雷区 11-16:user_ta_header、嵌套 workspace、ARCH=arm、SIGPIPE、TA_PUBLIC_KEY、heredoc 变量
39 lines
1.2 KiB
Bash
Executable File
39 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# 沙箱内第五段:给 optee 节点补 interrupts(驱动要异步通知中断),重跑 QEMU
|
|
set -x
|
|
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|
cd /root/run || exit 1
|
|
|
|
# 确认 rootfs 里的用户态文件
|
|
ls -la /root/rootfs/usr/lib/libteec* /root/rootfs/usr/bin/tee-supplicant /root/rootfs/usr/bin/hello_ca 2>&1 | head
|
|
|
|
dtc -I dtb -O dts -o virt.dts virt.dtb 2>/dev/null
|
|
head -n -1 virt.dts > v3.dts
|
|
cat >> v3.dts <<'DTB'
|
|
firmware {
|
|
optee {
|
|
compatible = "linaro,optee-tz";
|
|
method = "smc";
|
|
interrupt-parent = <0x8002>;
|
|
interrupts = <0x00 0x09 0x04>;
|
|
};
|
|
};
|
|
};
|
|
DTB
|
|
dtc -I dts -O dtb -o virt-optee2.dtb v3.dts 2>/dev/null
|
|
dtc -I dtb -O dts virt-optee2.dtb 2>/dev/null | grep -A6 "optee {"
|
|
|
|
rm -f nw.log sw.log
|
|
timeout 200 qemu-system-arm -display none -smp 2 -m 1057 \
|
|
-machine virt,secure=on -cpu cortex-a15 \
|
|
-bios qemu_fw.rom -dtb virt-optee2.dtb -nic none \
|
|
-serial file:/root/run/nw.log -serial file:/root/run/sw.log \
|
|
-semihosting-config enable=on,target=native
|
|
echo "QEMU_RC=$?"
|
|
|
|
echo "########## NORMAL ##########"
|
|
sed -n '/MARKER_BOOT_OK/,$p' nw.log 2>/dev/null | head -60
|
|
echo "########## SECURE (tail) ##########"
|
|
tail -15 sw.log 2>/dev/null
|
|
echo "=== STAGE5_DONE ==="
|