Re: [PATCH v6 1/7] tpm: dynamically allocate the allocated_banks array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/4/2018 6:18 PM, Jarkko Sakkinen wrote:

+		for (j = 0; j < pcr_selection.size_of_select; j++)
+			if (pcr_selection.pcr_select[j])
+				break;
+
+		if (j < pcr_selection.size_of_select) {
+			chip->allocated_banks[nr_alloc_banks] = hash_alg;
+			nr_alloc_banks++;
+		}
+

Why was this needed? Can CAP_PCRS return completely unallocated banks?


Yes. E.g., here's a TPM with 4 hash algorithms and two banks with allocated PCRs.

> getcapability -cap 5
4 PCR selections
    hash TPM_ALG_SHA1
    TPMS_PCR_SELECTION length 3
    ff ff ff
    hash TPM_ALG_SHA256
    TPMS_PCR_SELECTION length 3
    ff ff ff
    hash TPM_ALG_SHA384
    TPMS_PCR_SELECTION length 3
    00 00 00
    hash TPM_ALG_SHA512
    TPMS_PCR_SELECTION length 3
    00 00 00




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux