mirror of
https://github.com/jiazhang0/meta-secure-core.git
synced 2026-01-12 01:00:15 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user