summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormutantmonkey2017-06-10 15:14:41 -0700
committermutantmonkey2017-06-10 15:14:41 -0700
commitbcdeed38e04612391e5a924ee5d148ea1d6c92a2 (patch)
tree7336cb114328eeaa0294f1768a234f694d880644
parent9657c519e75a7e5cc988785ad6c1478c6976a486 (diff)
downloadaur-bcdeed38e04612391e5a924ee5d148ea1d6c92a2.tar.gz
upgpkg: tpm-tools 1.3.9.1-2
Apply patch from Gerardo Exequiel Pozzi <djgera@archlinux.org>
-rw-r--r--.SRCINFO15
-rw-r--r--01-opencryptoki-soname.patch16
-rw-r--r--03-fix-bool-error-parseStringWithValues.patch32
-rw-r--r--04-fix-FTBFS-clang.patch50
-rw-r--r--05-openssl1.1_fix_data_mgmt.patch106
-rw-r--r--PKGBUILD38
6 files changed, 244 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a0944394be13..a1c1cbb70500 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,26 @@
# Generated by mksrcinfo v8
-# Sun Feb 26 02:10:58 UTC 2017
+# Sat Jun 10 22:14:41 UTC 2017
pkgbase = tpm-tools
pkgdesc = Tools to manage and diagnose a TPM
pkgver = 1.3.9.1
- pkgrel = 1
+ pkgrel = 2
url = http://sourceforge.net/projects/trousers
arch = i686
arch = x86_64
license = CPL
depends = trousers
depends = opencryptoki
+ noextract = tpm-tools-1.3.9.1.tar.gz
source = http://downloads.sourceforge.net/project/trousers/tpm-tools/1.3.9.1/tpm-tools-1.3.9.1.tar.gz
- sha256sums = 9cb714e2650826e2e932f65bc0ba9d61b927dc5fea47f2c2a2b64f0fdfcbfa68
+ source = 01-opencryptoki-soname.patch
+ source = 03-fix-bool-error-parseStringWithValues.patch
+ source = 04-fix-FTBFS-clang.patch
+ source = 05-openssl1.1_fix_data_mgmt.patch
+ sha1sums = c35cb031c6b5220dd1c8a03995654fdd12aa3031
+ sha1sums = f87849fc46d8c8cab5b7a0fbc1a8de69f3fd1669
+ sha1sums = b40d56f3a7ca3ef231470cc401a73e178b698a4e
+ sha1sums = 521e9f58e6740bc50979e8dc727a60b82ad4fae0
+ sha1sums = 3fdf2d39a25f5c2e152ec44a457ffd2f7258d698
pkgname = tpm-tools
diff --git a/01-opencryptoki-soname.patch b/01-opencryptoki-soname.patch
new file mode 100644
index 000000000000..3445e5dd36fb
--- /dev/null
+++ b/01-opencryptoki-soname.patch
@@ -0,0 +1,16 @@
+Author: Daniel Baumann <daniel@debian.org>
+Description:
+ Opening libopencryptoki correctly with soname major (Closes: #493999).
+
+diff -Naurp tpm-tools.orig/include/tpm_pkcs11.h tpm-tools/include/tpm_pkcs11.h
+--- tpm-tools.orig/include/tpm_pkcs11.h 2008-06-21 16:14:56.000000000 +0200
++++ tpm-tools/include/tpm_pkcs11.h 2008-08-06 16:42:50.000000000 +0200
+@@ -26,7 +26,7 @@
+
+ #include <opencryptoki/pkcs11.h>
+
+-#define TPM_OPENCRYPTOKI_SO "libopencryptoki.so"
++#define TPM_OPENCRYPTOKI_SO "libopencryptoki.so.0"
+ #define TPM_TOKEN_LABEL "IBM PKCS#11 TPM Token"
+ #define TPM_FIND_MAX 10
+
diff --git a/03-fix-bool-error-parseStringWithValues.patch b/03-fix-bool-error-parseStringWithValues.patch
new file mode 100644
index 000000000000..482d40c8c26b
--- /dev/null
+++ b/03-fix-bool-error-parseStringWithValues.patch
@@ -0,0 +1,32 @@
+Title: Fix boolean comparison error (and FTBFS with gcc-5)
+Date: 2015-06-28
+Author: Pierre Chifflier <pollux@debian.org>
+Bug-Debian: http://bugs.debian.org/778147
+---
+ src/tpm_mgmt/tpm_nvcommon.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/src/tpm_mgmt/tpm_nvcommon.c
++++ b/src/tpm_mgmt/tpm_nvcommon.c
+@@ -140,8 +140,8 @@ int parseStringWithValues(const char *aA
+ aArg);
+ return -1;
+ }
+- if (aArg[offset+numbytes] == '|' ||
+- aArg[offset+numbytes] == 0) {
++ if (!(aArg[offset+numbytes] == '|' ||
++ aArg[offset+numbytes] == 0)) {
+ logError(_("Illegal character following "
+ "hexadecimal number in %s\n"),
+ aArg + offset);
+@@ -164,8 +164,8 @@ int parseStringWithValues(const char *aA
+ return -1;
+ }
+
+- if (!aArg[offset+numbytes] == '|' &&
+- !aArg[offset+numbytes] == 0) {
++ if (!(aArg[offset+numbytes] == '|' ||
++ aArg[offset+numbytes] == 0)) {
+ logError(_("Illegal character following decimal "
+ "number in %s\n"),
+ aArg + offset);
diff --git a/04-fix-FTBFS-clang.patch b/04-fix-FTBFS-clang.patch
new file mode 100644
index 000000000000..ae923677e345
--- /dev/null
+++ b/04-fix-FTBFS-clang.patch
@@ -0,0 +1,50 @@
+Title: Fix FTBFS with clang due to uninitialized values
+Date: 2015-06-28
+Author: Alexander <sanek23994@gmail.com>
+Bug-Debian: http://bugs.debian.org/753063
+--- tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c 2012-05-17 21:49:58.000000000 +0400
++++ tpm-tools-1.3.8-my/src/tpm_mgmt/tpm_present.c 2014-06-29 01:01:11.502081468 +0400
+@@ -165,7 +165,7 @@
+
+ TSS_BOOL bCmd, bHwd;
+ BOOL bRc;
+- TSS_HPOLICY hTpmPolicy;
++ TSS_HPOLICY hTpmPolicy = 0;
+ char *pwd = NULL;
+ int pswd_len;
+ char rsp[5];
+--- tpm-tools-1.3.8/src/tpm_mgmt/tpm_takeownership.c 2010-09-30 21:28:09.000000000 +0400
++++ tpm-tools-1.3.8-my/src/tpm_mgmt/tpm_takeownership.c 2014-06-29 01:01:51.069373655 +0400
+@@ -67,7 +67,7 @@
+ char *szSrkPasswd = NULL;
+ int tpm_len, srk_len;
+ TSS_HTPM hTpm;
+- TSS_HKEY hSrk;
++ TSS_HKEY hSrk = 0;
+ TSS_FLAG fSrkAttrs;
+ TSS_HPOLICY hTpmPolicy, hSrkPolicy;
+ int iRc = -1;
+--- tpm-tools-1.3.8/src/tpm_mgmt/tpm_nvwrite.c 2011-08-17 16:20:35.000000000 +0400
++++ tpm-tools-1.3.8-my/src/tpm_mgmt/tpm_nvwrite.c 2014-06-29 01:02:45.836397172 +0400
+@@ -220,7 +220,7 @@
+ close(fd);
+ fd = -1;
+ } else if (fillvalue >= 0) {
+- if (length < 0) {
++ if (length == 0) {
+ logError(_("Requiring size parameter.\n"));
+ return -1;
+ }
+--- tpm-tools-1.3.8/src/data_mgmt/data_protect.c 2012-05-17 21:49:58.000000000 +0400
++++ tpm-tools-1.3.8-my/src/data_mgmt/data_protect.c 2014-06-29 01:03:49.863254459 +0400
+@@ -432,8 +432,8 @@
+
+ char *pszPin = NULL;
+
+- CK_RV rv;
+- CK_SESSION_HANDLE hSession;
++ CK_RV rv = 0;
++ CK_SESSION_HANDLE hSession = 0;
+ CK_OBJECT_HANDLE hObject;
+ CK_MECHANISM tMechanism = { CKM_AES_ECB, NULL, 0 };
+
diff --git a/05-openssl1.1_fix_data_mgmt.patch b/05-openssl1.1_fix_data_mgmt.patch
new file mode 100644
index 000000000000..480f4db3a774
--- /dev/null
+++ b/05-openssl1.1_fix_data_mgmt.patch
@@ -0,0 +1,106 @@
+Author: Philipp Kern <pkern@debian.org>
+Subject: Fix openssl1.1 support in data_mgmt
+Date: Tue, 31 Jan 2017 22:40:10 +0100
+
+
+---
+ src/data_mgmt/data_import.c | 60 ++++++++++++++++++++++++++++----------------
+ 1 file changed, 39 insertions(+), 21 deletions(-)
+
+--- a/src/data_mgmt/data_import.c
++++ b/src/data_mgmt/data_import.c
+@@ -372,7 +372,7 @@ readX509Cert( const char *a_pszFile,
+ goto out;
+ }
+
+- if ( EVP_PKEY_type( pKey->type ) != EVP_PKEY_RSA ) {
++ if ( EVP_PKEY_base_id( pKey ) != EVP_PKEY_RSA ) {
+ logError( TOKEN_RSA_KEY_ERROR );
+
+ X509_free( pX509 );
+@@ -691,8 +691,13 @@ createRsaPubKeyObject( RSA
+
+ int rc = -1;
+
+- int nLen = BN_num_bytes( a_pRsa->n );
+- int eLen = BN_num_bytes( a_pRsa->e );
++ const BIGNUM *bn;
++ const BIGNUM *be;
++
++ RSA_get0_key( a_pRsa, &bn, &be, NULL );
++
++ int nLen = BN_num_bytes( bn );
++ int eLen = BN_num_bytes( be );
+
+ CK_RV rv;
+
+@@ -732,8 +737,8 @@ createRsaPubKeyObject( RSA
+ }
+
+ // Get binary representations of the RSA key information
+- BN_bn2bin( a_pRsa->n, n );
+- BN_bn2bin( a_pRsa->e, e );
++ BN_bn2bin( bn, n );
++ BN_bn2bin( be, e );
+
+ // Create the RSA public key object
+ rv = createObject( a_hSession, tAttr, ulAttrCount, a_hObject );
+@@ -760,14 +765,27 @@ createRsaPrivKeyObject( RSA
+
+ int rc = -1;
+
+- int nLen = BN_num_bytes( a_pRsa->n );
+- int eLen = BN_num_bytes( a_pRsa->e );
+- int dLen = BN_num_bytes( a_pRsa->d );
+- int pLen = BN_num_bytes( a_pRsa->p );
+- int qLen = BN_num_bytes( a_pRsa->q );
+- int dmp1Len = BN_num_bytes( a_pRsa->dmp1 );
+- int dmq1Len = BN_num_bytes( a_pRsa->dmq1 );
+- int iqmpLen = BN_num_bytes( a_pRsa->iqmp );
++ const BIGNUM *bn;
++ const BIGNUM *be;
++ const BIGNUM *bd;
++ const BIGNUM *bp;
++ const BIGNUM *bq;
++ const BIGNUM *bdmp1;
++ const BIGNUM *bdmq1;
++ const BIGNUM *biqmp;
++
++ RSA_get0_key( a_pRsa, &bn, &be, &bd);
++ RSA_get0_factors( a_pRsa, &bp, &bq);
++ RSA_get0_crt_params( a_pRsa, &bdmp1, &bdmq1, &biqmp );
++
++ int nLen = BN_num_bytes( bn );
++ int eLen = BN_num_bytes( be );
++ int dLen = BN_num_bytes( bd );
++ int pLen = BN_num_bytes( bp );
++ int qLen = BN_num_bytes( bq );
++ int dmp1Len = BN_num_bytes( bdmp1 );
++ int dmq1Len = BN_num_bytes( bdmq1 );
++ int iqmpLen = BN_num_bytes( biqmp );
+
+ CK_RV rv;
+
+@@ -821,14 +839,14 @@ createRsaPrivKeyObject( RSA
+ }
+
+ // Get binary representations of the RSA key information
+- BN_bn2bin( a_pRsa->n, n );
+- BN_bn2bin( a_pRsa->e, e );
+- BN_bn2bin( a_pRsa->d, d );
+- BN_bn2bin( a_pRsa->p, p );
+- BN_bn2bin( a_pRsa->q, q );
+- BN_bn2bin( a_pRsa->dmp1, dmp1 );
+- BN_bn2bin( a_pRsa->dmq1, dmq1 );
+- BN_bn2bin( a_pRsa->iqmp, iqmp );
++ BN_bn2bin( bn, n );
++ BN_bn2bin( be, e );
++ BN_bn2bin( bd, d );
++ BN_bn2bin( bp, p );
++ BN_bn2bin( bq, q );
++ BN_bn2bin( bdmp1, dmp1 );
++ BN_bn2bin( bdmq1, dmq1 );
++ BN_bn2bin( biqmp, iqmp );
+
+ // Create the RSA private key object
+ rv = createObject( a_hSession, tAttr, ulAttrCount, a_hObject );
diff --git a/PKGBUILD b/PKGBUILD
index b369994f9820..a882733da0e0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
# Maintainer: mutantmonkey <aur@mutantmonkey.in>
+# Contributor: Gerardo Exequiel Pozzi <djgera@archlinux.org>
# Contributor: Patryk Kowalczyk <patryk AT kowalczyk dot ws>
# Contributor: Robert Buhren <robert@robertbuhren.de>
# Contributor: Gavin Lloyd <gavinhungry@gmail.com>
@@ -7,28 +8,45 @@
pkgname=tpm-tools
pkgver=1.3.9.1
-pkgrel=1
+pkgrel=2
pkgdesc="Tools to manage and diagnose a TPM"
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/trousers"
license=('CPL')
depends=('trousers' 'opencryptoki')
-source=(http://downloads.sourceforge.net/project/trousers/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz)
-sha256sums=('9cb714e2650826e2e932f65bc0ba9d61b927dc5fea47f2c2a2b64f0fdfcbfa68')
+source=(http://downloads.sourceforge.net/project/trousers/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz
+ 01-opencryptoki-soname.patch
+ 03-fix-bool-error-parseStringWithValues.patch
+ 04-fix-FTBFS-clang.patch
+ 05-openssl1.1_fix_data_mgmt.patch)
+noextract=(${pkgname}-${pkgver}.tar.gz)
+sha1sums=('c35cb031c6b5220dd1c8a03995654fdd12aa3031'
+ 'f87849fc46d8c8cab5b7a0fbc1a8de69f3fd1669'
+ 'b40d56f3a7ca3ef231470cc401a73e178b698a4e'
+ '521e9f58e6740bc50979e8dc727a60b82ad4fae0'
+ '3fdf2d39a25f5c2e152ec44a457ffd2f7258d698')
+
+prepare() {
+ mkdir -p ${pkgname}-${pkgver}
+ bsdtar -x -f ${pkgname}-${pkgver}.tar.gz -C ${pkgname}-${pkgver}
+ cd ${pkgname}-${pkgver}
+ patch -p1 -i ${srcdir}/01-opencryptoki-soname.patch
+ patch -p1 -i ${srcdir}/03-fix-bool-error-parseStringWithValues.patch
+ patch -p1 -i ${srcdir}/04-fix-FTBFS-clang.patch
+ patch -p1 -i ${srcdir}/05-openssl1.1_fix_data_mgmt.patch
+}
build() {
- # the tarball for 1.3.9 doesn't have a parent directory
- cd ${srcdir}/
+ cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
- --mandir=/usr/share/man \
- --enable-static \
- --sbindir=/usr/bin
+ --mandir=/usr/share/man \
+ --enable-static \
+ --sbindir=/usr/bin
make
}
package() {
- # the tarball for 1.3.9 doesn't have a parent directory
- cd ${srcdir}/
+ cd ${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
}