diff options
author | Armin Kuster <akuster808@gmail.com> | 2017-05-07 22:39:03 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2017-05-14 07:56:43 -0700 |
commit | 4585f1e8c95435d60dd3a5287b25c7076347a3c9 (patch) | |
tree | 9be1977ee4fb8e0aff3f901db7da0e95cce3ac63 /meta-tpm/recipes-tpm/swtpm/files/fix_signed_issue.patch | |
parent | 6eac21cf4a7653753d87772c497ac14b8b6e3e67 (diff) | |
download | meta-security-4585f1e8c95435d60dd3a5287b25c7076347a3c9.tar.gz |
tpm: move to a sub layer
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-tpm/recipes-tpm/swtpm/files/fix_signed_issue.patch')
-rw-r--r-- | meta-tpm/recipes-tpm/swtpm/files/fix_signed_issue.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta-tpm/recipes-tpm/swtpm/files/fix_signed_issue.patch b/meta-tpm/recipes-tpm/swtpm/files/fix_signed_issue.patch new file mode 100644 index 0000000..140585b --- /dev/null +++ b/meta-tpm/recipes-tpm/swtpm/files/fix_signed_issue.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | Upstream-Status: Pending | ||
2 | Signed-off-by Armin Kuster <akuster808@gmail> | ||
3 | |||
4 | Index: 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; | ||
18 | Index: 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", (long long unsigned)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); | ||