提交 6da70580 编写于 作者: T Tadeusz Struk 提交者: James Morris

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: NTadeusz Struk <tadeusz.struk@intel.com>
Reviewed-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: NJames Morris <james.morris@microsoft.com>
上级 f1a0ba6c
......@@ -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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册