Skip to contentSkip to conversation

tpm2_createak fails. Error code: 0x184. Reboot doesn't help!

tpm2 Chenxi Z 2 participants 6 messages Jul 3, 2020 – Jul 8, 2020

lore
Share & tools
lore

Chenxi Z

author
#0 lore raw

Hi,

Could anyone help me take a look at this issue?
I am not able to create an AIK. Even if I reboot the host, still getting the same issue.

[root(a)myhost ~/tpm]# tpm2_getcap handles-persistent
- 0x81010001

[root(a)myhost ~/tpm/]# tpm2_createak -C 0x81010001 -c ak.ctx -u ak.pub -r ak.priv -n ak.name -P <PWD> loaded-key:
name: 000b8881c45aa9b9f217976deb7ede8154c5859f3461685115221668803eecf2f7e6
WARNING:esys:src/tss2-esys/api/Esys_ContextSave.c:247:Esys_ContextSave_Finish() Received TPM Error ERROR:esys:src/tss2-esys/api/Esys_ContextSave.c:92:Esys_ContextSave() Esys Finish ErrorCode (0x00000184)
ERROR: Esys_ContextSave(0x184) - tpm:handle(1):value is out of range or is not correct for the context
ERROR: Error saving tpm context for handle
ERROR: Unable to run tpm2_createak

TPM tools version that I am using:
tpm2-tools-4.1.1 [link (https://github.com/tpm2-software/tpm2-tools/releases/tag/4.1.1)]
tpm2-abrmd-2.3.1 [link (https://github.com/tpm2-software/tpm2-abrmd/releases/tag/2.3.1)]
tpm2-tss-2.3.2 [link (https://github.com/tpm2-software/tpm2-tss/releases/tag/2.3.2)]

Thanks,
Chenxi

#1 lore raw

What do you have at 0x81010001? Can you show the output of tpm2_readpublic -c 0x81010001?

author
#2 lore raw

thanks Imran for looking into it. Below is the output. Does the information help?

[root(a)myhost ~]# tpm2_readpublic -c 0x81010001
name: 000bc11d18cdceffa5af9080820ae0d2998fda7041a1378edf72aa9236efef63f4e8 qualified name: 000b75134daa3d3ce6ab75530a78735376f72277dc0babe7f2d3fc89be03e2e5ca18 name-alg:
value: sha256

  raw: 0xb
attributes:
  value: fixedtpm|fixedparent|sensitivedataorigin|adminwithpolicy|restricted|decrypt
  raw: 0x300b2
type:
  value: rsa
  raw: 0x1

exponent: 0x0
bits: 2048
scheme:
value: null

  raw: 0x10
scheme-halg:
  value: (null)
  raw: 0x0
sym-alg:
  value: aes
  raw: 0x6
sym-mode:
  value: cfb
  raw: 0x43

sym-keybits: 128
rsa: 803d <I omit some contents here ... ... > 69aa
authorization policy: 837197674484b3f81a90cc8d46a5d724fd52d76e06520b64f2a1da1b331469aa

#3 lore raw

@Chenxi,

I am unable to replicate this issue.

1. Are you facing this problem on a simulator or a TPM chip?
2. If it is on a TPM chip and you cannot afford to clear the TPM, can you flush the persistent handle and start all over?
3. Can you try the same set of commands on an instance of the simulator and reproduce the problem?

Thanks and Regards,

Imran Desai

author
#4 lore raw

Thanks Imran for the suggestions.
1. I am facing the problem on a TPM chip.
2. could you guide me what the exact commands are that I can run to clear the tpm and flush persistent handle?
Should I use the command below? is it enough to clear it and flush persistent handle?
tpm2_clear <TPM2_PWD>
3. I believe it works on simulator. We have multiple hosts (tpm chips), not all have the issue. only a few have the issue. I am not sure if it is hardware issue or software issue.

Thanks,
Chenxi

#5 lore raw

Simply R\unning ```tpm2_clear``` should suffice and it should both clear the TPM and also flush the persistent handles