summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLans Zhang <jia.zhang@windriver.com>2017-07-21 17:13:47 +0800
committerLans Zhang <jia.zhang@windriver.com>2017-07-21 17:14:19 +0800
commit1212f2c97402c8960a28f19b3b06ac1fe4744768 (patch)
tree30cd30bf23c87dfcafcff00c0a14c53390f64004
parent5726763b02a16bf5f3a2b11c7864742df6194c9e (diff)
downloadmeta-secure-core-1212f2c97402c8960a28f19b3b06ac1fe4744768.tar.gz
openssl-tpm-engine: fix cmdline parsing failure on arm platform
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
-rw-r--r--meta-tpm/recipes-tpm/openssl-tpm-engine/files/0004-tpm-openssl-tpm-engine-change-variable-c-type-from-c.patch34
-rw-r--r--meta-tpm/recipes-tpm/openssl-tpm-engine/openssl-tpm-engine_git.bb1
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-tpm/recipes-tpm/openssl-tpm-engine/files/0004-tpm-openssl-tpm-engine-change-variable-c-type-from-c.patch b/meta-tpm/recipes-tpm/openssl-tpm-engine/files/0004-tpm-openssl-tpm-engine-change-variable-c-type-from-c.patch
new file mode 100644
index 0000000..076704d
--- /dev/null
+++ b/meta-tpm/recipes-tpm/openssl-tpm-engine/files/0004-tpm-openssl-tpm-engine-change-variable-c-type-from-c.patch
@@ -0,0 +1,34 @@
1From fb44e2814fd819c086f9a4c925427f89c0e8cec6 Mon Sep 17 00:00:00 2001
2From: Limeng <Meng.Li@windriver.com>
3Date: Fri, 21 Jul 2017 16:32:02 +0800
4Subject: [PATCH] tpm:openssl-tpm-engine: change variable c type from char
5 into int
6
7refer to getopt_long() function definition, its return value type is
8int. So, change variable c type from char into int.
9On arm platform, when getopt_long() calling fails, if we define c as
10char type, its value will be 255, not -1. This will cause code enter
11wrong case.
12
13Signed-off-by: Meng Li <Meng.Li@windriver.com>
14---
15 create_tpm_key.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/create_tpm_key.c b/create_tpm_key.c
19index 7b94d62..f30af90 100644
20--- a/create_tpm_key.c
21+++ b/create_tpm_key.c
22@@ -148,7 +148,8 @@ int main(int argc, char **argv)
23 ASN1_OCTET_STRING *blob_str;
24 unsigned char *blob_asn1 = NULL;
25 int asn1_len;
26- char *filename, c, *openssl_key = NULL;
27+ char *filename, *openssl_key = NULL;
28+ int c;
29 int option_index, auth = 0, popup = 0, wrap = 0;
30 int wellknownkey = 0;
31 UINT32 enc_scheme = TSS_ES_RSAESPKCSV15;
32--
331.7.9.5
34
diff --git a/meta-tpm/recipes-tpm/openssl-tpm-engine/openssl-tpm-engine_git.bb b/meta-tpm/recipes-tpm/openssl-tpm-engine/openssl-tpm-engine_git.bb
index 987fc7a..48cbf75 100644
--- a/meta-tpm/recipes-tpm/openssl-tpm-engine/openssl-tpm-engine_git.bb
+++ b/meta-tpm/recipes-tpm/openssl-tpm-engine/openssl-tpm-engine_git.bb
@@ -15,6 +15,7 @@ SRC_URI = "\
15 file://0002-libtpm-support-env-TPM_SRK_PW.patch \ 15 file://0002-libtpm-support-env-TPM_SRK_PW.patch \
16 file://0003-Fix-not-building-libtpm.la.patch \ 16 file://0003-Fix-not-building-libtpm.la.patch \
17 file://0003-tpm-openssl-tpm-engine-parse-an-encrypted-tpm-SRK-pa.patch \ 17 file://0003-tpm-openssl-tpm-engine-parse-an-encrypted-tpm-SRK-pa.patch \
18 file://0004-tpm-openssl-tpm-engine-change-variable-c-type-from-c.patch \
18" 19"
19SRCREV = "bbc2b1af809f20686e0d3553a62f0175742c0d60" 20SRCREV = "bbc2b1af809f20686e0d3553a62f0175742c0d60"
20 21