Linux trusted keys gain TPM-backed signing without exposing private keys
Jarkko Sakkinen's TPM 2.0 work lets keyctl sign and decrypt with RSA and ECC keys whose private halves never leave the chip.
Linux is set to let privileged processes sign and decrypt with asymmetric keys whose private material never appears in kernel memory or on disk, provided a TPM 2.0 is present. Jarkko Sakkinen posted a sixth revision of work that teaches the kernel's trusted-key type to load ASN.1 TPMKey blobs and to answer keyctl public-key operations itself.
Trusted keys have long sealed symmetric secrets to a TPM, a TEE, or a CAAM. The new path covers RSA at 2048, 3072, and 4096 bits and NIST P-256, P-384, and P-521. A setup process loads the wrapped blob into a keyring and grants signing or decryption through the existing KEYCTL_PKEY interface. Callers do not need /dev/tpm0, the resource manager device, or a userspace PKCS#11 stack. Private-key operations on the bus use HMAC authorization and parameter encryption.
Sakkinen wrote that this lets a UEFI Secure Boot Machine Owner Key keep its X.509 certificate in MokList while the private key is wrapped as a TPM-loadable blob and removed from disk. Network daemons such as iwd can authenticate with TPM-bound client keys the same way.
Child keys may sit under a persistent primary storage key, or under a permanent hierarchy handle such as the owner, platform, or null hierarchy. For those hierarchy parents the kernel creates a transient NIST P-256 primary from the TCG template, uses it, and flushes it. External tools that seal short non-empty payloads are also accepted; the old 32-byte minimum remains only for legacy blobs.
Earlier drafts put this under the asymmetric key type as its own subtype. The current design instead hangs optional query, sign, verify, and encrypt or decrypt callbacks on trusted keys, reusing backend selection and authorization, and deliberately does not turn on software private-key operations. James Prestwood is credited as co-developer of the TPM backend. Symmetric consumers, including dm-crypt, encrypted keys, and the kernel crypto socket interface, reject the new zero-length payloads so they cannot be mistaken for raw key material.