tpm: use u32 instead of int for PCR index
authorTomas Winkler <tomas.winkler@intel.com>
Fri, 19 Oct 2018 18:23:07 +0000 (21:23 +0300)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 13 Nov 2018 11:46:31 +0000 (13:46 +0200)
commit95adc6b410b7aa895dcf5ed9cb7dc4a20a3d5c5a
tree0062d5eafaa2653c41a74382f6f77cb8f4f54334
parentc82e59541a226504a3fe45eb4efca70836548da6
tpm: use u32 instead of int for PCR index

The TPM specs defines PCR index as a positive number, and there is
no reason to use a signed number. It is also a possible security
issue as currently no functions check for a negative index,
which may become a large number when converted to u32.

Adjust the API to use u32 instead of int in all PCR related
functions.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm-sysfs.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm1-cmd.c
drivers/char/tpm/tpm2-cmd.c
include/linux/tpm.h
security/integrity/ima/ima_crypto.c