From 1207eec953660fc4b3d8e70ffcd6e2e49391bf97 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 12 Jun 2019 16:04:05 -0400 Subject: [PATCH] tpm2: Replace MAX_SM4_KEY_BITS and MAX_CAMELLIA_KEY_BITS with 128 Rev 155 code defines MAX_SM4_KEY_BITS = 0 and MAX_CAMELLIA_KEY_BITS = 0 since both algorithms are not enabled. To be able to read old state we now replace the usage of the #defines with hard coded values that have no further meaning. If we ever activate the algoritms, we have to extend the state. Signed-off-by: Stefan Berger --- src/tpm2/NVMarshal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index ec94ebfa..671de4c1 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -3514,8 +3514,8 @@ static const struct _entry { { COMPILE_CONSTANT(MAX_RSA_KEY_BITS, EQ) }, { COMPILE_CONSTANT(MAX_TDES_KEY_BITS, EQ) }, { COMPILE_CONSTANT(MAX_AES_KEY_BITS, EQ) }, - { COMPILE_CONSTANT(MAX_SM4_KEY_BITS, EQ) }, - { COMPILE_CONSTANT(MAX_CAMELLIA_KEY_BITS, EQ) }, + { COMPILE_CONSTANT(128, EQ) }, /* MAX_SM4_KEY_BITS in older code was 128 also with SM4 not active */ + { COMPILE_CONSTANT(128, EQ) }, /* MAX_CAMELLIA_KEY_BITS in older code was 128 also with CAMELLIA not active */ { COMPILE_CONSTANT(ECC_NIST_P192, LE) }, { COMPILE_CONSTANT(ECC_NIST_P224, LE) }, { COMPILE_CONSTANT(ECC_NIST_P256, LE) },