Please make sure you are using the correct parameters of HashAll(), e.g.
  HashAll (&tcg, (UINT8 *)&hashIn, hashInLen, sha1, &hashed_len, 
&hashed_content);

For EFI_SUCCESS return value, I guess we may didn't catch the failed result of 
internal memory allocation. Need double-check on this.


Best Regards & Thanks,
LONG, Qin

From: Eric Viseur [mailto:eric.vis...@gmail.com]
Sent: Friday, March 14, 2014 3:20 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Using the TCG protocol

The function returns EFI_SUCCESS (0), which is very strange.  I call it with 
the following code (if I try using a constant integer instead of the file) :

TCG_ALGORITHM_ID        sha1 = 4;
UINT64                  hashed_len = 128; (Tried with various values)
UINT8                   *hashed_content = NULL;
UINT8                   hashIn = 1234;
UINT64                  hashInLen = 4;

HashAll(&tcg, hashIn, hashInLen, sha1, hashed_len, &hashed_content);
My output buffer remains desperately empty.  I'm okay with using only SHA-1 as 
it's only one of the many pieces of the project, as long as I get it working.
I wanted to try this one before switching to HashLogExtendEvent because I'm 
having some trouble with the function description given in the TCG EFI 
specifications, but I can change my course of action if needed.

Regards,

Eric Viseur
Etudiant Ingénieur Civil Electricien
LinkedIn Profile<http://www.linkedin.com/profile/view?id=193442069&trk=tab_pro>

2014-03-14 1:57 GMT+01:00 Dong, Guo 
<guo.d...@intel.com<mailto:guo.d...@intel.com>>:

Viseur,

What's the return status for EFI_TCG_PROTOCOL.HashAll()?
And for this protocol, only the SHA1 algorithm is supported.

BTW, EFI_TCG_PROTOCOL.HashAll() only gets the hashed data, and if you want to 
extend it to TPM PCR and log the event, you can simple use 
EFI_TCG_PROTOCOL.HashLogExtendEvent() function.

Thanks,
Guo
From: Eric Viseur [mailto:eric.vis...@gmail.com<mailto:eric.vis...@gmail.com>]
Sent: Friday, March 14, 2014 12:29 AM
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: [edk2] Using the TCG protocol

Hi all,
I'm currently working on a Linux project involving the use of the TPM.  The 
idea is to somehow reproduce the TPM part of TrustedGrub on UEFI, except it's 
only to boot a fixed kernel.  For various reasons it is done using gnu-efi 
rather than EDKII.  However, I think my question is generic enough for this 
mailing-list.

So, my current idea is to create a small EFI application that will do the 
needed processing, and then load the linux kernel through EFI Stub.  I got the 
"processing then stub" part right, everything works, except for the PCR 
extending.
What I'm currently doing is loading the kernel.efi file contents into a buffer 
using the Open and Read methods of the EFI_FILE_HANDLE handle.  My aim was then 
to send the content of this buffer as an input to the 
EFI.TCG_PROTOCOL.HashALL() function, but I always end up with an empty output 
buffer, even if I simply send a fixed integer instead of the file contents as 
an input buffer.
Is there anyone here that has already used this protocol and can help me, or 
even redirect me to a more appropriate source of information ?

Thanks in advance !
Regards,

Eric Viseur
Etudiant Ingénieur Civil Electricien
LinkedIn Profile<http://www.linkedin.com/profile/view?id=193442069&trk=tab_pro>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to