ssh-tpm-agent: unable to use sealed key (TPM_RC_AUTH_FAIL (session 1): the authorization HMAC check failed and DA counter incremented")

I have not been able to use my sealed key for a few weeks now. I tried to generate a new key with ssh-tpm-keygen, but it does not work either (different error message - something with hmac, not very sure about it). The whole setup worked flawlessly until 4-5 weeks ago. Is there any help in troubleshooting this problem? I have absolutely no idea where to start.

Things I tried:

  • Restart everything
  • restart the agent
  • generate a new key direktly with ssh-tpm-keygen
  • importing my current key again
  • switching the kernel to lts
  • installing latest release from git with the 0c68627 commit latest
  • checking errors with journalctl -k --grep=tpm
  • check if tpm2_pcrread works

After try to use the key the ssh-tpm-agent.service logs level=INFO msg="agent 13: failed getting handle: TPM_RC_INTEGRITY (parameter 1): integrity check failed"

my current working kernel is 6.10.3-arch1-2 (Arch Linux) keytype is ecdsa-sha2-nistp256

Hoping for some input on this =)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 38 (20 by maintainers)

Commits related to this issue

Most upvoted comments

No worries. Thanks for not loosing faith in me 馃槂

Pinentry depends on gnupg so it鈥檚 a bit awkward to have with an ssh-agent. I鈥檒l fix this tomorrow and sorry for the issue 馃槂

I never looked into new dependancies鈥ow it worked but the interface for the pin looks like Windows 95 or earlier 馃槃

Yes, there are some kde versions and stuff. I was contemplating writing some GUI thing for this and bundle it with this agent but havent had time to look at it.

Please make sure you do make and run the binaries from ./bin.

ssh-tpm-agent can be ran with debug mode enabled.

位 ssh-tpm-agent master 蓡 禄 export SSH_AUTH_SOCK="/run/user/$(id -u)/ssh-tpm-agent.sock"
位 ssh-tpm-agent master 蓡 禄 ./bin/ssh-tpm-agent -d

Client

位 ssh-tpm-agent master 蓡 禄 export SSH_AUTH_SOCK="/run/user/$(id -u)/ssh-tpm-agent.sock"
位 ssh-tpm-agent master 蓡 禄 ssh-keygen -t ecdsa -b 256 -f ./testkey
位 ssh-tpm-agent master 蓡 禄 ./bin/ssh-tpm-keygen --import ./testkey
位 ssh-tpm-agent master 蓡 禄 ./bin/ssh-tpm-add ./testkey.tpm

I鈥檒l do a release after fixing the askpass error stuff.

I鈥檝e tried two sets of P256 keys with no password, with a password, and imported them all to my ssh-tpm-agent and sshed to my NAS. I鈥檓 still unable to recreate the error you are seeeing.

位 ssh-tpm-agent master 蓡 禄 ssh-keygen -t ecdsa -b 256 -f ./testkey
位 ssh-tpm-agent master 蓡 禄 ./bin/ssh-tpm-keygen --import ./testkey
位 ssh-tpm-agent master 蓡 禄 ./bin/ssh-tpm-add ./testkey.tpm

Am I missing something?

I鈥檒l be more clear in future announcements if you feel the previous one was unclear 馃槂

--import wraps the ssh key with the TSS keyfile format, so it鈥檚 affected.