Skip to content

Unable to Generate Attestation Document - Response code value: 0x2d5 #7

@kalamoo

Description

@kalamoo

Hi,

I'm unable to generate a Nitro TPM attestation document using nitro-tpm-attest in any configuration I've tried. The attempts result in a TPM error indicating "structure is the wrong size" (error code 0x2d5).

Environment:

  • OS: Amazon Linux 2023 (with kernel: 6.1.155-176.282.amzn2023.x86_64)
  • Instance type: t3.small
  • AMI: NitroTPM-enabled AMI created following this aws tutorial

After launching the instance, I can see the tpm devices.

$ ls /dev | grep tpm
tpm0
tpmrm0

Setting 1: using pre-installed binary in Amazon Linux 2023

  • without sudo (permission denied)
$ /usr/bin/nitro-tpm-attest 
ERROR:tcti:src/tss2-tcti/tcti-device.c:454:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpm0: Permission denied 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:169:tcti_from_file() Could not initialize TCTI file: device 
ERROR:tcti:src/tss2-tcti/tctildr.c:430:Tss2_TctiLdr_Initialize_Ex() Failed to instantiate TCTI 
Error: response code not recognized

Caused by:
    0: response code not recognized
    1: Response code value: 0xa000a
  • with sudo (tpm error, structure size error)
$ sudo /usr/bin/nitro-tpm-attest 
WARNING:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:345:Esys_NV_DefineSpace_Finish() Received TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:121:Esys_NV_DefineSpace() Esys Finish ErrorCode (0x000002d5) 
Error: structure is the wrong size (associated with parameter number 2)

Caused by:
    0: structure is the wrong size (associated with parameter number 2)
    1: Response code value: 0x2d5

Setting 2: using this repository and cargo

$ git clone <this repo>
$ cd NitroTPM-Tools/nitro-tpm-attest
$ cargo build --release
$ sudo ./target/release/nitro-tpm-attest 
WARNING:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:345:Esys_NV_DefineSpace_Finish() Received TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:121:Esys_NV_DefineSpace() Esys Finish ErrorCode (0x000002d5) 
Error: structure is the wrong size (associated with parameter number 2)

Caused by:
    0: structure is the wrong size (associated with parameter number 2)
    1: Response code value: 0x2d5

Note that the same 0x2d5 error occurs when adding options like --public-key, --nonce, or --user-data.

I appreciate any guidance on resolving this issue or clarifying the expected setup.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions