summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2018-09-12 18:01:25 -0700
committerArmin Kuster <akuster808@gmail.com>2018-09-17 21:08:19 -0700
commitdb794a634fff27df3afd1fe21c5b23237539cec0 (patch)
tree60a908e648ea102550cbbab8bb12ddfe649ca978
parent93c5ab66874ede730f6c38ad7e08fa1cf47ee0d8 (diff)
downloadmeta-security-db794a634fff27df3afd1fe21c5b23237539cec0.tar.gz
tpm-tools: update to latest 1.3.9.1
refresh patch backport debian fixes Fix additional openssl 1.1 issue Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-tpm/recipes-tpm/tpm-tools/files/04-fix-FTBFS-clang.patch56
-rw-r--r--meta-tpm/recipes-tpm/tpm-tools/files/05-openssl1.1_fix_data_mgmt.patch110
-rw-r--r--meta-tpm/recipes-tpm/tpm-tools/files/openssl1.1_fix.patch18
-rw-r--r--meta-tpm/recipes-tpm/tpm-tools/files/tpm-tools-extendpcr.patch32
-rw-r--r--meta-tpm/recipes-tpm/tpm-tools/tpm-tools_1.3.9.1.bb (renamed from meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb)7
5 files changed, 204 insertions, 19 deletions
diff --git a/meta-tpm/recipes-tpm/tpm-tools/files/04-fix-FTBFS-clang.patch b/meta-tpm/recipes-tpm/tpm-tools/files/04-fix-FTBFS-clang.patch
new file mode 100644
index 0000000..5018d45
--- /dev/null
+++ b/meta-tpm/recipes-tpm/tpm-tools/files/04-fix-FTBFS-clang.patch
@@ -0,0 +1,56 @@
1Title: Fix FTBFS with clang due to uninitialized values
2Date: 2015-06-28
3Author: Alexander <sanek23994@gmail.com>
4Bug-Debian: http://bugs.debian.org/753063
5
6Upstream-Status: Backport
7tpm-tools_1.3.9.1-0.1.debian.tar
8
9Signed-off-by: Armin kuster <akuster808@gmail.com>
10
11--- tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c 2012-05-17 21:49:58.000000000 +0400
12+++ tpm-tools-1.3.8-my/src/tpm_mgmt/tpm_present.c 2014-06-29 01:01:11.502081468 +0400
13@@ -165,7 +165,7 @@
14
15 TSS_BOOL bCmd, bHwd;
16 BOOL bRc;
17- TSS_HPOLICY hTpmPolicy;
18+ TSS_HPOLICY hTpmPolicy = 0;
19 char *pwd = NULL;
20 int pswd_len;
21 char rsp[5];
22--- tpm-tools-1.3.8/src/tpm_mgmt/tpm_takeownership.c 2010-09-30 21:28:09.000000000 +0400
23+++ tpm-tools-1.3.8-my/src/tpm_mgmt/tpm_takeownership.c 2014-06-29 01:01:51.069373655 +0400
24@@ -67,7 +67,7 @@
25 char *szSrkPasswd = NULL;
26 int tpm_len, srk_len;
27 TSS_HTPM hTpm;
28- TSS_HKEY hSrk;
29+ TSS_HKEY hSrk = 0;
30 TSS_FLAG fSrkAttrs;
31 TSS_HPOLICY hTpmPolicy, hSrkPolicy;
32 int iRc = -1;
33--- tpm-tools-1.3.8/src/tpm_mgmt/tpm_nvwrite.c 2011-08-17 16:20:35.000000000 +0400
34+++ tpm-tools-1.3.8-my/src/tpm_mgmt/tpm_nvwrite.c 2014-06-29 01:02:45.836397172 +0400
35@@ -220,7 +220,7 @@
36 close(fd);
37 fd = -1;
38 } else if (fillvalue >= 0) {
39- if (length < 0) {
40+ if (length == 0) {
41 logError(_("Requiring size parameter.\n"));
42 return -1;
43 }
44--- tpm-tools-1.3.8/src/data_mgmt/data_protect.c 2012-05-17 21:49:58.000000000 +0400
45+++ tpm-tools-1.3.8-my/src/data_mgmt/data_protect.c 2014-06-29 01:03:49.863254459 +0400
46@@ -432,8 +432,8 @@
47
48 char *pszPin = NULL;
49
50- CK_RV rv;
51- CK_SESSION_HANDLE hSession;
52+ CK_RV rv = 0;
53+ CK_SESSION_HANDLE hSession = 0;
54 CK_OBJECT_HANDLE hObject;
55 CK_MECHANISM tMechanism = { CKM_AES_ECB, NULL, 0 };
56
diff --git a/meta-tpm/recipes-tpm/tpm-tools/files/05-openssl1.1_fix_data_mgmt.patch b/meta-tpm/recipes-tpm/tpm-tools/files/05-openssl1.1_fix_data_mgmt.patch
new file mode 100644
index 0000000..c2a264b
--- /dev/null
+++ b/meta-tpm/recipes-tpm/tpm-tools/files/05-openssl1.1_fix_data_mgmt.patch
@@ -0,0 +1,110 @@
1Author: Philipp Kern <pkern@debian.org>
2Subject: Fix openssl1.1 support in data_mgmt
3Date: Tue, 31 Jan 2017 22:40:10 +0100
4
5Upstream-Status: Backport
6tpm-tools_1.3.9.1-0.1.debian.tar
7
8Signed-off-by: Armin kuster <akuster808@gmail.com>
9
10---
11 src/data_mgmt/data_import.c | 60 ++++++++++++++++++++++++++++----------------
12 1 file changed, 39 insertions(+), 21 deletions(-)
13
14--- a/src/data_mgmt/data_import.c
15+++ b/src/data_mgmt/data_import.c
16@@ -372,7 +372,7 @@ readX509Cert( const char *a_pszFile,
17 goto out;
18 }
19
20- if ( EVP_PKEY_type( pKey->type ) != EVP_PKEY_RSA ) {
21+ if ( EVP_PKEY_base_id( pKey ) != EVP_PKEY_RSA ) {
22 logError( TOKEN_RSA_KEY_ERROR );
23
24 X509_free( pX509 );
25@@ -691,8 +691,13 @@ createRsaPubKeyObject( RSA
26
27 int rc = -1;
28
29- int nLen = BN_num_bytes( a_pRsa->n );
30- int eLen = BN_num_bytes( a_pRsa->e );
31+ const BIGNUM *bn;
32+ const BIGNUM *be;
33+
34+ RSA_get0_key( a_pRsa, &bn, &be, NULL );
35+
36+ int nLen = BN_num_bytes( bn );
37+ int eLen = BN_num_bytes( be );
38
39 CK_RV rv;
40
41@@ -732,8 +737,8 @@ createRsaPubKeyObject( RSA
42 }
43
44 // Get binary representations of the RSA key information
45- BN_bn2bin( a_pRsa->n, n );
46- BN_bn2bin( a_pRsa->e, e );
47+ BN_bn2bin( bn, n );
48+ BN_bn2bin( be, e );
49
50 // Create the RSA public key object
51 rv = createObject( a_hSession, tAttr, ulAttrCount, a_hObject );
52@@ -760,14 +765,27 @@ createRsaPrivKeyObject( RSA
53
54 int rc = -1;
55
56- int nLen = BN_num_bytes( a_pRsa->n );
57- int eLen = BN_num_bytes( a_pRsa->e );
58- int dLen = BN_num_bytes( a_pRsa->d );
59- int pLen = BN_num_bytes( a_pRsa->p );
60- int qLen = BN_num_bytes( a_pRsa->q );
61- int dmp1Len = BN_num_bytes( a_pRsa->dmp1 );
62- int dmq1Len = BN_num_bytes( a_pRsa->dmq1 );
63- int iqmpLen = BN_num_bytes( a_pRsa->iqmp );
64+ const BIGNUM *bn;
65+ const BIGNUM *be;
66+ const BIGNUM *bd;
67+ const BIGNUM *bp;
68+ const BIGNUM *bq;
69+ const BIGNUM *bdmp1;
70+ const BIGNUM *bdmq1;
71+ const BIGNUM *biqmp;
72+
73+ RSA_get0_key( a_pRsa, &bn, &be, &bd);
74+ RSA_get0_factors( a_pRsa, &bp, &bq);
75+ RSA_get0_crt_params( a_pRsa, &bdmp1, &bdmq1, &biqmp );
76+
77+ int nLen = BN_num_bytes( bn );
78+ int eLen = BN_num_bytes( be );
79+ int dLen = BN_num_bytes( bd );
80+ int pLen = BN_num_bytes( bp );
81+ int qLen = BN_num_bytes( bq );
82+ int dmp1Len = BN_num_bytes( bdmp1 );
83+ int dmq1Len = BN_num_bytes( bdmq1 );
84+ int iqmpLen = BN_num_bytes( biqmp );
85
86 CK_RV rv;
87
88@@ -821,14 +839,14 @@ createRsaPrivKeyObject( RSA
89 }
90
91 // Get binary representations of the RSA key information
92- BN_bn2bin( a_pRsa->n, n );
93- BN_bn2bin( a_pRsa->e, e );
94- BN_bn2bin( a_pRsa->d, d );
95- BN_bn2bin( a_pRsa->p, p );
96- BN_bn2bin( a_pRsa->q, q );
97- BN_bn2bin( a_pRsa->dmp1, dmp1 );
98- BN_bn2bin( a_pRsa->dmq1, dmq1 );
99- BN_bn2bin( a_pRsa->iqmp, iqmp );
100+ BN_bn2bin( bn, n );
101+ BN_bn2bin( be, e );
102+ BN_bn2bin( bd, d );
103+ BN_bn2bin( bp, p );
104+ BN_bn2bin( bq, q );
105+ BN_bn2bin( bdmp1, dmp1 );
106+ BN_bn2bin( bdmq1, dmq1 );
107+ BN_bn2bin( biqmp, iqmp );
108
109 // Create the RSA private key object
110 rv = createObject( a_hSession, tAttr, ulAttrCount, a_hObject );
diff --git a/meta-tpm/recipes-tpm/tpm-tools/files/openssl1.1_fix.patch b/meta-tpm/recipes-tpm/tpm-tools/files/openssl1.1_fix.patch
new file mode 100644
index 0000000..9ae3f72
--- /dev/null
+++ b/meta-tpm/recipes-tpm/tpm-tools/files/openssl1.1_fix.patch
@@ -0,0 +1,18 @@
1Upstream-Status: Pending
2Update to build with openssl 1.1.x
3
4Signed-off-by: Armin Kuster <akuster808@gmail.com>
5
6Index: git/src/cmds/tpm_extendpcr.c
7===================================================================
8--- git.orig/src/cmds/tpm_extendpcr.c
9+++ git/src/cmds/tpm_extendpcr.c
10@@ -136,7 +136,7 @@ int main(int argc, char **argv)
11
12 unsigned char msg[EVP_MAX_MD_SIZE];
13 unsigned int msglen;
14- EVP_MD_CTX ctx;
15+ EVP_MD_CTX *ctx = EVP_MD_CTX_new();
16 EVP_DigestInit(&ctx, EVP_sha1());
17 while ((lineLen = BIO_read(bin, line, sizeof(line))) > 0)
18 EVP_DigestUpdate(&ctx, line, lineLen);
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 ab5e683..40150af 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
@@ -1,8 +1,8 @@
1Index: tpm-tools-1.3.8/include/tpm_tspi.h 1Index: git/include/tpm_tspi.h
2=================================================================== 2===================================================================
3--- tpm-tools-1.3.8.orig/include/tpm_tspi.h 2011-08-17 08:20:35.000000000 -0400 3--- git.orig/include/tpm_tspi.h
4+++ tpm-tools-1.3.8/include/tpm_tspi.h 2013-01-05 23:26:31.571598217 -0500 4+++ git/include/tpm_tspi.h
5@@ -117,6 +117,10 @@ 5@@ -117,6 +117,10 @@ TSS_RESULT tpmPcrRead(TSS_HTPM a_hTpm, U
6 UINT32 *a_PcrSize, BYTE **a_PcrValue); 6 UINT32 *a_PcrSize, BYTE **a_PcrValue);
7 TSS_RESULT pcrcompositeSetPcrValue(TSS_HPCRS a_hPcrs, UINT32 a_Idx, 7 TSS_RESULT pcrcompositeSetPcrValue(TSS_HPCRS a_hPcrs, UINT32 a_Idx,
8 UINT32 a_PcrSize, BYTE *a_PcrValue); 8 UINT32 a_PcrSize, BYTE *a_PcrValue);
@@ -13,11 +13,11 @@ Index: tpm-tools-1.3.8/include/tpm_tspi.h
13 #ifdef TSS_LIB_IS_12 13 #ifdef TSS_LIB_IS_12
14 TSS_RESULT unloadVersionInfo(UINT64 *offset, BYTE *blob, TPM_CAP_VERSION_INFO *v); 14 TSS_RESULT unloadVersionInfo(UINT64 *offset, BYTE *blob, TPM_CAP_VERSION_INFO *v);
15 TSS_RESULT pcrcompositeSetPcrLocality(TSS_HPCRS a_hPcrs, UINT32 localityValue); 15 TSS_RESULT pcrcompositeSetPcrLocality(TSS_HPCRS a_hPcrs, UINT32 localityValue);
16Index: tpm-tools-1.3.8/lib/tpm_tspi.c 16Index: git/lib/tpm_tspi.c
17=================================================================== 17===================================================================
18--- tpm-tools-1.3.8.orig/lib/tpm_tspi.c 2011-08-17 08:20:35.000000000 -0400 18--- git.orig/lib/tpm_tspi.c
19+++ tpm-tools-1.3.8/lib/tpm_tspi.c 2013-01-05 23:27:37.731593490 -0500 19+++ git/lib/tpm_tspi.c
20@@ -594,6 +594,20 @@ 20@@ -594,6 +594,20 @@ pcrcompositeSetPcrValue(TSS_HPCRS a_hPcr
21 return result; 21 return result;
22 } 22 }
23 23
@@ -38,10 +38,10 @@ Index: tpm-tools-1.3.8/lib/tpm_tspi.c
38 #ifdef TSS_LIB_IS_12 38 #ifdef TSS_LIB_IS_12
39 /* 39 /*
40 * These getPasswd functions will wrap calls to the other functions and check to see if the TSS 40 * These getPasswd functions will wrap calls to the other functions and check to see if the TSS
41Index: tpm-tools-1.3.8/src/cmds/Makefile.am 41Index: git/src/cmds/Makefile.am
42=================================================================== 42===================================================================
43--- tpm-tools-1.3.8.orig/src/cmds/Makefile.am 2011-08-15 13:52:08.000000000 -0400 43--- git.orig/src/cmds/Makefile.am
44+++ tpm-tools-1.3.8/src/cmds/Makefile.am 2013-01-05 23:30:46.223593698 -0500 44+++ git/src/cmds/Makefile.am
45@@ -22,6 +22,7 @@ 45@@ -22,6 +22,7 @@
46 # 46 #
47 47
@@ -50,16 +50,16 @@ Index: tpm-tools-1.3.8/src/cmds/Makefile.am
50 tpm_unsealdata 50 tpm_unsealdata
51 51
52 if TSS_LIB_IS_12 52 if TSS_LIB_IS_12
53@@ -33,4 +34,5 @@ 53@@ -33,4 +34,5 @@ endif
54 LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -ltpm_unseal -lcrypto 54 LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -ltpm_unseal -lcrypto @INTLLIBS@
55 55
56 tpm_sealdata_SOURCES = tpm_sealdata.c 56 tpm_sealdata_SOURCES = tpm_sealdata.c
57+tpm_extendpcr_SOURCES = tpm_extendpcr.c 57+tpm_extendpcr_SOURCES = tpm_extendpcr.c
58 tpm_unsealdata_SOURCES = tpm_unsealdata.c 58 tpm_unsealdata_SOURCES = tpm_unsealdata.c
59Index: tpm-tools-1.3.8/src/cmds/tpm_extendpcr.c 59Index: git/src/cmds/tpm_extendpcr.c
60=================================================================== 60===================================================================
61--- /dev/null 1970-01-01 00:00:00.000000000 +0000 61--- /dev/null
62+++ tpm-tools-1.3.8/src/cmds/tpm_extendpcr.c 2013-01-05 23:37:43.403585514 -0500 62+++ git/src/cmds/tpm_extendpcr.c
63@@ -0,0 +1,181 @@ 63@@ -0,0 +1,181 @@
64+/* 64+/*
65+ * The Initial Developer of the Original Code is International 65+ * The Initial Developer of the Original Code is International
diff --git a/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb b/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_1.3.9.1.bb
index f670bff..88ef19f 100644
--- a/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_git.bb
+++ b/meta-tpm/recipes-tpm/tpm-tools/tpm-tools_1.3.9.1.bb
@@ -12,14 +12,15 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9"
12DEPENDS = "libtspi openssl" 12DEPENDS = "libtspi openssl"
13DEPENDS_class-native = "trousers-native" 13DEPENDS_class-native = "trousers-native"
14 14
15SRCREV = "5c5126bedf2da97906358adcfb8c43c86e7dd0ee" 15SRCREV = "bdf9f1bc8f63cd6fc370c2deb58d03ac55079e84"
16SRC_URI = " \ 16SRC_URI = " \
17 git://git.code.sf.net/p/trousers/tpm-tools \ 17 git://git.code.sf.net/p/trousers/tpm-tools \
18 file://tpm-tools-extendpcr.patch \ 18 file://tpm-tools-extendpcr.patch \
19 file://04-fix-FTBFS-clang.patch \
20 file://05-openssl1.1_fix_data_mgmt.patch \
21 file://openssl1.1_fix.patch \
19 " 22 "
20 23
21PV = "1.3.9.1+git${SRCPV}"
22
23inherit autotools-brokensep gettext 24inherit autotools-brokensep gettext
24 25
25S = "${WORKDIR}/git" 26S = "${WORKDIR}/git"