diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-11-25 14:36:20 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-11-25 14:36:20 +0000 |
commit | c3649a2def02c41d837ae1f79dda729ccb91e677 (patch) | |
tree | bea46dff212fdef977fe9094a70a939e8cc21885 /dist | |
download | trousers-c3649a2def02c41d837ae1f79dda729ccb91e677.tar.gz |
Imported Upstream version 0.3.9upstream/0.3.9upstream
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Makefile.am | 17 | ||||
-rw-r--r-- | dist/Makefile.in | 388 | ||||
-rwxr-xr-x | dist/fedora/fedora.initrd.tcsd | 110 | ||||
-rw-r--r-- | dist/fedora/trousers.fc | 4 | ||||
-rw-r--r-- | dist/fedora/trousers.spec.in | 121 | ||||
-rw-r--r-- | dist/fedora/trousers.te | 33 | ||||
-rw-r--r-- | dist/system.data.auth | bin | 0 -> 606 bytes | |||
-rw-r--r-- | dist/system.data.noauth | bin | 0 -> 606 bytes | |||
-rw-r--r-- | dist/tcsd.conf.in | 170 | ||||
-rw-r--r-- | dist/trousers.spec.in | 118 |
10 files changed, 961 insertions, 0 deletions
diff --git a/dist/Makefile.am b/dist/Makefile.am new file mode 100644 index 0000000..4c0a11a --- /dev/null +++ b/dist/Makefile.am @@ -0,0 +1,17 @@ +EXTRA_DIST = system.data.auth system.data.noauth \ + fedora/fedora.initrd.tcsd +install: install-exec-hook + if test ! -e ${DESTDIR}/@sysconfdir@/tcsd.conf; then mkdir -p ${DESTDIR}/@sysconfdir@ && cp tcsd.conf ${DESTDIR}/@sysconfdir@; fi + /bin/chown tss:tss ${DESTDIR}/@sysconfdir@/tcsd.conf || true + /bin/chmod 0600 ${DESTDIR}/@sysconfdir@/tcsd.conf + +install-exec-hook: + /usr/sbin/groupadd tss || true + /usr/sbin/useradd -r tss -g tss || true + /bin/sh -c 'if [ ! -e ${DESTDIR}/@localstatedir@/lib/tpm ];then mkdir -p ${DESTDIR}/@localstatedir@/lib/tpm; fi' + /bin/chown tss:tss ${DESTDIR}/@localstatedir@/lib/tpm || true + /bin/chmod 0700 ${DESTDIR}/@localstatedir@/lib/tpm + +uninstall-hook: + /usr/sbin/userdel tss || true + /usr/sbin/groupdel tss || true diff --git a/dist/Makefile.in b/dist/Makefile.in new file mode 100644 index 0000000..aeb129a --- /dev/null +++ b/dist/Makefile.in @@ -0,0 +1,388 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = dist +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/tcsd.conf.in $(srcdir)/trousers.spec.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = tcsd.conf trousers.spec +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRYPTOLIB = @CRYPTOLIB@ +CRYPTO_PACKAGE = @CRYPTO_PACKAGE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_LIB_DIR = @OPENSSL_LIB_DIR@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RPC = @RPC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TCSD_DEFAULT_PORT = @TCSD_DEFAULT_PORT@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = system.data.auth system.data.noauth \ + fedora/fedora.initrd.tcsd + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign dist/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign dist/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tcsd.conf: $(top_builddir)/config.status $(srcdir)/tcsd.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +trousers.spec: $(top_builddir)/config.status $(srcdir)/trousers.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: install-am install-exec-am install-strip uninstall-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-hook + +install: install-exec-hook + if test ! -e ${DESTDIR}/@sysconfdir@/tcsd.conf; then mkdir -p ${DESTDIR}/@sysconfdir@ && cp tcsd.conf ${DESTDIR}/@sysconfdir@; fi + /bin/chown tss:tss ${DESTDIR}/@sysconfdir@/tcsd.conf || true + /bin/chmod 0600 ${DESTDIR}/@sysconfdir@/tcsd.conf + +install-exec-hook: + /usr/sbin/groupadd tss || true + /usr/sbin/useradd -r tss -g tss || true + /bin/sh -c 'if [ ! -e ${DESTDIR}/@localstatedir@/lib/tpm ];then mkdir -p ${DESTDIR}/@localstatedir@/lib/tpm; fi' + /bin/chown tss:tss ${DESTDIR}/@localstatedir@/lib/tpm || true + /bin/chmod 0700 ${DESTDIR}/@localstatedir@/lib/tpm + +uninstall-hook: + /usr/sbin/userdel tss || true + /usr/sbin/groupdel tss || true + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/dist/fedora/fedora.initrd.tcsd b/dist/fedora/fedora.initrd.tcsd new file mode 100755 index 0000000..512b3c8 --- /dev/null +++ b/dist/fedora/fedora.initrd.tcsd @@ -0,0 +1,110 @@ +#!/bin/bash +# +# Init file for the TrouSerS TCG Core Services daemon +# +# chkconfig: - 90 10 +# description: TrouSerS server daemon +# +# processname: tcsd +# config: /etc/tcsd.conf +# pidfile: /var/run/tcsd.pid +# +# Return values according to LSB for all commands but status: +# 0 - success +# 1 - generic or unspecified error +# 2 - invalid or excess argument(s) +# 3 - unimplemented feature (e.g. "reload") +# 4 - insufficient privilege +# 5 - program is not installed +# 6 - program is not configured +# 7 - program is not running +# + +prog="tcsd" + +# source function library +. /etc/rc.d/init.d/functions + +# Allow anyone to run status +if [ "$1" = "status" ] ; then + status $prog + RETVAL=$? + exit $RETVAL +fi + +# Check that we are root ... so non-root users stop here +test $EUID = 0 || exit 4 + +# pull in sysconfig settings +test -f /etc/sysconfig/tcsd && . /etc/sysconfig/tcsd + +RETVAL=0 + +# Some variables to make the below more readable +TCSD=/usr/sbin/tcsd +PID_FILE=/var/run/tcsd.pid +INSMOD=/sbin/insmod +LSMOD=/sbin/lsmod +GREP=/bin/grep + +load_drivers() +{ + for d in `echo /lib/modules/$(uname -r)/kernel/drivers/char/tpm/tpm_*`; do + $INSMOD $d + if test $? -eq 0; then + break; + fi + done +} + +check_drivers() +{ + $LSMOD | $GREP tpm_ +} + +start() +{ + test -x $TCSD || exit 5 + test -f /etc/tcsd.conf || exit 6 + check_drivers || load_drivers || failure + echo -n $"Starting $prog: " + $TCSD $OPTIONS && success || failure + RETVAL=$? + [ "$RETVAL" = 0 ] && touch /var/lock/subsys/tcsd + echo +} + +stop() +{ + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/tcsd + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + test -f /etc/tcsd.conf || exit 6 + stop + start + ;; + reload|force-reload) + restart + ;; + condrestart|try-restart) + if [ -f /var/lock/subsys/tcsd ] ; then + restart + fi + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}" + RETVAL=3 +esac +exit $RETVAL diff --git a/dist/fedora/trousers.fc b/dist/fedora/trousers.fc new file mode 100644 index 0000000..37d8e66 --- /dev/null +++ b/dist/fedora/trousers.fc @@ -0,0 +1,4 @@ +/usr/sbin/tcsd system_u:object_r:tcsd_exec_t +/etc/tcsd.conf system_u:object_r:tcsd_config_t +/var/lib/tpm(/.*)? system_u:object_r:tcsd_readwrite_t +/dev/tpm(.*) system_u:object_r:tcsd_device_t diff --git a/dist/fedora/trousers.spec.in b/dist/fedora/trousers.spec.in new file mode 100644 index 0000000..6b02ad0 --- /dev/null +++ b/dist/fedora/trousers.spec.in @@ -0,0 +1,121 @@ + +# RPM specfile for the trousers project on Fedora + +%define name @PACKAGE@ +%define version @VERSION@ +%define release 1 + +Name: %{name} +Summary: Implementation of the TCG's Software Stack v1.1 Specification +Version: %{version} +Release: %{release} +License: CPL +Group: Development/Libraries +Source: %{name}-%{version}.tar.gz +Url: http://www.sf.net/projects/trousers +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: libtool, gtk2-devel, openssl-devel +Requires: gtk+ >= 2.0, openssl +Requires(post): /sbin/ldconfig +Requires(post): /sbin/chkconfig +Requires(postun): /sbin/ldconfig +Requires(postun): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service + +%description +TrouSerS is an implementation of the Trusted Computing Group's Software Stack +(TSS) specification. You can use TrouSerS to write applications that make use +of your TPM hardware. TPM hardware can create, store and use RSA keys +securely (without ever being exposed in memory), verify a platform's software +state using cryptographic hashes and more. + +%package devel +Summary: TrouSerS header files and documentation +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +Header files and man pages for use in creating Trusted Computing enabled +applications. + +%prep +%setup -q + +%build +autoreconf +%configure --disable-static --prefix=/usr --libdir=%{_libdir} +make %{?_smp_mflags} + +%clean +[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}; + +# +# $1 is the number of entries in the RPM database for the package after the step is +# executed. So in the post step, if $1 is 1, then this is the first time we've been +# installed. If its 2, we're upgrading. +# +%post +/sbin/ldconfig +if [ $1 = 1 ]; then + /sbin/chkconfig --add tcsd + if [ $? == 0 ]; then + /sbin/chkconfig --level 35 tcsd on + fi +fi + +%post devel -p /sbin/ldconfig + +%install +# This line keeps build machines from being affected +[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}; +mkdir -p ${RPM_BUILD_ROOT} +mkdir -p ${RPM_BUILD_ROOT}/%{_initrddir} +cp dist/fedora/fedora.initrd.tcsd ${RPM_BUILD_ROOT}/%{_initrddir}/tcsd +make install DESTDIR=${RPM_BUILD_ROOT} +rm -f ${RPM_BUILD_ROOT}/%{_libdir}/libtspi.la + +%preun +if [ $1 = 0 ]; then + /sbin/service tcsd stop &> /dev/null + /sbin/chkconfig --del tcsd +fi + +%postun +/sbin/ldconfig +if [ $1 -gt 1 ]; then + /sbin/service tcsd condrestart &>/dev/null +fi + +%postun devel -p /sbin/ldconfig + +%files +%doc README AUTHORS LICENSE +%defattr(755, root, root) +%attr(755, tss, tss) %{_sbindir}/tcsd +%{_libdir}/libtspi.so.? +%{_libdir}/libtspi.so.?.?.? +%config(noreplace) %attr(600, tss, tss) %{_sysconfdir}/tcsd.conf +%attr(644, root, root) %{_mandir}/man5/* +%attr(644, root, root) %{_mandir}/man8/* +%{_initrddir}/tcsd + +# The files to be used by developers, 'trousers-devel' +%files devel +%attr(755, root, root) %{_libdir}/libtspi.so +%defattr(644, root, root) +%{_libdir}/libtddl.a +%{_includedir}/tss/*.h +%{_includedir}/trousers/*.h +%{_mandir}/man3/Tspi_* + +%changelog +* Mon Nov 12 2007 Kent Yoder <kyoder@users.sf.net> - 0.3.1 +- Updated specfile for comments in RHBZ#323441 + +* Wed Jun 07 2006 Kent Yoder <kyoder@users.sf.net> - 0.2.6-1 +- Updated build section to use smp_mflags +- Removed .la file from installed dest and files section + +* Tue Jun 06 2006 Kent Yoder <kyoder@users.sf.net> - 0.2.6-1 +- Initial add of changelog tag for trousers CVS diff --git a/dist/fedora/trousers.te b/dist/fedora/trousers.te new file mode 100644 index 0000000..b244633 --- /dev/null +++ b/dist/fedora/trousers.te @@ -0,0 +1,33 @@ +type tcsd_device_t, device_type, dev_fs; +type tcsd_readwrite_t, file_type; +type tcsd_config_t, file_type, sysadmfile; +daemon_domain(tcsd, `') +general_domain_access(tcsd_t) +allow unconfined_t tcsd_t:process transition; +type_transition unconfined_t tcsd_exec_t:process tcsd_t; +allow tcsd_t tcsd_exec_t:dir r_dir_perms; +allow tcsd_t etc_t:file { read getattr lock ioctl }; +allow tcsd_t etc_t:lnk_file { read getattr }; +allow tcsd_t devtty_t:chr_file { ioctl read getattr lock write append }; +allow tcsd_t devpts_t:chr_file { ioctl read getattr lock write append }; +can_network(tcsd_t) +read_sysctl(tcsd_t, full) +r_dir_file(tcsd_t, usr_t) +r_dir_file(tcsd_t, tcsd_config_t) +rw_dir_file(tcsd_t, tcsd_readwrite_t) +allow tcsd_t tcsd_readwrite_t:file { setattr }; +allow tcsd_t tcsd_readwrite_t:dir { setattr }; +allow tcsd_t tcsd_device_t:chr_file { ioctl read getattr lock write append }; +allow tcsd_t { random_device_t }:chr_file { read getattr }; +allow tcsd_t lib_t:dir r_dir_perms; +allow tcsd_t lib_t:file { rx_file_perms execmod }; +allow tcsd_t lib_t:lnk_file r_file_perms; +allow tcsd_t lib_t:file { rx_file_perms execmod }; +allow tcsd_t lib_t:lnk_file r_file_perms; +allow tcsd_t lib_t:file { rx_file_perms execmod }; +allow tcsd_t lib_t:lnk_file r_file_perms; +allow tcsd_t var_lib_t:dir r_dir_perms; +allow tcsd_t var_lib_t:file { rx_file_perms execmod }; +allow tcsd_t var_lib_t:lnk_file r_file_perms; +allow tcsd_t port_type:tcp_socket { send_msg recv_msg name_bind }; +allow tcsd_t self:capability { chown net_bind_service dac_override fowner fsetid }; diff --git a/dist/system.data.auth b/dist/system.data.auth Binary files differnew file mode 100644 index 0000000..ad10a1c --- /dev/null +++ b/dist/system.data.auth diff --git a/dist/system.data.noauth b/dist/system.data.noauth Binary files differnew file mode 100644 index 0000000..2fc5d1f --- /dev/null +++ b/dist/system.data.noauth diff --git a/dist/tcsd.conf.in b/dist/tcsd.conf.in new file mode 100644 index 0000000..215c23f --- /dev/null +++ b/dist/tcsd.conf.in @@ -0,0 +1,170 @@ + +# +# This is the configuration file for the trousers tcsd. (The Trusted Computing +# Software Stack Core Services Daemon). +# +# Defaults are listed below, commented out +# +# Send questions to: trousers-users@lists.sourceforge.net +# + +# Option: port +# Values: 1 - 65535 +# Description: The port that the tcsd will listen on. +# +# port = 30003 +# + +# Option: num_threads +# Values: 1 - 65535 +# Description: The number of threads that the tcsd will spawn internally. +# +# num_threads = 10 +# + +# Option: system_ps_file +# Values: Any absolute directory path +# Description: Path where the tcsd creates its persistent storage file. +# +# system_ps_file = @localstatedir@/lib/tpm/system.data +# + +# Option: firmware_log_file +# Values: Any absolute directory path +# Description: Path to the file containing the current firmware PCR event +# log data. The interface to this log is usually provided by the TPM +# device driver. +# +# firmware_log_file = /sys/kernel/security/tpm0/binary_bios_measurements +# + +# Option: kernel_log_file +# Values: Any absolute directory path +# Description: Path to the file containing the current kernel PCR event +# log data. By default, this data will be parsed in the format provided +# by the Integrity Measurement Architecture LSM. See +# http://sf.net/projects/linux-ima for more info on getting IMA. +# +# +# kernel_log_file = /sys/kernel/security/ima/binary_runtime_measurements +# + +# Option: firmware_pcrs +# Values: PCR indices, separated by commas (no whitespace) +# Description: A list of PCR indices that are manipulated only by the system +# firmware and therefore are not extended or logged by the TCSD. +# +# firmware_pcrs = +# + +# Option: kernel_pcrs +# Values: PCR indices, separated by commas (no whitespace) +# Description: A list of PCR indices that are manipulated only by the kernel +# and therefore are not extended or logged by the TCSD. +# +# kernel_pcrs = +# + +# Option: platform_cred +# Values: Any absolute directory path (example: /path/to/platform.cert) +# Description: Path to the file containing your TPM's platform credential. +# The platform credential may have been provided to you by your TPM +# manufacturer. If so, set platform_cred to the path to the file on disk. +# Whenever a new TPM identity is created, the credential will be used. See +# Tspi_TPM_CollateIdentityRequest(3) for more information. +# +# platform_cred = +# + +# Option: conformance_cred +# Values: Any absolute directory path (example: /path/to/conformance.cert) +# Description: Path to the file containing your TPM's conformance credential. +# The conformance credential may have been provided to you by your TPM +# manufacturer. If so, set conformance_cred to the path to the file on disk. +# Whenever a new TPM identity is created, the credential will be used. See +# Tspi_TPM_CollateIdentityRequest(3) for more information. +# +# conformance_cred = +# + +# Option: endorsement_cred +# Values: Any absolute directory path (example: /path/to/endorsement.cert) +# Description: Path to the file containing your TPM's endorsement credential. +# The endorsement credential may have been provided to you by your TPM +# manufacturer. If so, set endorsement_cred to the path to the file on disk. +# Whenever a new TPM identity is created, the credential will be used. See +# Tspi_TPM_CollateIdentityRequest(3) for more information. +# +# endorsement_cred = +# + +# Option: remote_ops +# Values: TCS operation names, separated by commas (no whitespace) +# Description: A list of TCS commands which will be allowed to be executed +# on this machine's TCSD by TSP's on non-local hosts (over the internet). +# By default, access to all operations is denied. +# +# possible values: seal - encrypt data bound to PCR values +# unseal - decrypt data bound to PCR values +# registerkey - store keys in system persistent storage [Disk write access!] +# unregisterkey - remove keys from system persistent storage [Disk write access!] +# loadkey - load a key into the TPM +# createkey - create a key using the TPM +# sign - encrypt data using a private key +# random - generate random numbers +# getcapability - query the TCS/TPM for its capabilities +# unbind - decrypt data +# quote - request a signed blob containing all PCR values +# readpubek - access the TPM's Public EndorsementKey +# getregisteredkeybypublicinfo - Search system persistent storage for a public key +# getpubkey - Retrieve a loaded key's public data from inside the TPM +# selftest - execute selftest and test results ordinals +# +# remote_ops = +# + +# Option: enforce_exclusive_transport +# Values: 0 or 1 +# Description: When an application opens a transport session with the TPM, one +# of the options available is an "exclusive" session, meaning that the TPM +# will not execute any commands other than those coming through the transport +# session for the lifetime of the session. The TCSD can choose to enforce this +# option or not. By default, exclusive sessions are not enforced, since this +# could allow for a denial of service to the TPM. +# +# enforce_exclusive_transport = 0 +# + +# Option: host_platform_class +# Values: One of the TCG platform class specifications +# PC_11 - PC Client System, version 1.1 +# PC_12 - PC Client System, version 1.2 +# PDA_12 - PDA System, version 1.2 +# SERVER_12 - Server System, version 1.2 +# MOBILE_12 - Mobile Phone System, version 1.2 +# +# Description: This option determines the host platform (host the TCS system +# is running on) class, among those specified by the Trusted Computing group +# on https://www.trustedcomputinggroup.org/specs/. This class will be reported +# by the TCS daemon when an application queries it using the +# TSS_TCSCAP_PROP_HOST_PLATFORM sub-capability. The default is PC_12. +# +# host_platform_class = PC_12 +# + +# Option: all_platform_classes +# Values: TCG Platform class names, separated by commas (no whitespaces) +# PC_11 - PC Client System, version 1.1 +# PC_12 - PC Client System, version 1.2 +# PDA_12 - PDA System, version 1.2 +# SERVER_12 - Server System, version 1.2 +# MOBILE_12 - Mobile Phone System, version 1.2 +# +# Description: This option determines all the platform classes supported by the +# TCS daemon. This list must not include the value set as "host_platform_class" +# specified above. Since by default TrouSerS supports all TPM 1.2 functionality, +# the default is all 1.2 and 1.1 platform classes. +# +# all_platform_classes = PC_11,PDA_12,SERVER_12,MOBILE_12 +# + diff --git a/dist/trousers.spec.in b/dist/trousers.spec.in new file mode 100644 index 0000000..c49ece4 --- /dev/null +++ b/dist/trousers.spec.in @@ -0,0 +1,118 @@ + +%define name @PACKAGE@ +%define version @VERSION@ +%define release 1 + +%ifarch ppc64 x86_64 ia64 s390x +%define arch64 1 +%define packages64 cairo-devel-64bit, glitz-devel-64bit, fontconfig-devel-64bit, freetype2-devel-64bit, xorg-x11-devel-64bit, libpng-devel-64bit +%define pkgconfig_path /opt/gnome/lib64/pkgconfig:/usr/lib64/pkgconfig +%endif + +# RPM specfile for the trousers project + +Name: %{name} +Summary: Implementation of the TCG's Software Stack v1.1 Specification +Version: %{version} +Release: %{release} +License: CPL +Group: Productivity/Security +Source: %{name}-%{version}.tar.gz +Url: http://www.sf.net/projects/trousers +BuildRoot: %{_tmppath}/%{name}-%{version}-root +PreReq: /usr/sbin/groupadd /usr/sbin/useradd /bin/chown +Requires: gtk+ >= 2.0, openssl +BuildRequires: gtk+ >= 2.0, openssl %{?arch64:,%{packages64}} + +%description +TrouSerS is an implementation of the Trusted Computing Group's Software Stack +(TSS) specification. You can use TrouSerS to write applications that make use +of your TPM hardware. TPM hardware can create, store and use RSA keys +securely (without ever being exposed in memory), verify a platform's software +state using cryptographic hashes and more. + +%package devel +Summary: TrouSerS header files and documentation +Group: Productivity/Security +Requires: trousers + +%description devel +Header files and man pages for use in creating Trusted Computing enabled +applications. + +%prep +%setup + +%build +%{?arch64:export PKG_CONFIG_PATH=%{pkgconfig_path}:$PKG_CONFIG_PATH} +./configure --prefix=/usr --libdir=%{_libdir} +make + +%clean +[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}; + +%pre +# add group tss +/usr/sbin/groupadd tss || { + RC=$? + case $RC in + 9) # group 'tss' already exists + ;; + *) # some other error; fail + echo "Couldn't create group 'tss'. Exiting." + exit $RC;; + esac +} +# add user tss +/usr/sbin/useradd -r tss || { + RC=$? + case $RC in + 9) # user 'tss' already exists + ;; + *) # some other error; fail + echo "Couldn't create user 'tss'. Exiting." + exit $RC;; + esac +} + +%post +# create the default location for the persistent store files +if test -e %{_localstatedir}/tpm; then + mkdir -p %{_localstatedir}/tpm + /bin/chown tss:tss %{_localstatedir}/tpm + /bin/chmod 1777 %{_localstatedir}/tpm +fi + +# chown the daemon +/bin/chown tss:tss %{_sbindir}/tcsd + +/sbin/ldconfig + +%install +# This line keeps build machines from being affected +[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}; +mkdir -p ${RPM_BUILD_ROOT} +make install DESTDIR=${RPM_BUILD_ROOT} + +%postun +/sbin/ldconfig +/usr/sbin/userdel tss +/usr/sbin/groupdel tss + +# The files for the base package, 'trousers' +%files +%doc README AUTHORS +%attr(755, tss, tss) %{_sbindir}/tcsd +%{_libdir}/libtspi.la +%{_libdir}/libtspi.so* +%{_libdir}/libtddl.a +%config %attr(600, tss, tss) %{_sysconfdir}/tcsd.conf +%{_mandir}/man5/* +%{_mandir}/man8/* + +# The files to be used by developers, 'trousers-devel' +%files devel +%{_includedir}/tss/*.h +%{_includedir}/trousers/*.h +%{_mandir}/man3/Tspi_* + |