mirror of
https://github.com/stefanberger/libtpms
synced 2025-12-30 18:31:53 +00:00
tpm2: Disable curves whose keysize is too small and than can be disabled
When ecc-min-size is given use it to disable all curves whose keysize is too small and that can be disabled. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
37c5b7d546
commit
ea68ece7a7
@ -440,6 +440,11 @@ RuntimeAlgorithmSetProfile(struct RuntimeAlgorithm *RuntimeAlgorithm,
|
||||
retVal = TPM_RC_VALUE;
|
||||
goto exit;
|
||||
}
|
||||
/* disable curves that can be disabled and not meet min. keysize */
|
||||
if (RuntimeAlgorithm->algosMinimumKeySizes[TPM_ALG_ECC] >
|
||||
s_EccAlgorithmProperties[curveId].keySize &&
|
||||
s_EccAlgorithmProperties[curveId].canBeDisabled)
|
||||
CLEAR_BIT(curveId, RuntimeAlgorithm->enabledEccCurves);
|
||||
}
|
||||
|
||||
/* some consistency checks */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user