summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2018-09-15 08:19:03 -0700
committerArmin Kuster <akuster808@gmail.com>2018-09-17 21:08:19 -0700
commit49a7a7a8e115cee161848f2af0ded494f3162cf3 (patch)
tree3e7b8144a5cc54f354cb644d4991e58ec5cde40e
parent2e784636c9ff70fbc1276167e9ef839d9e9f934b (diff)
downloadmeta-security-49a7a7a8e115cee161848f2af0ded494f3162cf3.tar.gz
pcr-extend: fix building with openssl 1.1
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-tpm/recipes-tpm/pcr-extend/files/fix_openssl11_build.patch45
-rw-r--r--meta-tpm/recipes-tpm/pcr-extend/pcr-extend_git.bb3
2 files changed, 47 insertions, 1 deletions
diff --git a/meta-tpm/recipes-tpm/pcr-extend/files/fix_openssl11_build.patch b/meta-tpm/recipes-tpm/pcr-extend/files/fix_openssl11_build.patch
new file mode 100644
index 0000000..cf2d437
--- /dev/null
+++ b/meta-tpm/recipes-tpm/pcr-extend/files/fix_openssl11_build.patch
@@ -0,0 +1,45 @@
1Enable building with openssl 1.1
2
3Upstream-Status: Pending
4Signed-off-by: Armin Kuster <akuster808@gmail.com>
5
6Index: git/src/pcr-extend.c
7===================================================================
8--- git.orig/src/pcr-extend.c
9+++ git/src/pcr-extend.c
10@@ -118,7 +118,7 @@ dump_buf (FILE *file, char *buf, size_t
11 static unsigned char*
12 sha1_file (FILE *file, unsigned int *hash_len)
13 {
14- EVP_MD_CTX ctx = { 0 };
15+ EVP_MD_CTX *ctx = EVP_MD_CTX_new();
16 unsigned char *buf = NULL, *hash = NULL;
17 size_t num_read = 0;
18
19@@ -127,7 +127,7 @@ sha1_file (FILE *file, unsigned int *has
20 perror ("malloc:\n");
21 goto sha1_fail;
22 }
23- if (EVP_DigestInit (&ctx, EVP_sha1 ()) == 0) {
24+ if (EVP_DigestInit (ctx, EVP_sha1 ()) == 0) {
25 ERR_print_errors_fp (stderr);
26 goto sha1_fail;
27 }
28@@ -135,7 +135,7 @@ sha1_file (FILE *file, unsigned int *has
29 num_read = fread (buf, 1, BUF_SIZE, file);
30 if (num_read <= 0)
31 break;
32- if (EVP_DigestUpdate (&ctx, buf, num_read) == 0) {
33+ if (EVP_DigestUpdate (ctx, buf, num_read) == 0) {
34 ERR_print_errors_fp (stderr);
35 goto sha1_fail;
36 }
37@@ -149,7 +149,7 @@ sha1_file (FILE *file, unsigned int *has
38 perror ("calloc of hash buffer:\n");
39 goto sha1_fail;
40 }
41- if (EVP_DigestFinal (&ctx, hash, hash_len) == 0) {
42+ if (EVP_DigestFinal (ctx, hash, hash_len) == 0) {
43 ERR_print_errors_fp (stderr);
44 goto sha1_fail;
45 }
diff --git a/meta-tpm/recipes-tpm/pcr-extend/pcr-extend_git.bb b/meta-tpm/recipes-tpm/pcr-extend/pcr-extend_git.bb
index 0cc4f63..f8347b7 100644
--- a/meta-tpm/recipes-tpm/pcr-extend/pcr-extend_git.bb
+++ b/meta-tpm/recipes-tpm/pcr-extend/pcr-extend_git.bb
@@ -9,7 +9,8 @@ DEPENDS = "libtspi"
9PV = "0.1+git${SRCPV}" 9PV = "0.1+git${SRCPV}"
10SRCREV = "c02ad8f628b3d99f6d4c087b402fe31a40ee6316" 10SRCREV = "c02ad8f628b3d99f6d4c087b402fe31a40ee6316"
11 11
12SRC_URI = "git://github.com/flihp/pcr-extend.git " 12SRC_URI = "git://github.com/flihp/pcr-extend.git \
13 file://fix_openssl11_build.patch "
13 14
14inherit autotools 15inherit autotools
15 16