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>
This commit is contained in:
Hongxu Jia
2018-09-25 22:16:06 +08:00
committed by Jia Zhang
parent 896365daea
commit ef419deace
2 changed files with 7 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ index 27fc9ef..4f6d581 100644
tpm_unsealdata_SOURCES = tpm_unsealdata.c
diff --git a/src/cmds/tpm_extendpcr.c b/src/cmds/tpm_extendpcr.c
new file mode 100644
index 0000000..e19b271
index 0000000..ee4bb15
--- /dev/null
+++ b/src/cmds/tpm_extendpcr.c
@@ -0,0 +1,181 @@
@@ -115,7 +115,7 @@ index 0000000..e19b271
+
+}
+
+static char in_filename[PATH_MAX] = "";
+static char in_filename[PATH_MAX+1] = "";
+static TSS_HPCRS hPcrs = NULL_HPCRS;
+static TSS_HTPM hTpm;
+static UINT32 selectedPcrs[24];
@@ -213,11 +213,11 @@ index 0000000..e19b271
+
+ unsigned char msg[EVP_MAX_MD_SIZE];
+ unsigned int msglen;
+ EVP_MD_CTX ctx;
+ EVP_DigestInit(&ctx, EVP_sha1());
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
+ EVP_DigestInit(ctx, EVP_sha1());
+ while ((lineLen = BIO_read(bin, line, sizeof(line))) > 0)
+ EVP_DigestUpdate(&ctx, line, lineLen);
+ EVP_DigestFinal(&ctx, msg, &msglen);
+ EVP_DigestUpdate(ctx, line, lineLen);
+ EVP_DigestFinal(ctx, msg, &msglen);
+
+ if (contextCreateObject(hContext, TSS_OBJECT_TYPE_PCRS, initFlag,
+ &hPcrs) != TSS_SUCCESS)

View File

@@ -10,7 +10,7 @@ SECTION = "security/tpm"
LICENSE = "CPL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9"
DEPENDS = "libtspi openssl10"
DEPENDS = "libtspi openssl"
DEPENDS_class-native = "trousers-native"
PV = "1.3.9.1+git${SRCPV}"