All of lore.kernel.org
 help / color / mirror / Atom feed
* [tpm2] Re: Failing to build tss tools - Ubuntu groovy
@ 2021-04-26 18:00 Roberts, William C
  0 siblings, 0 replies; 2+ messages in thread
From: Roberts, William C @ 2021-04-26 18:00 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 3049 bytes --]

I think all the python used is python3 compatible, so you could just symlink python to python3. Most distros would use something like update-alternatives
so you can control python and python3 independently and have both side by side or not.

In my system, Ubuntu 20.04, python is /usr/bin/python --> /etc/alternatives/python --> /usr/bin/python3
and python3 is /usr/bin/python3 --> /usr/local/bin/python3.8


3.0.x is older. The naming schemes are:
3.X  --> feature releases (3.1, 3.2, 3.3, 3.x)
3.0.x: --> bug fix releases (3.0.1, 3.0.2, 3.0.x)

This patch works for me, but 3.X is EOL no support. But the tests passed. I built and linked against:
pkg-config --modversion tss2-sys
3.1.0-rc0

$ git diff
diff --git a/configure.ac b/configure.ac
index 0bfd51965ef6..9b7e1d9c3963 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AM_CONDITIONAL([HAVE_PANDOC],[test "x${PANDOC}" = "xyes"])
 AM_CONDITIONAL(
     [HAVE_MAN_PAGES],
     [test -d "${srcdir}/man/man1" -o "x${PANDOC}" = "xyes"])
-PKG_CHECK_MODULES([SAPI],[tss2-sys >= 2.0 tss2-sys < 3.0 tss2-mu >= 2.0 tss2-mu < 3.0])
+PKG_CHECK_MODULES([SAPI],[tss2-sys >= 2.0 tss2-mu >= 2.0])
 PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g])
 PKG_CHECK_MODULES([CURL],[libcurl])
 AC_ARG_ENABLE([unit],

./configure --enable-debug --enable-unit
make -j4 check
<unit tests>

Run System Tests
NOTE: You may see some warnings about YAML deprecations (yaml changed API in python) ignore them
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe.
You also may see negative testing error statements:
ERROR: Failed to filter unavailable PCR values for quote!
Just ignore them.

Before running the tests have a simulator and tpm2-abrmd running.
tpm_server &
tpm2-abrmd --tcti=mssim

Start the tests:

cd test/system

./test.sh
<snip>
test_tpm2_send.sh ... PASSED
test_tpm2_sign.sh ... PASSED
test_tpm2_startup.sh ... PASSED
test_tpm2_takeownership.sh ... PASSED
test_tpm2_unseal.sh ... PASSED
test_tpm2_verifysignature.sh ... PASSED
Tests passed: 38
Tests Failed: 0








________________________________
From: Kenneth Goldman <kgoldman(a)us.ibm.com>
Sent: Friday, April 23, 2021 2:24 PM
To: tpm2(a)lists.01.org <tpm2(a)lists.01.org>
Subject: [tpm2] Failing to build tss tools - Ubuntu groovy


My project specifies branch 3.X, which fails because it uses python, not python3.

checking for module yaml in python... Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named yaml

~~~~~~~~~~~~~~~~~~~~~~~~~~

I tried instead branch 3.0.x. Is that newer or older than 3.X.

This one failed because - what - sapi is not installed or it's the wrong version???

checking for sapi >= 1.3.0 sapi < 2.0.0... no

The tpm2-tss is 2.4.x. The project wants 2.0.x but that did not build.

~~~

Is there a patch for 3.X or 3.0.X that I can use to build?


--
Ken Goldman kgoldman(a)us.ibm.com
914-945-2415 (862-2415)


[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 9810 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tpm2] Re: Failing to build tss tools - Ubuntu groovy
@ 2021-04-26 18:11 Roberts, William C
  0 siblings, 0 replies; 2+ messages in thread
From: Roberts, William C @ 2021-04-26 18:11 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 4086 bytes --]

I'm assuming this is all related to Keylime's installer.sh script. Keylime should support newer tools (looks like 4.2):
https://github.com/keylime/keylime/blob/149dffe7aa7ba8296689710854317545778d2414/keylime/tpm/tpm_main.py#L263

