Skip to content

fwTPM: TPM_CAP_TPM_PROPERTIES leaves out fixed properties, including TPM_PT_CONTEXT_SYM_SIZE #651

Open

Description

@AlexLaroche

TPM2_GetCapability(TPM_CAP_TPM_PROPERTIES, TPM_PT_FIXED, ...) returns 19 fixed properties. It leaves out, among others:

  • TPM_PT_VENDOR_TPM_TYPE (0x10a);
  • TPM_PT_HR_TRANSIENT_MIN, TPM_PT_HR_PERSISTENT_MIN, TPM_PT_HR_LOADED_MIN and TPM_PT_ACTIVE_SESSIONS_MAX (0x10e–0x111);
  • TPM_PT_PCR_SELECT_MIN (0x113) and TPM_PT_CONTEXT_GAP_MAX (0x114);
  • TPM_PT_NV_COUNTERS_MAX through TPM_PT_ORDERLY_COUNT (0x116–0x11d), which includes TPM_PT_CONTEXT_SYM and TPM_PT_CONTEXT_SYM_SIZE;
  • TPM_PT_MAX_OBJECT_CONTEXT, TPM_PT_MAX_SESSION_CONTEXT and the TPM_PT_PS_* properties (0x121–0x128).

The TCG reference implementation and libtpms report every fixed property, and clients read them:

  • tpm2-pkcs11 sizes AES keys from TPM_PT_CONTEXT_SYM_SIZE, so without it every AES key generation or import is refused.
  • Clients that index the reply by offset from TPM_PT_FIXED, as tpm2-pkcs11's C_GetTokenInfo did, read the wrong values once one is missing (here, everything after 0x10a moves up by one).
  • Resource managers use TPM_PT_HR_*_MIN and TPM_PT_ACTIVE_SESSIONS_MAX.

Reproduction. Call Esys_GetCapability(TPM2_CAP_TPM_PROPERTIES, TPM2_PT_FIXED, TPM2_MAX_TPM_PROPERTIES) and list the tags:

fwTPM master: 0x100-0x109 0x10b 0x10c 0x10d 0x112 0x11e 0x11f 0x120 0x129 0x12d   (19)
swtpm 0.10.2: 0x100-0x12e, 46 fixed properties, including 0x10a and 0x11c

Suggested fix. Report the remaining fixed properties from the build's limits (FWTPM_MAX_OBJECTS, the session and NV limits, the context-protection algorithm and its key size: AES and 128 or 256 bits). TPM_PT_CONTEXT_SYM_SIZE matters most for clients.

Environment

  • wolfTPM master at d7f73b5 (also seen in v4.2.0), fwTPM built with ./configure --enable-fwtpm-only --enable-swtpm on wolfSSL v5.9.4-stable (--enable-wolftpm --enable-pkcallbacks --enable-keygen).
  • fwtpm_server --port 2341 --platform-port 2342, reached through the tpm2-tss 4.2.0 swtpm TCTI (swtpm:host=127.0.0.1,port=2341).
  • For comparison, the same program against swtpm 0.10.2 (libtpms).
  • Found while running tpm2-pkcs11 on fwTPM.

Activity

  1. dgarske commented on Oct 28, 2026

    @dgarske
    Member

    Hi @AlexLaroche thank you for all the reports. Can you review and try out the fixes in #656 ?
    Thanks, David Garske, wolfSSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions