Skip to content

Commit

Permalink
measure buffer that is used (chainloader+ntldr) GH #9
Browse files Browse the repository at this point in the history
  • Loading branch information
neusdan committed Jan 2, 2016
1 parent 7690021 commit 847a6b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions grub-core/loader/i386/pc/chainloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)

grub_file_close (file);

/* Begin TCG Extension */
grub_TPM_measure_buffer( bs, GRUB_DISK_SECTOR_SIZE, TPM_LOADED_FILES_PCR );
/* End TCG Extension */

/* Obtain the partition table from the root device. */
drive = grub_get_root_biosnumber ();
dev = grub_device_open (0);
Expand Down Expand Up @@ -241,11 +245,6 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)

grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 1);

/* Begin TCG Extension */
grub_TPM_measure_file( (char*)filename, TPM_LOADED_FILES_PCR );

/* End TCG Extension */

return;

fail:
Expand Down
2 changes: 1 addition & 1 deletion grub-core/loader/i386/pc/ntldr.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ grub_cmd_ntldr (grub_command_t cmd __attribute__ ((unused)),
grub_loader_set (grub_ntldr_boot, grub_ntldr_unload, 1);

/* Begin TCG Extension */
grub_TPM_measure_file( argv[0], TPM_LOADED_FILES_PCR );
grub_TPM_measure_buffer( ntldr, ntldrsize, TPM_LOADED_FILES_PCR );
/* End TCG Extension */

return GRUB_ERR_NONE;
Expand Down

0 comments on commit 847a6b2

Please sign in to comment.