Whenever working with Trusted Platform Modules (TPM) one stumbles over the responses and especially the error codes that are returned by the TPM and the software stack used to talk to the TPM. TPM error codes are not always straight forward, but encode more information, for instance, which parameter caused the error.
To make it easier to look up the TPM error codes, I wrote the TPM Return Code Decoder app. In addition to the error code lookup, the app also provides a library of TPM command descriptions. On the left side menu, the input field icon opens the Return Code Decoder page. When a TPM error code is entered, the description will be filled with the TPM 1.2 and TPM 2.0 description of the error. If the error code is incorrect for either TPM 1.2 or TPM 2.0, the description field will say that it’s not a valid error code.
The search icon in the menu will open the command code lookup page. Here, a short description of the TPM command will show up in the description field.
The numeric command codes between TPM 1.2 and TPM 2.0 do not overlap, so the lookup of command codes produces either a description for the TPM 1.2 command, or the TPM 2.0 command. Alternatively to entering the numerical command code, a user can select a command from the list of commands, which are sorted alphabetically.
For both, error code and command code lookup, the input field will accept either a decimal entry or a hexadecimal entry. The latter has to be preceded by “0x” to indicate the hexadecimal number. For instance the decimal error code 257 would have to be input as “0x101” in hexadecimal.
The command code lookup page takes the description from the published TPM specifications. It does not contain the full text of the specification, but often only the first paragraph for the respective commands. For a full description of the commands, the full specifications should be consulted. They can be obtained at the TCG website:
I hope that this app can help you look up the description for a command or error code for a TPM that you use or write software for.
Source code for the app can be found on GitHub.