From ef419deaced53c7fca33547450857658de520945 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 25 Sep 2018 22:16:06 +0800 Subject: 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 --- .../recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch | 12 ++++++------ 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 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) 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" 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}" -- cgit v1.2.3-54-g00ecf