aboutsummaryrefslogtreecommitdiff
path: root/security/tpm-tools
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2019-03-03 04:18:31 +0000
committerHiroki Sato <hrs@FreeBSD.org>2019-03-03 04:18:31 +0000
commit7515f9eeb44d8652c0933740996078b8ecb56f9c (patch)
treee4a7a47a3aa1e521e6db6ec2a3b72af83fddc5c5 /security/tpm-tools
parent24b4037afadd4e714322c5d93291911ca083c6f3 (diff)
Notes
Diffstat (limited to 'security/tpm-tools')
-rw-r--r--security/tpm-tools/Makefile8
-rw-r--r--security/tpm-tools/distinfo6
-rw-r--r--security/tpm-tools/files/patch-lib-Makefile.am6
-rw-r--r--security/tpm-tools/files/patch-lib-Makefile.in20
-rw-r--r--security/tpm-tools/files/patch-lib-tpm_utils.c19
-rw-r--r--security/tpm-tools/files/patch-src-cmds-Makefile.am11
-rw-r--r--security/tpm-tools/files/patch-src-cmds-Makefile.in11
-rw-r--r--security/tpm-tools/files/patch-src-data_mgmt-Makefile.am6
-rw-r--r--security/tpm-tools/files/patch-src-data_mgmt-Makefile.in11
-rw-r--r--security/tpm-tools/files/patch-src-data_mgmt-data_import.c79
-rw-r--r--security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvcommon.c12
-rw-r--r--security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvwrite.c4
-rw-r--r--security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c4
13 files changed, 112 insertions, 85 deletions
diff --git a/security/tpm-tools/Makefile b/security/tpm-tools/Makefile
index 3b22b5711dd1..cf3bd7cf726d 100644
--- a/security/tpm-tools/Makefile
+++ b/security/tpm-tools/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= tpm-tools
-PORTVERSION= 1.3.8
+PORTVERSION= 1.3.9.1
CATEGORIES= security
MASTER_SITES= SF/trousers/${PORTNAME}/${PORTVERSION}
@@ -15,12 +15,14 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LIB_DEPENDS= libtspi.so:security/trousers
-BUILD_DEPENDS= pkcsconf:security/opencryptoki
+BUILD_DEPENDS= ${LOCALBASE}/sbin/pkcsconf:security/opencryptoki
RUN_DEPENDS= ${LOCALBASE}/sbin/tcsd:security/trousers \
${LOCALBASE}/lib/pkcs11/libopencryptoki.so:security/opencryptoki
-USES= gettext gmake iconv libtool
+USES= autoreconf gettext gmake iconv libtool ssl
USE_LDCONFIG= YES
+
+NO_WRKSUBDIR= YES
GNU_CONFIGURE= YES
LIBS+= -L${LOCALBASE}/lib -lintl
INSTALL_TARGET= install-strip
diff --git a/security/tpm-tools/distinfo b/security/tpm-tools/distinfo
index 5593970244fc..af6b1b891abe 100644
--- a/security/tpm-tools/distinfo
+++ b/security/tpm-tools/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1463578786
-SHA256 (tpm-tools-1.3.8.tar.gz) = 66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83
-SIZE (tpm-tools-1.3.8.tar.gz) = 473339
+TIMESTAMP = 1551571411
+SHA256 (tpm-tools-1.3.9.1.tar.gz) = 9cb714e2650826e2e932f65bc0ba9d61b927dc5fea47f2c2a2b64f0fdfcbfa68
+SIZE (tpm-tools-1.3.9.1.tar.gz) = 482859
diff --git a/security/tpm-tools/files/patch-lib-Makefile.am b/security/tpm-tools/files/patch-lib-Makefile.am
index 30a2845499a7..3aeee41961e9 100644
--- a/security/tpm-tools/files/patch-lib-Makefile.am
+++ b/security/tpm-tools/files/patch-lib-Makefile.am
@@ -1,11 +1,11 @@
---- lib/Makefile.am.orig 2012-05-17 17:50:39 UTC
+--- lib/Makefile.am.orig 2017-02-21 02:23:56 UTC
+++ lib/Makefile.am
@@ -44,7 +44,7 @@ libtpm_utils_la_SOURCES = tpm_utils.c \
#
# TSPI interface library
libtpm_tspi_la_SOURCES = tpm_tspi.c
--libtpm_tspi_la_LIBADD = libtpm_utils.la -ldl
-+libtpm_tspi_la_LIBADD = libtpm_utils.la
+-libtpm_tspi_la_LIBADD = libtpm_utils.la -ldl @INTLLIBS@
++libtpm_tspi_la_LIBADD = libtpm_utils.la @INTLLIBS@
#
# PKCS#11 interface library
diff --git a/security/tpm-tools/files/patch-lib-Makefile.in b/security/tpm-tools/files/patch-lib-Makefile.in
deleted file mode 100644
index 07904a9866a7..000000000000
--- a/security/tpm-tools/files/patch-lib-Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- lib/Makefile.in.orig 2012-05-17 19:09:27 UTC
-+++ lib/Makefile.in
-@@ -298,7 +298,7 @@ libtpm_utils_la_SOURCES = tpm_utils.c \
- #
- # TSPI interface library
- libtpm_tspi_la_SOURCES = tpm_tspi.c
--libtpm_tspi_la_LIBADD = libtpm_utils.la -ldl
-+libtpm_tspi_la_LIBADD = libtpm_utils.la
- @P11_SUPPORT_TRUE@libtpm_pkcs11_la_SOURCES = tpm_pkcs11.c
- @P11_SUPPORT_TRUE@libtpm_pkcs11_la_LIBADD = libtpm_utils.la
-
-@@ -327,7 +327,7 @@ libtpm_tspi_la_LIBADD = libtpm_utils.la
- # Unseal library - for addition to existing apps, counter part of seal cmd
- libtpm_unseal_la_SOURCES = tpm_unseal.c
- libtpm_unseal_la_LDFLAGS = -shared -version-info 1:0:0
--libtpm_unseal_la_LIBADD = -ltspi libtpm_tspi.la
-+libtpm_unseal_la_LIBADD = -ltspi libtpm_tspi.la -lcrypto
- all: all-am
-
- .SUFFIXES:
diff --git a/security/tpm-tools/files/patch-lib-tpm_utils.c b/security/tpm-tools/files/patch-lib-tpm_utils.c
index aa3b584a66c8..225b52c0d091 100644
--- a/security/tpm-tools/files/patch-lib-tpm_utils.c
+++ b/security/tpm-tools/files/patch-lib-tpm_utils.c
@@ -1,6 +1,6 @@
---- lib/tpm_utils.c.orig 2010-09-30 17:28:09 UTC
+--- lib/tpm_utils.c.orig 2017-02-21 01:23:56 UTC
+++ lib/tpm_utils.c
-@@ -55,6 +55,7 @@ genericOptHandler( int a_iNumArgs, char
+@@ -55,6 +55,7 @@ genericOptHandler( int a_iNumArgs, char **a_pszArgs,
CmdHelpFunction tCmdHelp = ( a_tCmdHelpFunction ) ? a_tCmdHelpFunction
: logCmdHelp;
@@ -8,39 +8,38 @@
char szShortOpts[strlen( pszGenShortOpts )
+ ( ( a_pszShortOpts == NULL ) ? 0 : strlen( a_pszShortOpts ) )
+ 1];
-@@ -64,12 +65,36 @@ genericOptHandler( int a_iNumArgs, char
+@@ -64,12 +65,35 @@ genericOptHandler( int a_iNumArgs, char **a_pszArgs,
int iOpt;
int rc;
+#else
+ int iOpt;
+ int rc;
-+
+
+ char *szShortOpts;
+ int iNumShortOpts, iNumGenLongOpts;
+ struct option *sLongOpts;
+
+ iNumShortOpts = strlen( pszGenShortOpts ) +
-+ ( ( a_pszShortOpts == NULL ) ? 0 : strlen( a_pszShortOpts ) );
++ ( ( a_pszShortOpts == NULL ) ? 0 : strlen( a_pszShortOpts ) );
+ iNumGenLongOpts = sizeof( sGenLongOpts ) / sizeof( struct option );
+
+ szShortOpts = malloc(iNumShortOpts + 1);
-+ sLongOpts = malloc((iNumGenLongOpts + a_iNumOpts + 1)
-+ * sizeof(struct option));
++ sLongOpts = malloc((iNumGenLongOpts + a_iNumOpts + 1)
++ * sizeof(struct option));
+ if( (szShortOpts == NULL) || (sLongOpts == NULL) ) {
+ perror("malloc");
+ return -1;
+ }
+#endif
-
strcpy( szShortOpts, pszGenShortOpts);
if ( a_pszShortOpts )
strcat( szShortOpts, a_pszShortOpts );
+#ifdef __GCC
- memset( sLongOpts, 0, sizeof( sLongOpts ) );
+ __memset( sLongOpts, 0, sizeof( sLongOpts ) );
+#else
-+ memset( sLongOpts, 0, (iNumGenLongOpts + a_iNumOpts + 1) * sizeof(struct option));
++ __memset( sLongOpts, 0, (iNumGenLongOpts + a_iNumOpts + 1) * sizeof(struct option));
+#endif
memcpy( sLongOpts, sGenLongOpts, sizeof( sGenLongOpts ) );
if ( a_sLongOpts ) {
diff --git a/security/tpm-tools/files/patch-src-cmds-Makefile.am b/security/tpm-tools/files/patch-src-cmds-Makefile.am
deleted file mode 100644
index 5d7b6d075850..000000000000
--- a/security/tpm-tools/files/patch-src-cmds-Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/cmds/Makefile.am.orig 2011-08-15 17:52:08 UTC
-+++ src/cmds/Makefile.am
-@@ -30,7 +30,7 @@ else
- AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
- endif
-
--LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -ltpm_unseal -lcrypto
-+LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -lcrypto
-
- tpm_sealdata_SOURCES = tpm_sealdata.c
- tpm_unsealdata_SOURCES = tpm_unsealdata.c
diff --git a/security/tpm-tools/files/patch-src-cmds-Makefile.in b/security/tpm-tools/files/patch-src-cmds-Makefile.in
deleted file mode 100644
index c5dca7605a53..000000000000
--- a/security/tpm-tools/files/patch-src-cmds-Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/cmds/Makefile.in.orig 2012-05-17 19:09:27 UTC
-+++ src/cmds/Makefile.in
-@@ -245,7 +245,7 @@ top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
- @TSS_LIB_IS_12_FALSE@AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
- @TSS_LIB_IS_12_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX -DTSS_LIB_IS_12
--LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -ltpm_unseal -lcrypto
-+LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -lcrypto
- tpm_sealdata_SOURCES = tpm_sealdata.c
- tpm_unsealdata_SOURCES = tpm_unsealdata.c
- all: all-am
diff --git a/security/tpm-tools/files/patch-src-data_mgmt-Makefile.am b/security/tpm-tools/files/patch-src-data_mgmt-Makefile.am
index 59e59879f42f..7ed0f04136f6 100644
--- a/security/tpm-tools/files/patch-src-data_mgmt-Makefile.am
+++ b/security/tpm-tools/files/patch-src-data_mgmt-Makefile.am
@@ -1,11 +1,11 @@
---- src/data_mgmt/Makefile.am.orig 2012-05-17 17:50:29 UTC
+--- src/data_mgmt/Makefile.am.orig 2017-02-21 01:23:57 UTC
+++ src/data_mgmt/Makefile.am
@@ -38,7 +38,7 @@ noinst_HEADERS = data_common.h \
# Common build flags
AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
--LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi -ldl
-+LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi
+-LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi -ldl @INTLLIBS@
++LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi @INTLLIBS@
#
diff --git a/security/tpm-tools/files/patch-src-data_mgmt-Makefile.in b/security/tpm-tools/files/patch-src-data_mgmt-Makefile.in
deleted file mode 100644
index ad9ba4954c84..000000000000
--- a/security/tpm-tools/files/patch-src-data_mgmt-Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/data_mgmt/Makefile.in.orig 2012-05-17 19:09:27 UTC
-+++ src/data_mgmt/Makefile.in
-@@ -274,7 +274,7 @@ noinst_HEADERS = data_common.h \
- #
- # Common build flags
- AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
--LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi -ldl
-+LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi
-
- #
- # TPM Token initialization command
diff --git a/security/tpm-tools/files/patch-src-data_mgmt-data_import.c b/security/tpm-tools/files/patch-src-data_mgmt-data_import.c
new file mode 100644
index 000000000000..7c6d537209c1
--- /dev/null
+++ b/security/tpm-tools/files/patch-src-data_mgmt-data_import.c
@@ -0,0 +1,79 @@
+--- src/data_mgmt/data_import.c.orig 2017-02-21 02:12:00 UTC
++++ 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_type( EVP_PKEY_id(pKey) ) != EVP_PKEY_RSA ) {
+ logError( TOKEN_RSA_KEY_ERROR );
+
+ X509_free( pX509 );
+@@ -691,8 +691,8 @@ createRsaPubKeyObject( RSA *a_pRsa,
+
+ int rc = -1;
+
+- int nLen = BN_num_bytes( a_pRsa->n );
+- int eLen = BN_num_bytes( a_pRsa->e );
++ int nLen = BN_num_bytes( RSA_get0_n(a_pRsa) );
++ int eLen = BN_num_bytes( RSA_get0_e(a_pRsa) );
+
+ CK_RV rv;
+
+@@ -732,8 +732,8 @@ createRsaPubKeyObject( RSA *a_pRsa,
+ }
+
+ // Get binary representations of the RSA key information
+- BN_bn2bin( a_pRsa->n, n );
+- BN_bn2bin( a_pRsa->e, e );
++ BN_bn2bin( RSA_get0_n(a_pRsa), n );
++ BN_bn2bin( RSA_get0_e(a_pRsa), e );
+
+ // Create the RSA public key object
+ rv = createObject( a_hSession, tAttr, ulAttrCount, a_hObject );
+@@ -760,14 +760,14 @@ createRsaPrivKeyObject( RSA *a_pRsa,
+
+ 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 );
++ int nLen = BN_num_bytes( RSA_get0_n(a_pRsa) );
++ int eLen = BN_num_bytes( RSA_get0_e(a_pRsa) );
++ int dLen = BN_num_bytes( RSA_get0_d(a_pRsa) );
++ int pLen = BN_num_bytes( RSA_get0_p(a_pRsa) );
++ int qLen = BN_num_bytes( RSA_get0_q(a_pRsa) );
++ int dmp1Len = BN_num_bytes( RSA_get0_dmp1(a_pRsa) );
++ int dmq1Len = BN_num_bytes( RSA_get0_dmq1(a_pRsa) );
++ int iqmpLen = BN_num_bytes( RSA_get0_iqmp(a_pRsa) );
+
+ CK_RV rv;
+
+@@ -821,14 +821,14 @@ createRsaPrivKeyObject( RSA *a_pRsa,
+ }
+
+ // 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( RSA_get0_n(a_pRsa), n );
++ BN_bn2bin( RSA_get0_e(a_pRsa), e );
++ BN_bn2bin( RSA_get0_d(a_pRsa), d );
++ BN_bn2bin( RSA_get0_p(a_pRsa), p );
++ BN_bn2bin( RSA_get0_q(a_pRsa), q );
++ BN_bn2bin( RSA_get0_dmp1(a_pRsa), dmp1 );
++ BN_bn2bin( RSA_get0_dmq1(a_pRsa), dmq1 );
++ BN_bn2bin( RSA_get0_iqmp(a_pRsa), iqmp );
+
+ // Create the RSA private key object
+ rv = createObject( a_hSession, tAttr, ulAttrCount, a_hObject );
diff --git a/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvcommon.c b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvcommon.c
index 9b4026ebff50..00469154bfaa 100644
--- a/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvcommon.c
+++ b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvcommon.c
@@ -1,17 +1,17 @@
---- src/tpm_mgmt/tpm_nvcommon.c.orig 2011-08-17 12:20:35 UTC
+--- src/tpm_mgmt/tpm_nvcommon.c.orig 2017-02-21 01:23:57 UTC
+++ src/tpm_mgmt/tpm_nvcommon.c
-@@ -140,8 +140,8 @@ int parseStringWithValues(const char *aA
+@@ -140,8 +140,8 @@ int parseStringWithValues(const char *aArg,
aArg);
return -1;
}
-- if (!aArg[offset+numbytes] == '|' &&
-- !aArg[offset+numbytes] == 0) {
-+ if (aArg[offset+numbytes] != '|' &&
+- 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
+@@ -164,8 +164,8 @@ int parseStringWithValues(const char *aArg,
return -1;
}
diff --git a/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvwrite.c b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvwrite.c
index 94e4d0e22e34..a28d09ac08db 100644
--- a/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvwrite.c
+++ b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_nvwrite.c
@@ -1,4 +1,4 @@
---- src/tpm_mgmt/tpm_nvwrite.c.orig 2011-08-17 12:20:35 UTC
+--- src/tpm_mgmt/tpm_nvwrite.c.orig 2017-02-21 01:23:57 UTC
+++ src/tpm_mgmt/tpm_nvwrite.c
@@ -33,6 +33,7 @@ static BOOL nvindex_set;
static unsigned int nvindex;
@@ -8,7 +8,7 @@
static int fillvalue = -1;
static const char *filename;
static BOOL passWellKnown;
-@@ -60,6 +61,7 @@ static int parse(const int aOpt, const c
+@@ -60,6 +61,7 @@ static int parse(const int aOpt, const char *aArg)
if (parseHexOrDecimal(aArg, &length, 0, UINT_MAX,
"length of data") != 0)
return -1;
diff --git a/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c
index 180f3e0c7e8a..b0bc82aa8300 100644
--- a/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c
+++ b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c
@@ -1,6 +1,6 @@
---- src/tpm_mgmt/tpm_present.c.orig 2012-05-17 17:49:58 UTC
+--- src/tpm_mgmt/tpm_present.c.orig 2017-02-21 01:23:57 UTC
+++ src/tpm_mgmt/tpm_present.c
-@@ -168,9 +168,10 @@ static BOOL confirmLifeLock(TSS_HCONTEXT
+@@ -168,9 +168,10 @@ static BOOL confirmLifeLock(TSS_HCONTEXT hContext, TSS
TSS_HPOLICY hTpmPolicy;
char *pwd = NULL;
int pswd_len;