return TPM_SUCCESS;
}
+static uint32_t tpm12_buffersize = TPM_BUFFER_MAX;
+
uint32_t TPM12_SetBufferSize(uint32_t wanted_size,
uint32_t *min_size,
uint32_t *max_size)
{
- /* TPM 1.2 has a fixed buffer size; the TIS can handle that */
+ if (wanted_size == 0)
+ return tpm12_buffersize;
+
if (min_size)
- *min_size = TPM_BUFFER_MAX;
+ *min_size = TPM_BUFFER_MIN;
if (max_size)
*max_size = TPM_BUFFER_MAX;
- return TPM_BUFFER_MAX;
+
+ if (wanted_size > TPM_BUFFER_MAX)
+ wanted_size = TPM_BUFFER_MAX;
+ else if (wanted_size < TPM_BUFFER_MIN)
+ wanted_size = TPM_BUFFER_MIN;
+
+ tpm12_buffersize = wanted_size;
+
+ return tpm12_buffersize;
+}
+
+uint32_t TPM12_GetBufferSize(void)
+{
+ return TPM12_SetBufferSize(0, NULL, NULL);
}
const struct tpm_interface TPM12Interface = {