mirror of
https://github.com/openai/codex.git
synced 2026-09-09 15:58:47 +00:00
Device keys need to prove possession with non-exportable key material on every accepted signing flow. Windows should use the platform TPM-backed key provider instead of a software secret store or keyring-style storage, so the private key stays behind the OS crypto boundary. - Wire the device-key crate's default provider to a Windows-specific implementation on Windows. - Create and open persistent ECDSA P-256 keys with CNG's Microsoft Platform Crypto Provider. - Export the public key as SPKI DER by converting the CNG ECC public blob to SEC1 form. - Sign the accepted payload digest with NCrypt and return DER-encoded ECDSA signatures. - Preserve the hardware TPM protection class and fail create/load/sign when the platform provider or key is unavailable. - cargo test -p codex-device-key - cargo check -p codex-device-key --target x86_64-pc-windows-msvc - just fix -p codex-device-key - git diff --check