forked from luck/tmp_suning_uos_patched
selftests/tpm2: Open tpm dev in unbuffered mode
In order to have control over how many bytes are read or written the device needs to be opened in unbuffered mode. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: James Morris <james.morris@microsoft.com>
This commit is contained in:
parent
f1a0ba6ccc
commit
6da70580af
|
@ -358,9 +358,9 @@ class Client:
|
|||
self.flags = flags
|
||||
|
||||
if (self.flags & Client.FLAG_SPACE) == 0:
|
||||
self.tpm = open('/dev/tpm0', 'r+b')
|
||||
self.tpm = open('/dev/tpm0', 'r+b', buffering=0)
|
||||
else:
|
||||
self.tpm = open('/dev/tpmrm0', 'r+b')
|
||||
self.tpm = open('/dev/tpmrm0', 'r+b', buffering=0)
|
||||
|
||||
def close(self):
|
||||
self.tpm.close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user