I would modify their install to set newer versions of the tools and tss:
diff --git a/installer.sh b/installer.sh
index 64a0b9ca9143..5ee4782df833 100755
--- a/installer.sh
+++ b/installer.sh
@@ -14,8 +14,8 @@ TPM2SIM_SRC=http://sourceforge.net/projects/ibmswtpm2/files/ibmtpm1119.tar.gz/do
 KEYLIME_VER="master"
 TPM4720_VER="master"
 GOLANG_VER="1.13.1"
-TPM2TSS_VER="2.0.x"
-TPM2TOOLS_VER="3.X"
+TPM2TSS_VER="3.0.3"
+TPM2TOOLS_VER="4.2"

 # Minimum version requirements
 MIN_PYTHON_VERSION="3.6.7"

________________________________
From: Roberts, William C <william.c.roberts(a)intel.com>
Sent: Monday, April 26, 2021 1:00 PM
To: Kenneth Goldman <kgoldman(a)us.ibm.com>; tpm2(a)lists.01.org <tpm2(a)lists.01.org>
Subject: Re: [tpm2] Failing to build tss tools - Ubuntu groovy

I think all the python used is python3 compatible, so you could just symlink python to python3. Most distros would use something like update-alternatives
so you can control python and python3 independently and have both side by side or not.

In my system, Ubuntu 20.04, python is /usr/bin/python --> /etc/alternatives/python --> /usr/bin/python3
and python3 is /usr/bin/python3 --> /usr/local/bin/python3.8


3.0.x is older. The naming schemes are:
3.X  --> feature releases (3.1, 3.2, 3.3, 3.x)
3.0.x: --> bug fix releases (3.0.1, 3.0.2, 3.0.x)

This patch works for me, but 3.X is EOL no support. But the tests passed. I built and linked against:
pkg-config --modversion tss2-sys
3.1.0-rc0

$ git diff
diff --git a/configure.ac b/configure.ac
index 0bfd51965ef6..9b7e1d9c3963 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AM_CONDITIONAL([HAVE_PANDOC],[test "x${PANDOC}" = "xyes"])
 AM_CONDITIONAL(
     [HAVE_MAN_PAGES],
     [test -d "${srcdir}/man/man1" -o "x${PANDOC}" = "xyes"])
-PKG_CHECK_MODULES([SAPI],[tss2-sys >= 2.0 tss2-sys < 3.0 tss2-mu >= 2.0 tss2-mu < 3.0])
+PKG_CHECK_MODULES([SAPI],[tss2-sys >= 2.0 tss2-mu >= 2.0])
 PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g])
 PKG_CHECK_MODULES([CURL],[libcurl])
 AC_ARG_ENABLE([unit],

./configure --enable-debug --enable-unit
make -j4 check
<unit tests>

Run System Tests
NOTE: You may see some warnings about YAML deprecations (yaml changed API in python) ignore them
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe.
You also may see negative testing error statements:
ERROR: Failed to filter unavailable PCR values for quote!
Just ignore them.

Before running the tests have a simulator and tpm2-abrmd running.
tpm_server &
tpm2-abrmd --tcti=mssim

Start the tests:

cd test/system

./test.sh
<snip>
test_tpm2_send.sh ... PASSED
test_tpm2_sign.sh ... PASSED
test_tpm2_startup.sh ... PASSED
test_tpm2_takeownership.sh ... PASSED
test_tpm2_unseal.sh ... PASSED
test_tpm2_verifysignature.sh ... PASSED
Tests passed: 38
Tests Failed: 0








________________________________
From: Kenneth Goldman <kgoldman(a)us.ibm.com>
Sent: Friday, April 23, 2021 2:24 PM
To: tpm2(a)lists.01.org <tpm2(a)lists.01.org>
Subject: [tpm2] Failing to build tss tools - Ubuntu groovy


My project specifies branch 3.X, which fails because it uses python, not python3.

checking for module yaml in python... Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named yaml

~~~~~~~~~~~~~~~~~~~~~~~~~~

I tried instead branch 3.0.x. Is that newer or older than 3.X.

This one failed because - what - sapi is not installed or it's the wrong version???

checking for sapi >= 1.3.0 sapi < 2.0.0... no

The tpm2-tss is 2.4.x. The project wants 2.0.x but that did not build.

~~~

Is there a patch for 3.X or 3.0.X that I can use to build?


--
Ken Goldman kgoldman(a)us.ibm.com
914-945-2415 (862-2415)


[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 11733 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-26 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 18:00 [tpm2] Re: Failing to build tss tools - Ubuntu groovy Roberts, William C
2021-04-26 18:11 Roberts, William C

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.