From 76eb40af8474fe8a9568a47f5b48c0a0b9c42b82 Mon Sep 17 00:00:00 2001 From: nork Date: Sun, 7 Nov 2010 12:10:03 +0000 Subject: Add tpm-tools 1.3.5, provides a basic set of TPM tools. Obtained from: http://bsssd.sourceforge.net/ --- security/tpm-tools/Makefile | 46 ++++++++++++++++++++++ security/tpm-tools/distinfo | 2 + security/tpm-tools/files/patch-lib-tpm_utils.c | 37 +++++++++++++++++ .../tpm-tools/files/patch-src-cmds-Makefile.am | 11 ++++++ .../tpm-tools/files/patch-src-cmds-Makefile.in | 11 ++++++ .../files/patch-src-tpm_mgmt-tpm_present.c | 11 ++++++ security/tpm-tools/pkg-descr | 1 + security/tpm-tools/pkg-plist | 29 ++++++++++++++ 8 files changed, 148 insertions(+) create mode 100644 security/tpm-tools/Makefile create mode 100644 security/tpm-tools/distinfo create mode 100644 security/tpm-tools/files/patch-lib-tpm_utils.c create mode 100644 security/tpm-tools/files/patch-src-cmds-Makefile.am create mode 100644 security/tpm-tools/files/patch-src-cmds-Makefile.in create mode 100644 security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c create mode 100644 security/tpm-tools/pkg-descr create mode 100644 security/tpm-tools/pkg-plist (limited to 'security/tpm-tools') diff --git a/security/tpm-tools/Makefile b/security/tpm-tools/Makefile new file mode 100644 index 000000000000..9ea1bbc060e8 --- /dev/null +++ b/security/tpm-tools/Makefile @@ -0,0 +1,46 @@ +# New ports collection makefile for: tpm-tools +# Date created: 18 Sep 2007 +# Whom: Sebastian Schuetz +# +# $FreeBSD$ +# + +PORTNAME= tpm-tools +PORTVERSION= 1.3.5 +CATEGORIES= security +MASTER_SITES= SF/trousers/${PORTNAME}/${PORTVERSION} + +MAINTAINER= nork@freebsd.org +COMMENT= Provides a basic set of TPM tools + +LIB_DEPENDS= tspi.2:${PORTSDIR}/security/trousers +BUILD_DEPENDS= pkcsconf:${PORTSDIR}/security/opencryptoki +RUN_DEPENDS= ${LOCALBASE}/sbin/tcsd:${PORTSDIR}/security/trousers +RUN_DEPENDS+= ${LOCALBASE}/lib/pkcs11/libopencryptoki.so:${PORTSDIR}/security/opencryptoki + +USE_GMAKE= YES +USE_ICONV= YES +USE_GETTEXT= YES +USE_LDCONFIG= YES +USE_AUTOTOOLS= autoconf:268 +GNU_CONFIGURE= YES +CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib -lintl -liconv" +MAKE_JOBS_SAFE= YES + +LICENSE= CPL +LICENSE_NAME= Common Public License +LICENSE_FILE= ${WRKSRC}/LICENSE +LICENSE_PERMS= ${_LICENSE_PERMS_DEFAULT} + +MAN1= tpm_sealdata.1 tpm_version.1 \ + tpmtoken_import.1 tpmtoken_init.1 tpmtoken_objects.1 \ + tpmtoken_protect.1 tpmtoken_setpasswd.1 + +MAN3= tpmUnsealFile.3 tpmUnsealShred.3 tpmUnsealStrerror.3 \ + tpm_changeownerauth.8 tpm_clear.8 tpm_createek.8 \ + tpm_getpubek.8 tpm_resetdalock.8 tpm_restrictpubek.8 \ + tpm_revokeek.8 tpm_selftest.8 tpm_setactive.8 \ + tpm_setclearable.8 tpm_setenable.8 tpm_setoperatorauth.8 \ + tpm_setownable.8 tpm_setpresence.8 tpm_takeownership.8 + +.include diff --git a/security/tpm-tools/distinfo b/security/tpm-tools/distinfo new file mode 100644 index 000000000000..ccf684a2125c --- /dev/null +++ b/security/tpm-tools/distinfo @@ -0,0 +1,2 @@ +SHA256 (tpm-tools-1.3.5.tar.gz) = 60717336302bffff5044ed945a79f07594962fa3b989cf37f6eb042874d8fc45 +SIZE (tpm-tools-1.3.5.tar.gz) = 439922 diff --git a/security/tpm-tools/files/patch-lib-tpm_utils.c b/security/tpm-tools/files/patch-lib-tpm_utils.c new file mode 100644 index 000000000000..37ba761c5f74 --- /dev/null +++ b/security/tpm-tools/files/patch-lib-tpm_utils.c @@ -0,0 +1,37 @@ +--- lib/tpm_utils.c.orig 2010-02-02 02:17:23.000000000 +0900 ++++ lib/tpm_utils.c 2010-10-25 01:55:31.065559348 +0900 +@@ -55,6 +55,7 @@ + CmdHelpFunction tCmdHelp = ( a_tCmdHelpFunction ) ? a_tCmdHelpFunction + : logCmdHelp; + ++#ifdef __GCC + char szShortOpts[strlen( pszGenShortOpts ) + + ( ( a_pszShortOpts == NULL ) ? 0 : strlen( a_pszShortOpts ) ) + + 1]; +@@ -64,6 +65,26 @@ + + 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 ) ); ++ iNumGenLongOpts = sizeof( sGenLongOpts ) / sizeof( struct option ); ++ ++ szShortOpts = malloc(iNumShortOpts + 1); ++ 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 ) diff --git a/security/tpm-tools/files/patch-src-cmds-Makefile.am b/security/tpm-tools/files/patch-src-cmds-Makefile.am new file mode 100644 index 000000000000..fb9a9b2727ca --- /dev/null +++ b/security/tpm-tools/files/patch-src-cmds-Makefile.am @@ -0,0 +1,11 @@ +--- src/cmds/Makefile.am.orig 2010-02-02 02:17:23.000000000 +0900 ++++ src/cmds/Makefile.am 2010-10-25 01:55:31.067559744 +0900 +@@ -30,7 +30,7 @@ + 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 ++LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la + + 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 new file mode 100644 index 000000000000..df7974a5ecb6 --- /dev/null +++ b/security/tpm-tools/files/patch-src-cmds-Makefile.in @@ -0,0 +1,11 @@ +--- src/cmds/Makefile.in.orig 2010-02-02 05:59:31.000000000 +0900 ++++ src/cmds/Makefile.in 2010-10-25 01:55:31.069555531 +0900 +@@ -242,7 +242,7 @@ + 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 ++LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la + tpm_sealdata_SOURCES = tpm_sealdata.c + tpm_unsealdata_SOURCES = tpm_unsealdata.c + all: all-am 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 new file mode 100644 index 000000000000..c739ad69a125 --- /dev/null +++ b/security/tpm-tools/files/patch-src-tpm_mgmt-tpm_present.c @@ -0,0 +1,11 @@ +--- src/tpm_mgmt/tpm_present.c.orig 2009-08-20 23:46:31.000000000 +0900 ++++ src/tpm_mgmt/tpm_present.c 2010-10-25 01:55:31.071556276 +0900 +@@ -168,7 +168,7 @@ + TSS_HPOLICY hTpmPolicy; + char *pwd = NULL; + int pswd_len; +- char rsp[5]; ++ char rsp[6]; + int scanCount; + + //get status w/o owner auth (FAILS 1.1, should PASS 1.2) diff --git a/security/tpm-tools/pkg-descr b/security/tpm-tools/pkg-descr new file mode 100644 index 000000000000..377289edc549 --- /dev/null +++ b/security/tpm-tools/pkg-descr @@ -0,0 +1 @@ +tpm-tools package provides a basic TPM management suite. diff --git a/security/tpm-tools/pkg-plist b/security/tpm-tools/pkg-plist new file mode 100644 index 000000000000..28ca623be2c1 --- /dev/null +++ b/security/tpm-tools/pkg-plist @@ -0,0 +1,29 @@ +bin/tpm_sealdata +bin/tpm_unsealdata +bin/tpmtoken_import +bin/tpmtoken_init +bin/tpmtoken_objects +bin/tpmtoken_protect +bin/tpmtoken_setpasswd +include/tpm_tools/tpm_unseal.h +lib/libtpm_unseal.la +lib/libtpm_unseal.so +lib/libtpm_unseal.so.1 +sbin/tpm_changeownerauth +sbin/tpm_clear +sbin/tpm_createek +sbin/tpm_getpubek +sbin/tpm_resetdalock +sbin/tpm_restrictpubek +sbin/tpm_restrictsrk +sbin/tpm_revokeek +sbin/tpm_selftest +sbin/tpm_setactive +sbin/tpm_setclearable +sbin/tpm_setenable +sbin/tpm_setoperatorauth +sbin/tpm_setownable +sbin/tpm_setpresence +sbin/tpm_takeownership +sbin/tpm_version +@dirrm include/tpm_tools -- cgit