Branch: refs/heads/master
Home:
https://github.com/01org/tpm2-tools
Commit: c13c7df88db73f67e4417eaacc3478ea0269c179
https://github.com/01org/tpm2-tools/commit/c13c7df88db73f67e4417eaacc3478...
Author: Javier Martinez Canillas <javierm(a)redhat.com>
Date: 2017-09-28 (Thu, 28 Sep 2017)
Changed paths:
M lib/tpm2_alg_util.c
M test/system/test_tpm2_create.sh
M test/system/test_tpm2_encryptdecrypt.sh
M test/system/test_tpm2_hmac.sh
M test/system/test_tpm2_pcrextend.sh
M test/system/yaml_get.py
M test/unit/test_tpm2_alg_util.c
Log Message:
-----------
tpm2_alg_util: remove duplicated SHA-1 entry in algorithms table and tests
The specification makes it clear that both TPM_ALG_SHA and TPM_ALG_SHA1
refer to the SHA-1 algorithm, but the algorithms table has entries for
both even when they have the same hexadecimal value (0x0004).
That means that TPM_ALG_SHA1 will never be matched, since a match will
happen with TPM_ALG_SHA before. So all tools are currently printing a
"sha" string when a "sha1" should be printed instead:
$ tpm2_dump_capability -c algorithms | grep sha
TPMA_ALGORITHM for ALG_ID: 0x4 - sha
TPMA_ALGORITHM for ALG_ID: 0xb - sha256
After this patch:
$ tpm2_dump_capability -c algorithms | grep sha
TPMA_ALGORITHM for ALG_ID: 0x4 - sha1
TPMA_ALGORITHM for ALG_ID: 0xb - sha256
Signed-off-by: Javier Martinez Canillas <javierm(a)redhat.com>