diff options
Diffstat (limited to 'tpm/tpm.c')
-rw-r--r-- | tpm/tpm.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -61,6 +61,20 @@ static bool tpm_model_is_registered(enum TpmModel model) return false; } +/* + * Write an error message in the given output buffer. + */ +void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len) +{ + if (out_len >= sizeof(struct tpm_resp_hdr)) { + struct tpm_resp_hdr *resp = (struct tpm_resp_hdr *)out; + + resp->tag = cpu_to_be16(TPM_TAG_RSP_COMMAND); + resp->len = cpu_to_be32(sizeof(struct tpm_resp_hdr)); + resp->errcode = cpu_to_be32(TPM_FAIL); + } +} + const TPMDriverOps *tpm_get_backend_driver(const char *type) { int i; |