]> git.ipfire.org Git - thirdparty/systemd.git/commit
tpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm...
authorDan Streetman <ddstreet@ieee.org>
Fri, 21 Jul 2023 15:23:22 +0000 (11:23 -0400)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 21 Jul 2023 22:10:03 +0000 (23:10 +0100)
commit63477a71dfa39f0cb43854cb28df6606733063ef
treed16735ccf200d73837a89cb7dc6b9bcd2ef5b9da
parent73d6f2015543a1d0c5f0fd5e959a694f9773754d
tpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm spec

To keep compatibility with any existing object authValues with trailing 0's,
change tpm2_get_pin_auth() to trim trailing 0's, which is what the TPM
implementation will do. This should retain compatibility with any existing
authValues that contain trailing 0's.

Note that any existing authValues with trailing 0's are unlikely to have worked
in the way that systemd uses them in object sealing, which is as a bind key for
the encryption (and policy) session. However, it is better to be compatible
with the TPM spec (and implementations) even if previously created objects that
are affected may not have worked.

Fixes: #28414
src/shared/tpm2-util.c