mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-12 14:22:06 +00:00
rev148: Check for blockSize==0 to make static analyzer happy
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
01544ab239
commit
a3f3d346e8
@ -127,8 +127,9 @@ EncryptDecryptShared(
|
||||
keySize = symKey->publicArea.parameters.symDetail.sym.keyBits.sym;
|
||||
alg = symKey->publicArea.parameters.symDetail.sym.algorithm;
|
||||
blockSize = CryptGetSymmetricBlockSize(alg, keySize);
|
||||
if (blockSize == 0)
|
||||
return TPM_RC_FAILURE;
|
||||
// reverify the algorithm. This is mainly to keep static analysis tools happy
|
||||
if(blockSize == 0)
|
||||
return TPM_RCS_KEY + RC_EncryptDecrypt_keyHandle;
|
||||
// Note: When an algorithm is not supported by a TPM, the TPM_ALG_xxx for that
|
||||
// algorithm is not defined. However, it is assumed that the ALG_xxx_VALUE for
|
||||
// the algorithm is always defined. Both have the same numeric value.
|
||||
|
||||
@ -117,6 +117,9 @@ TPM2_EncryptDecrypt(
|
||||
keySize = symKey->publicArea.parameters.symDetail.sym.keyBits.sym;
|
||||
alg = symKey->publicArea.parameters.symDetail.sym.algorithm;
|
||||
blockSize = CryptGetSymmetricBlockSize(alg, keySize);
|
||||
// reverify the algorithm. This is mainly to keep static analysis tools happy
|
||||
if(blockSize == 0)
|
||||
return TPM_RCS_KEY + RC_EncryptDecrypt_keyHandle;
|
||||
// Note: When an algorithm is not supported by a TPM, the TPM_ALG_xxx for that
|
||||
// algorithm is not defined. However, it is assumed that the ALG_xxx_VALUE for
|
||||
// the algorithm is always defined. Both have the same numeric value.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user