diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-09-25 22:16:06 +0800 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2018-09-26 08:28:11 +0800 |
commit | ef419deaced53c7fca33547450857658de520945 (patch) | |
tree | bea5ef48916a5bf83bde8f7fba1dc0921bfec2ee | |
parent | 896365daea9f61f8209aec71cca2c1adb5a5590c (diff) | |
download | meta-secure-core-ef419deaced53c7fca33547450857658de520945.tar.gz |
tpm-tools: support openssl 1.1.x
- Support openssl 1.1.x
- Fix compile warning
|tpm_extendpcr.c:55:4: warning: 'strncpy' specified bound 4096 equals
destination size [-Wstringop-truncation]
| strncpy(in_filename, aArg, PATH_MAX);
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-rw-r--r-- | meta-tpm/recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch | 12 | ||||
-rw-r--r-- | meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/meta-tpm/recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch b/meta-tpm/recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch index 1ba8e14..4dd7d89 100644 --- a/meta-tpm/recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch +++ b/meta-tpm/recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch | |||
@@ -71,7 +71,7 @@ index 27fc9ef..4f6d581 100644 | |||
71 | tpm_unsealdata_SOURCES = tpm_unsealdata.c | 71 | tpm_unsealdata_SOURCES = tpm_unsealdata.c |
72 | diff --git a/src/cmds/tpm_extendpcr.c b/src/cmds/tpm_extendpcr.c | 72 | diff --git a/src/cmds/tpm_extendpcr.c b/src/cmds/tpm_extendpcr.c |
73 | new file mode 100644 | 73 | new file mode 100644 |
74 | index 0000000..e19b271 | 74 | index 0000000..ee4bb15 |
75 | --- /dev/null | 75 | --- /dev/null |
76 | +++ b/src/cmds/tpm_extendpcr.c | 76 | +++ b/src/cmds/tpm_extendpcr.c |
77 | @@ -0,0 +1,181 @@ | 77 | @@ -0,0 +1,181 @@ |
@@ -115,7 +115,7 @@ index 0000000..e19b271 | |||
115 | + | 115 | + |
116 | +} | 116 | +} |
117 | + | 117 | + |
118 | +static char in_filename[PATH_MAX] = ""; | 118 | +static char in_filename[PATH_MAX+1] = ""; |
119 | +static TSS_HPCRS hPcrs = NULL_HPCRS; | 119 | +static TSS_HPCRS hPcrs = NULL_HPCRS; |
120 | +static TSS_HTPM hTpm; | 120 | +static TSS_HTPM hTpm; |
121 | +static UINT32 selectedPcrs[24]; | 121 | +static UINT32 selectedPcrs[24]; |
@@ -213,11 +213,11 @@ index 0000000..e19b271 | |||
213 | + | 213 | + |
214 | + unsigned char msg[EVP_MAX_MD_SIZE]; | 214 | + unsigned char msg[EVP_MAX_MD_SIZE]; |
215 | + unsigned int msglen; | 215 | + unsigned int msglen; |
216 | + EVP_MD_CTX ctx; | 216 | + EVP_MD_CTX *ctx = EVP_MD_CTX_create(); |
217 | + EVP_DigestInit(&ctx, EVP_sha1()); | 217 | + EVP_DigestInit(ctx, EVP_sha1()); |
218 | + while ((lineLen = BIO_read(bin, line, sizeof(line))) > 0) | 218 | + while ((lineLen = BIO_read(bin, line, sizeof(line))) > 0) |
219 | + EVP_DigestUpdate(&ctx, line, lineLen); | 219 | + EVP_DigestUpdate(ctx, line, lineLen); |
220 | + EVP_DigestFinal(&ctx, msg, &msglen); | 220 | + EVP_DigestFinal(ctx, msg, &msglen); |
221 | + | 221 | + |
222 | + if (contextCreateObject(hContext, TSS_OBJECT_TYPE_PCRS, initFlag, | 222 | + if (contextCreateObject(hContext, TSS_OBJECT_TYPE_PCRS, initFlag, |
223 | + &hPcrs) != TSS_SUCCESS) | 223 | + &hPcrs) != TSS_SUCCESS) |
diff --git a/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb b/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb index 8833688..cb59e8c 100644 --- a/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb +++ b/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb | |||
@@ -10,7 +10,7 @@ SECTION = "security/tpm" | |||
10 | LICENSE = "CPL-1.0" | 10 | LICENSE = "CPL-1.0" |
11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9" | 11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9" |
12 | 12 | ||
13 | DEPENDS = "libtspi openssl10" | 13 | DEPENDS = "libtspi openssl" |
14 | DEPENDS_class-native = "trousers-native" | 14 | DEPENDS_class-native = "trousers-native" |
15 | 15 | ||
16 | PV = "1.3.9.1+git${SRCPV}" | 16 | PV = "1.3.9.1+git${SRCPV}" |