华硕笔记本开启 Secure Boot 报 “Invalid Signature Detected“ 完整排障与修复
华硕笔记本开启 Secure Boot 报 “Invalid Signature Detected” 完整排障与修复
设备:ASUS ROG Zephyrus M16 (GU604VZ) | BIOS v314 | Windows 11
现象:BIOS 开启 Secure Boot → 开机红屏Invalid signature detected. Check Secure Boot Policy in Setup
结果:已修复,Secure Boot 正常启用
一、问题背景
某天进入华硕 BIOS 开启 Secure Boot 后,开机直接红屏报错:
Secure Boot Violation Invalid signature detected. Check Secure Boot Policy in Setup关闭 Secure Boot 能正常进系统,但某些场景(如玩 Valorant、开 WSL2、BitLocker)强制要求 Secure Boot 开启。BIOS 里Restore Factory Keys也试了,无效。
二、排障过程
2.1 第一步:诊断环境
以管理员身份挂载 EFI 系统分区(ESP),列出所有引导文件:
mountvol S: /s dir S:\EFI\ /s关键发现:
EFI\Boot\OpenCore.efi ← 黑苹果引导器! EFI\Boot\.contentFlavour ← OpenCore 标记文件 EFI\OCHW\OpenCore.efi ← OpenCore 配置 EFI\OCHW\config.plist EFI\Boot\bootx64.efi ← 被 OpenCore 替换过的默认引导 EFI\Microsoft\Boot\bootmgfw.efi根因 #1:EFI 分区残留了 OpenCore(黑苹果)引导文件,这些文件没有微软数字签名,Secure Boot 验签直接拒绝。
2.2 第二步:清理 OpenCore + 重建引导
删除所有 OpenCore 文件,并用 bcdboot 重建微软签名引导:
mountvol S: /s del S:\EFI\Boot\OpenCore.efi del S:\EFI\Boot\.contentFlavour rmdir /s /q S:\EFI\OCHW bcdboot C:\Windows /s S: /f UEFI mountvol S: /d重启进 BIOS → Key Management →Reset To Setup Mode→Restore Factory Keys→ 开 Secure Boot → F10。
结果:仍然红屏。说明问题不止 OpenCore。
2.3 第三步:深入分析证书签名
用 PowerShell 检查引导文件的嵌入式签名:
$cert=[System.Security.Cryptography.X509Certificates.X509Certificate]::CreateFromSignedFile('S:\EFI\Boot\bootx64.efi')$cert2=[System.Security.Cryptography.X509Certificates.X509Certificate2]::new($cert)$cert2|Select-ObjectSubject,Issuer,NotAfter输出:
Subject: CN=Microsoft Windows, O=Microsoft Corporation Issuer : CN=Windows UEFI CA 2023 ← 2023 年新证书! NotAfter: 03/04/2027根因 #2:微软从 2023 年起用新 CA 签发引导文件,取代 2011 年的旧证书。但华硕出厂固件密钥库 (db) 只预装了Windows UEFI CA 2011,不信任 2023 签名。Restore Factory Keys 只是恢复出厂旧密钥,不会凭空变出新证书。
Windows 侧检查也确认了这一点:
WindowsUEFICA2023Capable: 0 ← 固件不支持 Windows 推送 2023 证书 UEFICA2023Status: InProgress ← 卡在半路 Secure-Boot-Update 计划任务: 不存在意味着所有 Windows 侧的修复方法全部走不通。
2.4 第四步:用 SecureBootRecovery.efi 在启动阶段刷固件
这是微软官方提供的最后一招——C:\Windows\Boot\EFI\SecureBootRecovery.efi在开机时独立运行,直接向固件 db 写入 2023 证书,绕过 Windows 的限制。
操作方式:通过 PE U 盘,将 ESP 上的bootmgfw.efi临时替换为SecureBootRecovery.efi:
Phase 1 (PE 里跑): ESP\EFI\Microsoft\Boot\bootmgfw.efi → 备份为 .bak 复制 SecureBootRecovery.efi → 覆盖 bootmgfw.efi → 重启,固件加载恢复工具 → 写入 2023 证书 → 10s 后自动重启 → 进 BIOS 开 Secure Boot → F10 → 引导文件验签通过 ✅ Phase 2 (PE 里再跑一次): 检测到 .bak 备份 → 还原原始 bootmgfw.efi bcdboot 加固引导 → 重启正常进入 Windows ✅自动化脚本fix_sb_pe.bat的源码贴在文末。
三、完整修复流程(TL;DR)
| 步骤 | 操作 | 预期结果 |
|---|---|---|
| ① | 管理员 CMD:mountvol S: /s+bcdboot C:\Windows /s S: /f UEFI | 确保引导文件干净 |
| ② | 删除 ESP 上的残留第三方引导文件(OpenCore/rEFInd/GRUB 等) | 避免非微软签名文件干扰 |
| ③ | 进 PE,跑 Phase 1 脚本 → 重启 → 等 10 秒自动恢复 | 固件 db 获得 2023 证书 |
| ④ | 进 BIOS → Security → Secure Boot → Enabled → F10 | Secure Boot 正常启用 |
| ⑤ | 如果无法进系统,再进 PE 跑 Phase 2 → 还原引导文件 | 正常进 Windows |
四、核心知识点
4.1 Secure Boot 信任链
PK (Platform Key,OEM 根密钥) ↓ 签名 KEK (Key Exchange Key,Microsoft + OEM) ↓ 签名 db (允许列表) / dbx (吊销列表) ↓ 匹配 EFI 引导文件签名验证流程:先查 dbx → 再查 db → 都不匹配则拒绝
4.2 微软证书迁移
- 2011 年:
Microsoft Windows Production PCA 2011签发引导文件 - 2023 年起:
Windows UEFI CA 2023签发,2011 证书逐步退役 - 过渡期:老旧固件可能只认识旧证书 → 新签名的引导文件被拒绝 =Invalid Signature
4.3 为什么 Restore Factory Keys 不管用
Restore Factory Keys 恢复的是华硕出厂打包的密钥集(包含旧 2011 证书)。如果你的 BIOS 版本早于 2023 年某版本,出厂密钥里根本没有新证书——恢复一百遍也不会有。
五、自动化脚本 fix_sb_pe.bat
@echo off title Secure Boot 2023 Certificate Recovery Tool :: Step 1: Find Windows partition set WIN= for %%d in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( if exist "%%d:\Windows\System32\config\SYSTEM" ( set WIN=%%d goto :got_win ) ) echo ERROR: Windows partition not found! && pause && exit /b 1 :got_win set RECOVERY=%WIN%:\Windows\Boot\EFI\SecureBootRecovery.efi :: Step 2: Mount EFI System Partition set ESP= for %%d in (S T U V W X Y Z) do ( if not exist "%%d:\" (set ESP=%%d && goto :got_esp_letter) ) echo ERROR: No free drive letter! && pause && exit /b 1 :got_esp_letter set FOUND=0 for /l %%d in (0,1,9) do ( for /l %%p in (1,1,15) do ( >%temp%\m.txt ( echo select disk %%d echo select partition %%p echo assign letter=%ESP% ) diskpart /s %temp%\m.txt >nul 2>&1 if exist "%ESP%:\EFI" if not exist "%ESP%:\Windows" ( set FOUND=1 && goto :esp_done ) >%temp%\r.txt (echo select volume %ESP% && echo remove) diskpart /s %temp%\r.txt >nul 2>&1 ) ) :esp_done if "%FOUND%"=="0" (echo ERROR: ESP not found! && pause && exit /b 1) :: Step 3: Phase 1 (deploy) or Phase 2 (restore) if exist "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi.bak" goto :restore :: --- PHASE 1: Deploy recovery tool --- copy /y "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi" "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi.bak" >nul copy /y "%RECOVERY%" "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi" >nul >%temp%\r.txt (echo select volume %ESP% && echo remove) diskpart /s %temp%\r.txt >nul 2>&1 echo PHASE 1 COMPLETE. Remove PE USB, reboot. echo You will see "Microsoft Secure Boot Recovery" - wait 10s for auto-reboot. echo After reboot, enter BIOS - enable Secure Boot - F10. echo If stuck on recovery screen, boot PE again and re-run this script. pause && exit /b 0 :: --- PHASE 2: Restore original bootmgfw.efi --- :restore copy /y "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi.bak" "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi" >nul del "%ESP%:\EFI\Microsoft\Boot\bootmgfw.efi.bak" 2>nul if exist "%WIN%:\Windows\System32\bcdboot.exe" ( "%WIN%:\Windows\System32\bcdboot.exe" "%WIN%:\Windows" /s %ESP%: /f UEFI ) >%temp%\r.txt (echo select volume %ESP% && echo remove) diskpart /s %temp%\r.txt >nul 2>&1 echo PHASE 2 COMPLETE. Reboot - enter BIOS - enable Secure Boot. echo System should boot normally now. pause && exit /b 0六、总结
华硕笔记本(尤其是 ROG 系列)在 2024-2025 年出厂固件中可能尚未包含微软 2023 年的新 UEFI 签名证书。当 Windows 11 的引导文件升级为新签名后,开启 Secure Boot 就会报 Invalid Signature。
解决思路一句话:用 SecureBootRecovery.efi 在启动阶段把 2023 证书写进固件 db,然后再还原因引导文件。这是目前绕过 Windows 侧WindowsUEFICA2023Capable=0限制的唯一方法。
建议华硕/AMD 电竞本用户关注 ASUS 官网的 BIOS 更新,新版本固件应该会直接内置 2023 证书,届时更新后直接 Restore Factory Keys 即可。
