From: Johannes W. <joh...@ia...> - 2015-06-11 19:27:39
|
Hi Raja, Am 11.06.2015 um 20:22 schrieb Raja: [...] > Hi Johannes, > > Thanks again. I don't need the p/Invoke stuffs. I already have my own > DLL that does that, > > I converted jTSS java code to C#. I wrote my own DLL for > tbs_submit_command, because code for jTssTddlVista.dll is not > public. With the C#-convert code and my own DLL, I can query TPM > version, capabilities, PCR values etc.. and they all work. For some > reason NVDefineSpace is the only call that fails. The return code I > get is 1 on one machine and 34 (0x22) on another machine. This error > code is not listed as any TPM related error code. [...] Where _exactly_ do these return codes (0x1, 0x22) come from? I assume that the Tbsip_Submit_Command call in your own native DLL returns TBS_SUCCESS (0), right? To me the two return codes look like the raw TPM result codes from the TPM's response blob. In that case they would be TPM_AUTHFAIL and TPM_INVALID_AUTHHANDLE. Assuming that your authoriztion handles and command blobs are correct, both error codes may be hints that something with marshalling of your blobs between C# and your native DLL could be wrong. Did you already try to run any other TPM commands, like TPM_OwnerReadInternalPub, which require owner authorization? [...] > The reason I am after jTssTddlVista code is I want to see what it is > doing that I am not. [...] Apart from JNI related marshalling/unmarshalling the jTssTddlVista code is functionally equivalent to the tpmTransmit function from the "doTSS" project ([2]) mentioned earlier in this thread. [...] > Is it possible certain TPM commands must be run under SYSTEM account? > I run my code as an admin but that does not help. I wonder if my code > should be run under SYSTEM context (from a service). [...] Based on our earlier discussion[1] related to jtt.sh I highly doubt that running in a SYSTEM context would help. Best, Johannes [1] http://sourceforge.net/p/trustedjava/mailman/trustedjava-support/?viewmonth=201503 [2] https://github.com/deveck/doTSS/blob/master/tpm_lib/tpm_lowlvl/backends/win32/TPMBaseServices.cs#L86 -- Johannes Winter, IAIK - Graz University of Technology __ Inffeldgasse 16a, 8010 Graz, Austria __ _| |_ Phone: +43 316 873 5578 | || | Fax: +43 316 873 5520 |_ _||__| http://www.iaik.tugraz.at/ |__| IAIK |