summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/tpm2
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@kernel.org>2023-02-03 13:14:30 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-02-13 19:09:46 +0300
commit787fccb321dd6c1c464bb11d952074edbde5de36 (patch)
tree38f1fe57e593c6fd44f355481415ad1f7f4be638 /tools/testing/selftests/tpm2
parent4ebe33398c40c1118b4d8546978036c0e0032d1b (diff)
downloadlinux-787fccb321dd6c1c464bb11d952074edbde5de36.tar.xz
selftests: tpm2: remove redundant ord()
When testing with FLAG_DEBUG enabled client, it emits the following error messages: File "/root/tpm2/tpm2.py", line 347, in hex_dump d = [format(ord(x), '02x') for x in d] File "/root/tpm2/tpm2.py", line 347, in <listcomp> d = [format(ord(x), '02x') for x in d] TypeError: ord() expected string of length 1, but int found The input of hex_dump() should be packed binary data. Remove the ord(). Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/tpm2')
-rw-r--r--tools/testing/selftests/tpm2/tpm2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/tpm2/tpm2.py b/tools/testing/selftests/tpm2/tpm2.py
index c7363c6764fc..bba8cb54548e 100644
--- a/tools/testing/selftests/tpm2/tpm2.py
+++ b/tools/testing/selftests/tpm2/tpm2.py
@@ -344,7 +344,7 @@ def get_algorithm(name):
def hex_dump(d):
- d = [format(ord(x), '02x') for x in d]
+ d = [format(x, '02x') for x in d]
d = [d[i: i + 16] for i in range(0, len(d), 16)]
d = [' '.join(x) for x in d]
d = os.linesep.join(d)