Cryptography#
Every cryptographic algorithm shirudo uses, where it uses it, and what accepts other algorithms. OpenSSL 3.5 or newer provides the userspace side, tpm2-tss talks to the TPM, and the kernel verifies loader signatures and config roots. The Threat model gives the threats each use answers.
Signatures#
Object |
What is signed |
Signed by |
Verified by |
|---|---|---|---|
upatch loader, load or unload directive |
The loader’s instructions followed by the data of its frozen metadata map |
|
The kernel at |
Repository index |
The index document |
|
|
Tree publication |
The publication document |
|
|
Config root |
The 64 lowercase hex characters of the dm-verity root hash |
The operator’s image tooling, with the config key |
shirudo against the runtime bootstrap’s config certificates
before it creates the mapping, then the kernel against the
keyrings of assumption A7; |
Vouch |
The bytes |
|
|
All five use one format, produced by one function on the operator:
Algorithm: ML-DSA-87 (FIPS 204). The signing code refuses any other key, the smaller ML-DSA parameter sets included
Container: a detached CMS
SignedDatawith no certificates; the signer is named by its subject key identifier. shirudo’s own checks take the signer only from the certificate they are given, never from one the container carriesWith OpenSSL 3.x: signed attributes with a SHA-512 message digest and no signing time, because OpenSSL 3.x cannot sign ML-DSA without signed attributes and the kernel accepts only SHA-512 for ML-DSA in that form
With OpenSSL 4: no signed attributes; ML-DSA signs the content directly
shirudo genkey creates the ML-DSA-87 key and a self-signed X.509
certificate. shirudo keys vouch, shirudo keys add and the image
tooling for the config certificate refuse a certificate whose key is not
ML-DSA-87.
What accepts other algorithms#
The ML-DSA-87 rule is enforced where shirudo signs, not everywhere it verifies:
Verifier |
Accepts |
|---|---|
Kernel, loader signatures |
Any algorithm the kernel’s X.509 and PKCS#7 code supports for a
certificate in |
Target, Java upatch signatures |
Any algorithm OpenSSL supports for a certificate of the runtime’s
set that |
Target, config roots |
ML-DSA-87 under one of the runtime bootstrap’s config certificates. The target checks this exact set before the kernel’s dm-verity signature check (threat model A7). |
|
Whatever algorithm the repository certificate or active BPF signer holds (threat model U4). |
Vouch check on the target |
Whatever algorithm the vouching certificate holds; the vouched certificate’s algorithm is not checked on the target. |
TLS peers and endorsement key certificates |
Whatever their certificate authorities use (residual risk R9). |
Certificate validity#
No verifier enforces a certificate’s validity period. shirudo’s own
CMS and chain checks for signatures set X509_V_FLAG_NO_CHECK_TIME.
The kernel compares a signature’s signing time with the signer’s
validity only when the signature carries a signing time, and shirudo’s
signatures carry none: every one is made with OpenSSL’s
CMS_NO_SIGNING_TIME. shirudo genkey writes no expiration date;
the certificate’s notAfter is 99991231235959Z, the value RFC 5280
gives a certificate with no well-defined expiration. shirudo status
and shirudo keys show only the date a certificate was issued. Retire
a key by revoking it (residual risks R13 and R16).
Digests#
Use |
Algorithm |
Input |
|---|---|---|
Payload digest of a upatch ( |
SHA-256 |
The signed bytes: loader instructions followed by the map data, or the data alone for a Java upatch |
|
SHA-256 |
The loader’s instructions |
Register events |
SHA-256 |
A domain tag ( |
Register value |
SHA-256 |
The TPM’s NV extend: the old value followed by the event |
Register anchor in PCR 9 |
SHA-256 |
The string |
Config activation events |
SHA-256 |
|
Certificate identity |
SHA-256 |
The certificate’s DER ( |
OCI manifests and blobs |
SHA-256 |
The content, compared with the |
dm-verity images |
SHA-256 |
Hash tree format 1 with 4096-byte data and hash blocks |
CMS signed attributes, OpenSSL 3.x |
SHA-512 |
The signed content |
Seal label |
SHA-256 |
The xattr name; the label is a public constant, not a secret |
TLS#
Every HTTPS connection, to a registry, an image download or a collector, uses the same policy:
TLS 1.3 only.
Key exchange groups
X25519MLKEM768(preferred) andSecP256r1MLKEM768, both hybrid with ML-KEM-768.tls.classical_hostsin the runtime image’s bootstrap settings lists exact host names that may also useX25519andsecp256r1. Each host of a redirect must be listed itself, and shirudo logs a warning when a classical group is negotiated.Cipher suites: OpenSSL’s TLS 1.3 defaults; shirudo does not set them.
The peer certificate is verified against the system’s certificate authorities, or a CA file that
BPM_OCI_CA_FILEor the export settings name.map_export.otel_insecureturns verification off for a collector.
TPM#
Object |
Algorithm |
Use |
|---|---|---|
Attestation key |
ECDSA on NIST P-256 with SHA-256; a restricted signing primary with a fixed template under the endorsement hierarchy |
Signs |
Endorsement key |
The TCG default template, RSA-2048 with the exponent 65537 or ECC P-256, with AES-128 in CFB mode as its symmetric algorithm |
Credential activation for |
Credential |
RSA-OAEP with SHA-256 and the label |
Made in software by |
Endorsement certificate chain |
X.509, verified with OpenSSL against the |
|
NV writer |
RSA-3072, exponent 65537, RSASSA-PKCS1-v1_5 with SHA-256; an owner-hierarchy primary whose unique field is a 32-byte random seed drawn at each boot |
Signs, inside the TPM, the SHA-256 of the session nonce, a zero
expiration, the command hash of the exact |
Measurement register |
NV extend index |
The write policy: |
PCRs |
The SHA-256 bank |
Reads, quotes, the anchor in PCR 9 and the config PCR |
Sessions and authorization:
SHA-256 HMAC and policy sessions are salted with the standard ECC endorsement primary whose name
initfreezes. Successful responses, including NV, PCR and clock readbacks, are authenticated. The HMAC session has the audit attribute to cover commands without an authorization handle.The sessions are unbound and have no symmetric algorithm: parameters are not encrypted. The owner authorization from
tpm.owner_authis used in HMAC authorization, not transmitted as a password. Initial endorsement-primary creation uses the empty endorsement authorization and trusts the initrd’s TPM device.
Key custody#
Key |
Where it lives |
Custody |
|---|---|---|
Signing key |
|
An unencrypted PEM file. The signing code refuses one that is
not a regular file of mode |
Config key |
With the operator |
Signs config roots; its certificate travels in the runtime image
and is enrolled in |
Attestation, endorsement and NV writer keys |
In the TPM |
The private parts never leave the TPM. The primaries are recreated from their templates when needed. The NV writer’s seed is in the identity map and is not secret. |
TPM owner password |
|
Readable by root on the target (residual risk R20). |