diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2020-07-22 16:27:06 +0800 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2020-07-22 17:30:26 +0800 |
commit | 960cffb1074da83acdbbd9df53260a6311a18829 (patch) | |
tree | 18e6db81abf2fa2333c41c4ecc99d1b96133580f | |
parent | 683082518840f0b18d8f36162eeef09104110e12 (diff) | |
download | meta-secure-core-960cffb1074da83acdbbd9df53260a6311a18829.tar.gz |
tpm2-tools: upgrade 4.1.1 -> 4.1.3
* License-Update: BSD -> BSD-3-Clause
* Add a patch to switch to python3 in test scripts
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
3 files changed, 122 insertions, 17 deletions
diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/files/0001-tests-switch-to-python3.patch b/meta-tpm2/recipes-tpm/tpm2-tools/files/0001-tests-switch-to-python3.patch new file mode 100644 index 0000000..cf2a25d --- /dev/null +++ b/meta-tpm2/recipes-tpm/tpm2-tools/files/0001-tests-switch-to-python3.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 46280adf87a6f2b66a89c9445cc45f7595a09ea1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Wed, 22 Jul 2020 13:45:44 +0800 | ||
4 | Subject: [PATCH] tests: switch to python3 | ||
5 | |||
6 | The python2 is EOL and in some distributions (e.g. CentOS 8/RHEL 8), | ||
7 | there is no python symbolic link by default. | ||
8 | See: https://developers.redhat.com/blog/2018/11/14/python-in-rhel-8/ | ||
9 | |||
10 | Update the scripts to switch to python3. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
15 | --- | ||
16 | test/integration/helpers.sh | 12 +++--------- | ||
17 | test/integration/tests/activecredential.sh | 4 +--- | ||
18 | test/integration/tests/getcap.sh | 4 +--- | ||
19 | test/integration/tests/print.sh | 4 +--- | ||
20 | 4 files changed, 6 insertions(+), 18 deletions(-) | ||
21 | |||
22 | diff --git a/test/integration/helpers.sh b/test/integration/helpers.sh | ||
23 | index 10dfc67..f6ee0e3 100644 | ||
24 | --- a/test/integration/helpers.sh | ||
25 | +++ b/test/integration/helpers.sh | ||
26 | @@ -4,9 +4,7 @@ set -E | ||
27 | |||
28 | function filter_algs_by() { | ||
29 | |||
30 | -python << pyscript | ||
31 | -from __future__ import print_function | ||
32 | - | ||
33 | +python3 << pyscript | ||
34 | import sys | ||
35 | import yaml | ||
36 | |||
37 | @@ -71,9 +69,7 @@ hash_alg_supported() { | ||
38 | # as the first argument loads as a YAML file. | ||
39 | # | ||
40 | function yaml_verify() { | ||
41 | -python << pyscript | ||
42 | -from __future__ import print_function | ||
43 | - | ||
44 | +python3 << pyscript | ||
45 | import sys | ||
46 | import yaml | ||
47 | |||
48 | @@ -97,9 +93,7 @@ function yaml_get_kv() { | ||
49 | third_arg=$3 | ||
50 | fi | ||
51 | |||
52 | -python << pyscript | ||
53 | -from __future__ import print_function | ||
54 | - | ||
55 | +python3 << pyscript | ||
56 | import sys | ||
57 | import yaml | ||
58 | |||
59 | diff --git a/test/integration/tests/activecredential.sh b/test/integration/tests/activecredential.sh | ||
60 | index 8adf6c1..027a42f 100755 | ||
61 | --- a/test/integration/tests/activecredential.sh | ||
62 | +++ b/test/integration/tests/activecredential.sh | ||
63 | @@ -28,9 +28,7 @@ tpm2_createak -C 0x81010009 -c ak.ctx -G rsa -g sha256 -s rsassa -u ak.pub \ | ||
64 | -n ak.name -p akpass> ak.out | ||
65 | |||
66 | # Capture the yaml output and verify that its the same as the name output | ||
67 | -loaded_key_name_yaml=`python << pyscript | ||
68 | -from __future__ import print_function | ||
69 | - | ||
70 | +loaded_key_name_yaml=`python3 << pyscript | ||
71 | import yaml | ||
72 | |||
73 | with open('ak.out', 'r') as f: | ||
74 | diff --git a/test/integration/tests/getcap.sh b/test/integration/tests/getcap.sh | ||
75 | index 92726a9..cde38ab 100755 | ||
76 | --- a/test/integration/tests/getcap.sh | ||
77 | +++ b/test/integration/tests/getcap.sh | ||
78 | @@ -15,9 +15,7 @@ trap cleanup EXIT | ||
79 | |||
80 | function yaml_to_list() { | ||
81 | |||
82 | -python << pyscript | ||
83 | -from __future__ import print_function | ||
84 | - | ||
85 | +python3 << pyscript | ||
86 | import sys | ||
87 | import yaml | ||
88 | |||
89 | diff --git a/test/integration/tests/print.sh b/test/integration/tests/print.sh | ||
90 | index 44ec1f1..d7c2e93 100755 | ||
91 | --- a/test/integration/tests/print.sh | ||
92 | +++ b/test/integration/tests/print.sh | ||
93 | @@ -41,9 +41,7 @@ tpm2_quote -Q -c $ak_ctx -l "sha256:0,2,4,9,10,11,12,17" -q "0f8beb45ac" \ | ||
94 | tpm2_print -t TPMS_ATTEST $quote_file > $print_file | ||
95 | |||
96 | # Check printed yaml | ||
97 | -python << pyscript | ||
98 | -from __future__ import print_function | ||
99 | - | ||
100 | +python3 << pyscript | ||
101 | import sys | ||
102 | import re | ||
103 | import yaml | ||
104 | -- | ||
105 | 2.17.1 | ||
106 | |||
diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.1.bb b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.1.bb deleted file mode 100644 index e90dcfe..0000000 --- a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.1.bb +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | SUMMARY = "Tools for TPM2." | ||
2 | DESCRIPTION = "tpm2-tools" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0eb1216e46938bd723098d93a23c3bcc" | ||
5 | SECTION = "tpm" | ||
6 | |||
7 | DEPENDS = "tpm2-abrmd tpm2-tss openssl curl autoconf-archive" | ||
8 | |||
9 | SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz" | ||
10 | |||
11 | SRC_URI[md5sum] = "701ae9e8c8cbdd37d89c8ad774f55395" | ||
12 | SRC_URI[sha256sum] = "40b9263d8b949bd2bc03a3cd60fa242e27116727467f9bbdd0b5f2539a25a7b1" | ||
13 | SRC_URI[sha1sum] = "d097d321237983435f05c974533ad90e6f20acef" | ||
14 | SRC_URI[sha384sum] = "396547f400e4f5626d7741d77ec543f312d94e6697899f4c36260d15fab3f4f971ad2c0487e6eaa2d60256f3cf68f85f" | ||
15 | SRC_URI[sha512sum] = "25952cf947f0acd16b1a8dbd3ac8573bce85ff970a7e24c290c4f9cd29418e77a3e48ac82c932fbd250887a9303ab301ff92db594c2fffaba47b873382444d26" | ||
16 | |||
17 | inherit autotools pkgconfig bash-completion | ||
diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb new file mode 100644 index 0000000..8748a47 --- /dev/null +++ b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb | |||
@@ -0,0 +1,16 @@ | |||
1 | SUMMARY = "Tools for TPM2." | ||
2 | DESCRIPTION = "tpm2-tools" | ||
3 | LICENSE = "BSD-3-Clause" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0eb1216e46938bd723098d93a23c3bcc" | ||
5 | SECTION = "tpm" | ||
6 | |||
7 | DEPENDS = "tpm2-abrmd tpm2-tss openssl curl autoconf-archive" | ||
8 | |||
9 | SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz \ | ||
10 | file://0001-tests-switch-to-python3.patch \ | ||
11 | " | ||
12 | |||
13 | SRC_URI[md5sum] = "48e0f58232b6a86fe4d007acf12af283" | ||
14 | SRC_URI[sha256sum] = "bb5d3310620e75468fe33dbd530bd73dd648c70ec707b4579c74d9f63fc82704" | ||
15 | |||
16 | inherit autotools pkgconfig bash-completion | ||