コード例 #1
0
ファイル: tpm.c プロジェクト: GregHerendi/grub
grub_err_t
grub_tpm_execute (PassThroughToTPM_InputParamBlock *inbuf,
		  PassThroughToTPM_OutputParamBlock *outbuf)
{
  grub_efi_handle_t tpm_handle;
  grub_uint8_t protocol_version;

  /* Absence of a TPM isn't a failure. */
  if (!grub_tpm_handle_find (&tpm_handle, &protocol_version))
    return 0;

  if (protocol_version == 1)
    return grub_tpm1_execute (tpm_handle, inbuf, outbuf);
  else
    return grub_tpm2_execute (tpm_handle, inbuf, outbuf);
}
コード例 #2
0
ファイル: tpm.c プロジェクト: JohnChancfz/grub
grub_err_t
grub_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf,
		 PassThroughToTPM_OutputParamBlock *outbuf)
{
  grub_efi_handle_t tpm_handle;
   grub_uint8_t protocol_version;

  /* It's not a hard failure for there to be no TPM */
  if (!grub_tpm_handle_find(&tpm_handle, &protocol_version))
    return 0;

  if (protocol_version == 1) {
    return grub_tpm1_execute(tpm_handle, inbuf, outbuf);
  } else {
    return grub_tpm2_execute(tpm_handle, inbuf, outbuf);
  }
}