summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLans Zhang <jia.zhang@windriver.com>2017-08-16 10:12:21 +0800
committerLans Zhang <jia.zhang@windriver.com>2017-08-16 10:12:21 +0800
commit4b41056970264494a9b5b45eaa4b99b99aa72845 (patch)
tree229628dd9dfcf2df8f6d48ed6e1308541b4d8527
parenteb08a619d88b853aed181502dff277de5c4caedf (diff)
downloadmeta-secure-core-4b41056970264494a9b5b45eaa4b99b99aa72845.tar.gz
sbsigntool: fix build failure with openssl-1.0.x
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
-rw-r--r--meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool-native_git.bb2
-rw-r--r--meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool/Fix-the-deprecated-ASN1_STRING_data-in-openssl-1.1.0.patch (renamed from meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool/Fix-the-deprecated-ASN1_STRING_data.patch)40
2 files changed, 33 insertions, 9 deletions
diff --git a/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool-native_git.bb b/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool-native_git.bb
index 431144a..f52b5fc 100644
--- a/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool-native_git.bb
+++ b/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool-native_git.bb
@@ -19,7 +19,7 @@ SRC_URI = "\
19 file://Fix-for-multi-sign.patch \ 19 file://Fix-for-multi-sign.patch \
20 file://sbsign-add-x-option-to-avoid-overwrite-existing-sign.patch \ 20 file://sbsign-add-x-option-to-avoid-overwrite-existing-sign.patch \
21 file://image-fix-the-segment-fault-caused-by-the-uninitiali.patch \ 21 file://image-fix-the-segment-fault-caused-by-the-uninitiali.patch \
22 file://Fix-the-deprecated-ASN1_STRING_data.patch \ 22 file://Fix-the-deprecated-ASN1_STRING_data-in-openssl-1.1.0.patch \
23 file://Update-OpenSSL-API-usage-to-support-OpenSSL-1.1.patch \ 23 file://Update-OpenSSL-API-usage-to-support-OpenSSL-1.1.patch \
24" 24"
25SRCREV="951ee95a301674c046f55330cd7460e1314deff2" 25SRCREV="951ee95a301674c046f55330cd7460e1314deff2"
diff --git a/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool/Fix-the-deprecated-ASN1_STRING_data.patch b/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool/Fix-the-deprecated-ASN1_STRING_data-in-openssl-1.1.0.patch
index 6ffbde2..3619945 100644
--- a/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool/Fix-the-deprecated-ASN1_STRING_data.patch
+++ b/meta-efi-secure-boot/recipes-devtools/sbsigntool/sbsigntool/Fix-the-deprecated-ASN1_STRING_data-in-openssl-1.1.0.patch
@@ -1,16 +1,17 @@
1From c5d321ded2020441b0d064e03b7b07358d3f71da Mon Sep 17 00:00:00 2001 1From 6ef94a67490176a6d84b4968f303e6d1c51a49ce Mon Sep 17 00:00:00 2001
2From: Lans Zhang <jia.zhang@windriver.com> 2From: Lans Zhang <jia.zhang@windriver.com>
3Date: Tue, 15 Aug 2017 10:55:40 +0800 3Date: Wed, 16 Aug 2017 10:09:43 +0800
4Subject: [PATCH] Fix the deprecated ASN1_STRING_data() 4Subject: [PATCH] Fix the deprecated ASN1_STRING_data() in openssl-1.1.0
5 5
6Signed-off-by: Lans Zhang <jia.zhang@windriver.com> 6Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
7--- 7---
8 src/idc.c | 4 ++-- 8 src/idc.c | 4 ++--
9 src/sbkeysync.c | 2 +- 9 src/idc.h | 4 ++++
10 2 files changed, 3 insertions(+), 3 deletions(-) 10 src/sbkeysync.c | 3 ++-
11 3 files changed, 8 insertions(+), 3 deletions(-)
11 12
12diff --git a/src/idc.c b/src/idc.c 13diff --git a/src/idc.c b/src/idc.c
13index 236cefd..8feaa11 100644 14index 236cefd..7f99a53 100644
14--- a/src/idc.c 15--- a/src/idc.c
15+++ b/src/idc.c 16+++ b/src/idc.c
16@@ -238,7 +238,7 @@ struct idc *IDC_get(PKCS7 *p7, BIO *bio) 17@@ -238,7 +238,7 @@ struct idc *IDC_get(PKCS7 *p7, BIO *bio)
@@ -31,11 +32,34 @@ index 236cefd..8feaa11 100644
31 if (memcmp(buf, sha, sizeof(sha))) { 32 if (memcmp(buf, sha, sizeof(sha))) {
32 fprintf(stderr, "Hash doesn't match image\n"); 33 fprintf(stderr, "Hash doesn't match image\n");
33 fprintf(stderr, " got: %s\n", sha256_str(buf)); 34 fprintf(stderr, " got: %s\n", sha256_str(buf));
35diff --git a/src/idc.h b/src/idc.h
36index a6526de..8011237 100644
37--- a/src/idc.h
38+++ b/src/idc.h
39@@ -36,6 +36,10 @@
40
41 #include <openssl/pkcs7.h>
42
43+#if OPENSSL_VERSION_NUMBER < 0x10100000L
44+#define ASN1_STRING_get0_data ASN1_STRING_data
45+#endif
46+
47 struct idc;
48
49 int IDC_set(PKCS7 *p7, PKCS7_SIGNER_INFO *si, struct image *image);
34diff --git a/src/sbkeysync.c b/src/sbkeysync.c 50diff --git a/src/sbkeysync.c b/src/sbkeysync.c
35index a63d3b8..ef028ef 100644 51index a63d3b8..223a047 100644
36--- a/src/sbkeysync.c 52--- a/src/sbkeysync.c
37+++ b/src/sbkeysync.c 53+++ b/src/sbkeysync.c
38@@ -210,7 +210,7 @@ static int x509_key_parse(struct key *key, uint8_t *data, size_t len) 54@@ -54,6 +54,7 @@
55
56 #include "fileio.h"
57 #include "efivars.h"
58+#include "idc.h"
59
60 #define EFIVARS_MOUNTPOINT "/sys/firmware/efi/efivars"
61 #define PSTORE_FSTYPE 0x6165676C
62@@ -210,7 +211,7 @@ static int x509_key_parse(struct key *key, uint8_t *data, size_t len)
39 serial = x509->cert_info->serialNumber; 63 serial = x509->cert_info->serialNumber;
40 64
41 key->id_len = ASN1_STRING_length(serial); 65 key->id_len = ASN1_STRING_length(serial);