summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Rehsack <sno@netbsd.org>2020-09-11 09:34:08 +0200
committerArmin Kuster <akuster808@gmail.com>2020-09-12 08:55:28 -0700
commitb9c72cc8bc8445292af904a51f28c34d72bb509f (patch)
tree71facc3fd463132712d97285f06adabf57e93bf8
parentcaf76696e8669ee48339c13f01042da9e52515ae (diff)
downloadmeta-security-b9c72cc8bc8445292af904a51f28c34d72bb509f.tar.gz
ibmswtpm2: update to 1637
Update ibmswtpm2 from 1628 to 1637. Build 1637 Includes: * Increase NV memory size to match PC Client RSA 3072 requirements * Add and fix ACT support * Update Visual Studio files to 2019. Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch27
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch26
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch50
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1628.bb26
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1637.bb39
5 files changed, 116 insertions, 52 deletions
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch b/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch
new file mode 100644
index 0000000..f2938e0
--- /dev/null
+++ b/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch
@@ -0,0 +1,27 @@
1Fix strict aliasing issue of gcc10
2
3fixes:
4
5TpmFail.c: In function 'TpmLogFailure':
6TpmFail.c:217:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
7 217 | s_failFunction = *(UINT32 *)&function; /* kgold */
8 | ^~~~~~~~~~~~~~~~~~~
9cc1: all warnings being treated as errors
10
11Upstream-Status: Submitted
12
13Signed-off-by: Jens Rehsack <sno@NetBSD.org>
14
15Index: src/TpmFail.c
16===================================================================
17--- src.orig/TpmFail.c 2020-09-10 15:43:57.085063875 +0200
18+++ src/TpmFail.c 2020-09-10 15:48:35.563302634 +0200
19@@ -214,7 +214,7 @@
20 // On a 64-bit machine, this may truncate the address of the string
21 // of the function name where the error occurred.
22 #if FAIL_TRACE
23- s_failFunction = *(UINT32 *)&function; /* kgold */
24+ memcpy(&s_failFunction, function, sizeof(uint32_t)); /* kgold */
25 s_failLine = line;
26 #else
27 s_failFunction = 0;
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch b/meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch
deleted file mode 100644
index 2919e2e..0000000
--- a/meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1Allow recipe to overide optimization.
2
3fixes:
4
5397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
6| | ^~~~~~~
7| cc1: all warnings being treated as errors
8
9
10Upstream-Status: OE specific
11
12Signed-off-by: Armin Kuster <akuster808@gmail.com>
13
14Index: src/makefile
15===================================================================
16--- src.orig/makefile
17+++ src/makefile
18@@ -43,7 +43,7 @@ CC = /usr/bin/gcc
19 CCFLAGS = -Wall \
20 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
21 -Werror -Wsign-compare \
22- -c -ggdb -O0 \
23+ -c -ggdb -O \
24 -DTPM_POSIX \
25 -D_POSIX_ \
26 -DTPM_NUVOTON
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch b/meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch
new file mode 100644
index 0000000..eebddb9
--- /dev/null
+++ b/meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch
@@ -0,0 +1,50 @@
11) Allow recipe to overide optimization.
2
3fixes:
4
5397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
6| | ^~~~~~~
7| cc1: all warnings being treated as errors
8
92) Allow recipe to override OE related compile-/link-flags
10
11fixes:
12
13ERROR: QA Issue: File /usr/bin/tpm_server in package ibmswtpm2 doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
14
15Upstream-Status: OE specific
16
17Signed-off-by: Jens Rehsack <sno@NetBSD.org>
18
19Index: src/makefile
20===================================================================
21--- src.orig/makefile
22+++ src/makefile
23@@ -38,12 +38,10 @@
24 #################################################################################
25
26
27-CC = /usr/bin/gcc
28-
29 CCFLAGS = -Wall \
30 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
31 -Werror -Wsign-compare \
32- -c -ggdb -O0 \
33+ -c -ggdb -O \
34 -DTPM_POSIX \
35 -D_POSIX_ \
36 -DTPM_NUVOTON
37@@ -79,11 +77,11 @@
38 .PRECIOUS: %.o
39
40 tpm_server: $(OBJFILES)
41- $(CC) $(OBJFILES) $(LNFLAGS) -o tpm_server
42+ $(CCLD) $(OBJFILES) $(LDFLAGS) $(LNFLAGS) -o tpm_server
43
44 clean:
45 rm -f *.o tpm_server *~
46
47 %.o: %.c
48- $(CC) $(CCFLAGS) $< -o $@
49+ $(CC) $(CCFLAGS) $(CFLAGS) $< -o $@
50
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1628.bb b/meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1628.bb
deleted file mode 100644
index 3373a30..0000000
--- a/meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1628.bb
+++ /dev/null
@@ -1,26 +0,0 @@
1SUMMARY = "IBM's Software TPM 2.0"
2LICENSE = "BSD"
3SECTION = "securty/tpm"
4LIC_FILES_CHKSUM = "file://../LICENSE;md5=1e023f61454ac828b4aa1bc4293f7d5f"
5
6DEPENDS = "openssl"
7
8SRC_URI = "https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm${PV}.tar.gz \
9 file://remove_optimization.patch \
10 "
11SRC_URI[md5sum] = "bfd3eca2411915f24de628b9ec36f259"
12SRC_URI[sha256sum] = "a8e874e7a1ae13a1290d7679d846281f72d0eb6a5e4cfbafca5297dbf4e29ea3"
13SRC_URI[sha1sum] = "7c8241a4e97a801eace9f0eea8cdda7c58114f7f"
14SRC_URI[sha384sum] = "eec25cc8ba0e3cb27d41ba4fa4c71d8158699953ccb61bb6d440236dcbd8f52b6954eaae9d640a713186e0b99311fd91"
15SRC_URI[sha512sum] = "ab47caa4406ba57c0afc6fadae304fc9ef5e3e125be0f2fb1955a419cf93cd5e9176e103f0b566825abc16cca00b795f98d2b407f0a2bf7b141ef4b025d907d0"
16
17S = "${WORKDIR}/src"
18
19do_compile () {
20 make CC='${CC}'
21}
22
23do_install () {
24 install -d ${D}/${bindir}
25 install -m 0755 tpm_server ${D}/${bindir}
26}
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1637.bb b/meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1637.bb
new file mode 100644
index 0000000..32afd37
--- /dev/null
+++ b/meta-tpm/recipes-tpm2/ibmswtpm2/ibmswtpm2_1637.bb
@@ -0,0 +1,39 @@
1SUMMARY = "IBM's Software TPM 2.0"
2DESCRIPTION = "The software TPM 2.0 is targeted toward application development, \
3education, and virtualization. \
4\
5The intent is that an application can be developed using the software TPM. \
6The application should then run using a hardware TPM without changes. \
7Advantages of this approach: \
8* In contrast to a hardware TPM, it runs on many platforms and it's generally faster. \
9* Application software errors are easily reversed by simply removing the TPM state and starting over. \
10* Difficult crypto errors are quickly debugged by looking inside the TPM."
11HOMEPAGE = "http://ibmswtpm.sourceforge.net/ibmswtpm2.html"
12LICENSE = "BSD"
13SECTION = "securty/tpm"
14LIC_FILES_CHKSUM = "file://../LICENSE;md5=1e023f61454ac828b4aa1bc4293f7d5f"
15
16DEPENDS = "openssl"
17
18SRC_URI = "https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm${PV}.tar.gz \
19 file://tune-makefile.patch \
20 file://fix-wrong-cast.patch \
21 "
22SRC_URI[md5sum] = "43b217d87056e9155633925eb6ef749c"
23SRC_URI[sha256sum] = "dd3a4c3f7724243bc9ebcd5c39bbf87b82c696d1c1241cb8e5883534f6e2e327"
24SRC_URI[sha1sum] = "ab4b94079e57a86996991e8a2b749ce063e4ad3e"
25SRC_URI[sha384sum] = "bbef16a934853ce78cba7ddc766aa9d7ef3cde3430a322b1be772bf3ad4bd6d413ae9c4de21bc1a4879d17dfe2aadc1d"
26SRC_URI[sha512sum] = "007aa415cccf19a2bcf789c426727dc4032dcb04cc9d11eedc231d2add708c1134d3d5ee5cfbe7de68307c95fff7a30bd306fbd8d53c198a5ef348440440a6ed"
27
28S = "${WORKDIR}/src"
29
30CFLAGS += "-Wno-error=maybe-uninitialized"
31
32do_compile () {
33 make CC='${CC}'
34}
35
36do_install () {
37 install -d ${D}/${bindir}
38 install -m 0755 tpm_server ${D}/${bindir}
39}