feat(llvm): 加固 SD 签名与内购交易关键分支

This commit is contained in:
shenlei
2026-11-24 16:37:52 +09:00
parent 704ee66834
commit 47a7acc741
5 changed files with 38 additions and 3 deletions
+7 -1
View File
@@ -375,6 +375,12 @@ def audit_ipa(
raise ValueError(f'IPA 静态卫生门禁失败: {failed_keys}')
policy = _load_policy(policy_path)
required_ibr_sources = policy.get('required_indirect_branch_sources') or ()
if archive_path and required_ibr_sources and not skip_macho_gates:
if not Path(archive_path).is_dir():
raise ValueError(f'核心间接分支门禁缺少 xcarchive: {archive_path}')
if not audit_json_path or not Path(audit_json_path).is_file():
raise ValueError('核心间接分支门禁缺少本次构建的 LLVM 审计日志')
obf_audit = None
if audit_json_path and Path(audit_json_path).is_file():
obf_audit = json.loads(Path(audit_json_path).read_text(encoding='utf-8'))
@@ -415,7 +421,7 @@ def audit_ipa(
raise ValueError('StarCFGGate verified_star_count 为 0')
ibr_gate = verify_macho_indirect_branches.verify_binary_indirect_branches(
main_bin, dwarf_bin, obf_audit
main_bin, dwarf_bin, obf_audit, required_sources=required_ibr_sources
)
report['indirect_branch_gate'] = ibr_gate
if policy.get('indirect_branch_targets') and ibr_gate['verified_ibr_count'] <= 0: