summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-01-29 08:52:44 -0800
committerArmin Kuster <akuster808@gmail.com>2017-02-18 11:43:20 -0800
commit33f4ac7996612705d1a71264511e7a72a1a3e1d8 (patch)
tree65d9c7f9e4ebbb7dedc0e2e4c49aaca350757894
parentb07a08eac388ecfa37489d197fac12b68ecfcbba (diff)
downloadmeta-security-33f4ac7996612705d1a71264511e7a72a1a3e1d8.tar.gz
libtpm: update to tip
fix several build issues Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-tpm/libtpm/files/fix_dprintf_issue.patch18
-rw-r--r--recipes-tpm/libtpm/files/fix_signed_issue.patch48
-rw-r--r--recipes-tpm/libtpm/libtpm_1.0.bb8
3 files changed, 72 insertions, 2 deletions
diff --git a/recipes-tpm/libtpm/files/fix_dprintf_issue.patch b/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
new file mode 100644
index 0000000..25760bb
--- /dev/null
+++ b/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
@@ -0,0 +1,18 @@
1Upstream-Status: Pending
2Signed-off-by: Armin Kuster <akuster808@gmail.com>
3
4Index: src/tpm_library.c
5===================================================================
6--- git.orig/src/tpm_library.c
7+++ git/src/tpm_library.c
8@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format,
9 }
10
11 if (debug_prefix)
12- dprintf(debug_fd, debug_prefix);
13- dprintf(debug_fd, buffer);
14+ dprintf(debug_fd, "%s" , debug_prefix);
15+ dprintf(debug_fd, "%s" , buffer);
16
17 return i;
18 }
diff --git a/recipes-tpm/libtpm/files/fix_signed_issue.patch b/recipes-tpm/libtpm/files/fix_signed_issue.patch
new file mode 100644
index 0000000..fc13aa5
--- /dev/null
+++ b/recipes-tpm/libtpm/files/fix_signed_issue.patch
@@ -0,0 +1,48 @@
1Upstream-Status: Pending
2Signed-off-by: Armin kuster <akuster808@gmail.com>
3
4Index: git/src/swtpm/ctrlchannel.c
5===================================================================
6--- git.orig/src/swtpm/ctrlchannel.c
7+++ git/src/swtpm/ctrlchannel.c
8@@ -152,7 +152,8 @@ static int ctrlchannel_receive_state(ptm
9 uint32_t tpm_number = 0;
10 unsigned char *blob = NULL;
11 uint32_t blob_length = be32toh(pss->u.req.length);
12- uint32_t remain = blob_length, offset = 0;
13+ ssize_t remain = (ssize_t) blob_length;
14+ uint32_t offset = 0;
15 TPM_RESULT res;
16 uint32_t flags = be32toh(pss->u.req.state_flags);
17 TPM_BOOL is_encrypted = (flags & PTM_STATE_FLAG_ENCRYPTED) != 0;
18Index: git/src/swtpm_ioctl/tpm_ioctl.c
19===================================================================
20--- git.orig/src/swtpm_ioctl/tpm_ioctl.c
21+++ git/src/swtpm_ioctl/tpm_ioctl.c
22@@ -303,7 +303,7 @@ static int do_save_state_blob(int fd, bo
23 numbytes = write(file_fd, pgs.u.resp.data,
24 devtoh32(is_chardev, pgs.u.resp.length));
25
26- if (numbytes != devtoh32(is_chardev, pgs.u.resp.length)) {
27+ if (numbytes != (ssize_t) devtoh32(is_chardev, pgs.u.resp.length)) {
28 fprintf(stderr,
29 "Could not write to file '%s': %s\n",
30 filename, strerror(errno));
31@@ -420,7 +420,7 @@ static int do_load_state_blob(int fd, bo
32 had_error = true;
33 break;
34 }
35- pss.u.req.length = htodev32(is_chardev, numbytes);
36+ pss.u.req.length = htodev32(is_chardev, (uint32_t) numbytes);
37
38 /* the returnsize is zero on all intermediate packets */
39 returnsize = ((size_t)numbytes < sizeof(pss.u.req.data))
40@@ -863,7 +863,7 @@ int main(int argc, char *argv[])
41 return EXIT_FAILURE;
42 }
43 /* no tpm_result here */
44- printf("ptm capability is 0x%lx\n", (uint64_t)devtoh64(is_chardev, cap));
45+ printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, cap));
46
47 } else if (!strcmp(command, "-i")) {
48 init.u.req.init_flags = htodev32(is_chardev, PTM_INIT_FLAG_DELETE_VOLATILE);
diff --git a/recipes-tpm/libtpm/libtpm_1.0.bb b/recipes-tpm/libtpm/libtpm_1.0.bb
index 83b78a0..449e8c1 100644
--- a/recipes-tpm/libtpm/libtpm_1.0.bb
+++ b/recipes-tpm/libtpm/libtpm_1.0.bb
@@ -1,8 +1,12 @@
1SUMMARY = "LIBPM - Software TPM Library" 1SUMMARY = "LIBPM - Software TPM Library"
2LICENSE = "BSD-3-Clause" 2LICENSE = "BSD-3-Clause"
3LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f" 3LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f"
4SRCREV = "e5dc628043e981c9f8d7711ddfe5812c8f4e38cc" 4
5SRC_URI = "git://github.com/stefanberger/libtpms.git" 5SRCREV = "ad44846dda5a96e269ad2f78a532e01e9a2f02a1"
6SRC_URI = " \
7 git://github.com/stefanberger/libtpms.git \
8 file://fix_dprintf_issue.patch \
9 "
6 10
7S = "${WORKDIR}/git" 11S = "${WORKDIR}/git"
8inherit autotools-brokensep pkgconfig 12inherit autotools-brokensep pkgconfig