diff options
| author | Jens Rehsack <sno@netbsd.org> | 2020-09-11 09:34:08 +0200 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2020-09-12 08:55:28 -0700 |
| commit | b9c72cc8bc8445292af904a51f28c34d72bb509f (patch) | |
| tree | 71facc3fd463132712d97285f06adabf57e93bf8 /meta-tpm/recipes-tpm2/ibmswtpm2 | |
| parent | caf76696e8669ee48339c13f01042da9e52515ae (diff) | |
| download | meta-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>
Diffstat (limited to 'meta-tpm/recipes-tpm2/ibmswtpm2')
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 @@ | |||
| 1 | Fix strict aliasing issue of gcc10 | ||
| 2 | |||
| 3 | fixes: | ||
| 4 | |||
| 5 | TpmFail.c: In function 'TpmLogFailure': | ||
| 6 | TpmFail.c:217:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 7 | 217 | s_failFunction = *(UINT32 *)&function; /* kgold */ | ||
| 8 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 9 | cc1: all warnings being treated as errors | ||
| 10 | |||
| 11 | Upstream-Status: Submitted | ||
| 12 | |||
| 13 | Signed-off-by: Jens Rehsack <sno@NetBSD.org> | ||
| 14 | |||
| 15 | Index: 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 @@ | |||
| 1 | Allow recipe to overide optimization. | ||
| 2 | |||
| 3 | fixes: | ||
| 4 | |||
| 5 | 397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ||
| 6 | | | ^~~~~~~ | ||
| 7 | | cc1: all warnings being treated as errors | ||
| 8 | |||
| 9 | |||
| 10 | Upstream-Status: OE specific | ||
| 11 | |||
| 12 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
| 13 | |||
| 14 | Index: 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 @@ | |||
| 1 | 1) Allow recipe to overide optimization. | ||
| 2 | |||
| 3 | fixes: | ||
| 4 | |||
| 5 | 397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ||
| 6 | | | ^~~~~~~ | ||
| 7 | | cc1: all warnings being treated as errors | ||
| 8 | |||
| 9 | 2) Allow recipe to override OE related compile-/link-flags | ||
| 10 | |||
| 11 | fixes: | ||
| 12 | |||
| 13 | ERROR: QA Issue: File /usr/bin/tpm_server in package ibmswtpm2 doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags] | ||
| 14 | |||
| 15 | Upstream-Status: OE specific | ||
| 16 | |||
| 17 | Signed-off-by: Jens Rehsack <sno@NetBSD.org> | ||
| 18 | |||
| 19 | Index: 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 @@ | |||
| 1 | SUMMARY = "IBM's Software TPM 2.0" | ||
| 2 | LICENSE = "BSD" | ||
| 3 | SECTION = "securty/tpm" | ||
| 4 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=1e023f61454ac828b4aa1bc4293f7d5f" | ||
| 5 | |||
| 6 | DEPENDS = "openssl" | ||
| 7 | |||
| 8 | SRC_URI = "https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm${PV}.tar.gz \ | ||
| 9 | file://remove_optimization.patch \ | ||
| 10 | " | ||
| 11 | SRC_URI[md5sum] = "bfd3eca2411915f24de628b9ec36f259" | ||
| 12 | SRC_URI[sha256sum] = "a8e874e7a1ae13a1290d7679d846281f72d0eb6a5e4cfbafca5297dbf4e29ea3" | ||
| 13 | SRC_URI[sha1sum] = "7c8241a4e97a801eace9f0eea8cdda7c58114f7f" | ||
| 14 | SRC_URI[sha384sum] = "eec25cc8ba0e3cb27d41ba4fa4c71d8158699953ccb61bb6d440236dcbd8f52b6954eaae9d640a713186e0b99311fd91" | ||
| 15 | SRC_URI[sha512sum] = "ab47caa4406ba57c0afc6fadae304fc9ef5e3e125be0f2fb1955a419cf93cd5e9176e103f0b566825abc16cca00b795f98d2b407f0a2bf7b141ef4b025d907d0" | ||
| 16 | |||
| 17 | S = "${WORKDIR}/src" | ||
| 18 | |||
| 19 | do_compile () { | ||
| 20 | make CC='${CC}' | ||
| 21 | } | ||
| 22 | |||
| 23 | do_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 @@ | |||
| 1 | SUMMARY = "IBM's Software TPM 2.0" | ||
| 2 | DESCRIPTION = "The software TPM 2.0 is targeted toward application development, \ | ||
| 3 | education, and virtualization. \ | ||
| 4 | \ | ||
| 5 | The intent is that an application can be developed using the software TPM. \ | ||
| 6 | The application should then run using a hardware TPM without changes. \ | ||
| 7 | Advantages 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." | ||
| 11 | HOMEPAGE = "http://ibmswtpm.sourceforge.net/ibmswtpm2.html" | ||
| 12 | LICENSE = "BSD" | ||
| 13 | SECTION = "securty/tpm" | ||
| 14 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=1e023f61454ac828b4aa1bc4293f7d5f" | ||
| 15 | |||
| 16 | DEPENDS = "openssl" | ||
| 17 | |||
| 18 | SRC_URI = "https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm${PV}.tar.gz \ | ||
| 19 | file://tune-makefile.patch \ | ||
| 20 | file://fix-wrong-cast.patch \ | ||
| 21 | " | ||
| 22 | SRC_URI[md5sum] = "43b217d87056e9155633925eb6ef749c" | ||
| 23 | SRC_URI[sha256sum] = "dd3a4c3f7724243bc9ebcd5c39bbf87b82c696d1c1241cb8e5883534f6e2e327" | ||
| 24 | SRC_URI[sha1sum] = "ab4b94079e57a86996991e8a2b749ce063e4ad3e" | ||
| 25 | SRC_URI[sha384sum] = "bbef16a934853ce78cba7ddc766aa9d7ef3cde3430a322b1be772bf3ad4bd6d413ae9c4de21bc1a4879d17dfe2aadc1d" | ||
| 26 | SRC_URI[sha512sum] = "007aa415cccf19a2bcf789c426727dc4032dcb04cc9d11eedc231d2add708c1134d3d5ee5cfbe7de68307c95fff7a30bd306fbd8d53c198a5ef348440440a6ed" | ||
| 27 | |||
| 28 | S = "${WORKDIR}/src" | ||
| 29 | |||
| 30 | CFLAGS += "-Wno-error=maybe-uninitialized" | ||
| 31 | |||
| 32 | do_compile () { | ||
| 33 | make CC='${CC}' | ||
| 34 | } | ||
| 35 | |||
| 36 | do_install () { | ||
| 37 | install -d ${D}/${bindir} | ||
| 38 | install -m 0755 tpm_server ${D}/${bindir} | ||
| 39 | } | ||
