Initial import of project

This is the initial import of the libtpms library.  The libtpms library
provides software emulation of a Trusted Platform Module (TPM).  It is
intended to be used by applications when a hardware TPM is not adequate.
For example, a hypervisor can use libtpms to emulate an independent TPM
for each of it's virtual machine guests.  The library provides a high-
level API for developers to integrate the emulated TPM support into
their application.

The code was originally written by Kenneth Goldman <kgoldman@us.ibm.com>
and Stefan Berger <stefanb@us.ibm.com>.

The code is licensed under the Modified BSD License.

Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
This commit is contained in:
Corey Bryant 2013-09-27 10:42:51 -05:00
commit a0098eda2d
156 changed files with 135982 additions and 0 deletions

11
CHANGES Normal file
View File

@ -0,0 +1,11 @@
CHANGES - changes for libtpms
version 0.5.1
first public release
- release 7 increased NVRAM area for being able to store more data in
the TPM's NVRAM areas, i.e., X.509 certificates
- release 9 added two more APIs:
- TPM_Free
- TPMLIB_DecodeBlob

140
INSTALL Normal file
View File

@ -0,0 +1,140 @@
This document contains the following sections:
==============================================
- Building libtpms
- Installing libtpms, include files and manpages
- Uninstalling libtpms, include files and manpages
- Installation and uninstallation of libtpms manpages only
Building libtpms:
-----------------
Building libtpms can be done using
make -f makefile-libtpms clean all
This generates the dynamic link library and symbolic links to the library
and places it in the same directory where the sources are.
lrwxrwxrwx 1 root root 12 Feb 2 19:11 libtpms.so -> libtpms.so.0
lrwxrwxrwx 1 root root 16 Feb 2 19:11 libtpms.so.0 -> libtpms.so.0.5.1
-rwxrwxr-x 1 root root 1489596 Feb 2 19:11 libtpms.so.0.5.1
The library is known to build on Linux and Cygwin systems and possible
other Operating Systems that use .so as library extensions.
On Linux systems, libtpms can be built with either one of the following
crypto backends:
- openssl
- freebl
On Cygwin only openssl is available and therefore can only be built with
openssl.
To build for openssl, the following development packages must have been
installed:
- glibc-headers
- openssl-devel
To build for freebl, the following development packages must have been
installed prior to compilation:
- glibc-headers
- nss-softokn-freebl-devel (preferably version 3.12.9-2 or newer)
- nss-softokn-devel (preferably version 3.12.9-2 or newer)
- gmp-devel
By default, libtpms is built with the openssl crypto library, which was
shown above. To build with the freebl crypto library the following command
line can be used
make -f makefile-libtpms CRYPTO_SUBSYSTEM=freebl clean all
To verify that libtpms was built with freebl as the crypto backend, one
can run
ldd libtpms.so
linux-vdso.so.1 => (0x00007fff8d5ff000)
libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x00007f5352a13000)
libnspr4.so => /lib64/libnspr4.so (0x00007f53527d6000)
libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f53525b6000)
libnss3.so => /usr/lib64/libnss3.so (0x00007f535227c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5351ed8000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5351cba000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f5351ab6000)
libplc4.so => /lib64/libplc4.so (0x00007f53518b2000)
libplds4.so => /lib64/libplds4.so (0x00007f53516ae000)
/lib64/ld-linux-x86-64.so.2 (0x0000003a1c000000)
The fact that the libraries libgmp, libnspr4, libnssutil3, libnss3,
libpc4, and libplds4 are linked agaist is an indication that the freebl
library was used for linking.
In case of openssl's libcrypto the output would be the following
linux-vdso.so.1 => (0x00007fffcbdff000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fdb1d00e000)
libc.so.6 => /lib64/libc.so.6 (0x00007fdb1cc6a000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fdb1ca65000)
libz.so.1 => /lib64/libz.so.1 (0x00007fdb1c84e000)
/lib64/ld-linux-x86-64.so.2 (0x0000003a1c000000)
A debug build that prints out __lots__ of debugging information on the
TPM level can be built by invoking make as follows:
make -f makefile-libtpms CRYPTO_SUBSYSTEM=freebl BUILD_TYPE=debug
Installing libtpms, include files and manpages:
-----------------------------------------------
The installation of libtpms, the development include files (headers) and
man pages can be achieved through:
make -f makefile-libtpms install
This will copy libtpms into the standard library directory on your Linux
system such as /usr/lib or /usr/lib64, depending on whether you built for
a 32 bit or 64 bit machine.
The public include files of libtpms will be copied to /usr/include/libtpms.
The man pages explaining the libtpms API will be copied to /usr/share/man.
Uninstalling libtpms, include files and manpages:
-------------------------------------------------
The libtpms library, its development include files (headers) and man pages
can be uninstalled from their standard locations using
make -f makefile-libtpms uninstall
Installation and uninstallation of libtpms man pages only:
----------------------------------------------------------
All API calls of libtpms have a man page. The man pages can be separately
installed using
make -f makefile-libtpms manpages-install
and uninstalled using
make -f makefile-libtpms manpages-uninstall
If the man pages are not installed into the standard man pages directory
the can then be looked at using
man -M ./man TPMLIB_MainInit
from the TPM's source directory that contains the 'man' directory.
The man pages contain explanations on how to use the API as well as examples.

32
LICENSE Normal file
View File

@ -0,0 +1,32 @@
Libtpms license
(c) Copyright IBM Corporation 2006 - 2011
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the names of the IBM Corporation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

42
Makefile.am Normal file
View File

@ -0,0 +1,42 @@
#
# Makefile.am
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2005, 2011 International Business
# Machines Corporation. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the Common Public License as published by
# IBM Corporation; either version 1 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Common Public License for more details.
#
# You should have received a copy of the Common Public License
# along with this program; if not, a copy can be viewed at
# http://www.opensource.org/licenses/cpl1.0.php.
#
SUBDIRS = \
include \
m4 \
man \
src \
tests
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
CHANGES \
INSTALL \
LICENSE \
README \
libtpms.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libtpms.pc

869
Makefile.in Normal file
View File

@ -0,0 +1,869 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@
#
# Makefile.am
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2005, 2011 International Business
# Machines Corporation. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the Common Public License as published by
# IBM Corporation; either version 1 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Common Public License for more details.
#
# You should have received a copy of the Common Public License
# along with this program; if not, a copy can be viewed at
# http://www.opensource.org/licenses/cpl1.0.php.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
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_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/libtpms.pc.in $(top_srcdir)/configure \
$(top_srcdir)/dist/libtpms.spec.in INSTALL config.guess \
config.sub depcomp install-sh ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = dist/libtpms.spec libtpms.pc
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_DEFINES = @DEBUG_DEFINES@
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@
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@
LIBTPMS_VERSION = @LIBTPMS_VERSION@
LIBTPMS_VERSION_INFO = @LIBTPMS_VERSION_INFO@
LIBTPMS_VER_MAJOR = @LIBTPMS_VER_MAJOR@
LIBTPMS_VER_MICRO = @LIBTPMS_VER_MICRO@
LIBTPMS_VER_MINOR = @LIBTPMS_VER_MINOR@
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@
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@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
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@
SUBDIRS = \
include \
m4 \
man \
src \
tests
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
CHANGES \
INSTALL \
LICENSE \
README \
libtpms.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libtpms.pc
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
dist/libtpms.spec: $(top_builddir)/config.status $(top_srcdir)/dist/libtpms.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libtpms.pc: $(top_builddir)/config.status $(srcdir)/libtpms.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
done
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@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
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
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-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-pkgconfigDATA
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-pkgconfigDATA
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck 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-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-pkgconfigDATA install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-pkgconfigDATA
# 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:

89
README Normal file
View File

@ -0,0 +1,89 @@
What is libtpms?
----------------
Libtpms is a library that targets the integration of TPM functionality
into hypervisors, primarily into Qemu. Libtpms provides a very narrow
public API for this purpose so that integration is possible. Only the
minimum of necessary APIs are made publicly available.
It is assumed that the user of libtpms is familiar with the concepts
of the Trusted Platform Module (TPM). For the interaction with libtpms
it is necessary to know how to construct valid TPM commands and to
be able to parse their results. It is not within the scope of libtpms's
documentation to provide background on this. See the section on references
below.
What files does the libtpms package provide?
--------------------------------------------
The main libtpms package provides the following files:
/usr/lib64/libtpms.so.0
/usr/lib64/libtpms.so.0.5.1
/usr/share/doc/libtpms-0.5.1
/usr/share/doc/libtpms-0.5.1/CHANGES
/usr/share/doc/libtpms-0.5.1/LICENSE
/usr/share/doc/libtpms-0.5.1/README
Applications can link with -ltpms.
What files does the libtpms development package provide?
--------------------------------------------------------
The libtpms development package (libtpms-devel) provides the following
include files for applications to use:
tpm_error.h
tpm_library.h
tpm_memory.h
tpm_nvfilename.h
tpm_tis.h
tpm_types.h
These files contain the data structures, data types and API calls supported
by libtpms. It is recommended to not use any other API calls than those
provided in these include files.
All APIs are described in man pages. The man pages are part of the libtpms
development package as well:
TPMLIB_DecodeBlob
TPMLIB_GetTPMProperty
TPMLIB_GetVersion
TPMLIB_MainInit
TPMLIB_Process
TPMLIB_RegisterCallbacks
TPMLIB_Terminate
TPMLIB_VolatileAll_Store
TPM_Free
TPM_IO_Hash_Data
TPM_IO_Hash_End
TPM_IO_Hash_Start
TPM_IO_TpmEstablished_Get
TPM_Malloc
TPM_Realloc
Where can I send bug reports to?
--------------------------------
There's a mailing list on the ibmswtpm project on sourceforge where you can
send bug reports to.
http://sourceforge.net/projects/ibmswtpm/support
Otherwise you may contact us directly.
Stefan Berger, stefanb@us.ibm.com
Kenneth Goldman, kgoldman@us.ibm.com
References:
-----------
Documentation about the Trusted Platform Module (TPM) can be downloaded
from the Trusted Computing Group's website at
http://www.trustedcomputinggroup.org

988
aclocal.m4 vendored Normal file
View File

@ -0,0 +1,988 @@
# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
# Inc.
# This file 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.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
# Foundation, Inc.
#
# This file 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.
# serial 1
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11.6], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11.6])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
#
# This file 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.
# serial 1
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file 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.
# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
# 2010, 2011 Free Software Foundation, Inc.
#
# This file 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.
# serial 12
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file 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.
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file 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.
# serial 16
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
# Inc.
#
# This file 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.
# serial 1
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file 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.
# serial 4
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file 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.
# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
# Inc.
#
# This file 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.
# serial 1
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
# Foundation, Inc.
#
# This file 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.
# serial 5
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Free Software Foundation, Inc.
#
# This file 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.
# serial 5
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
#
# This file 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.
# serial 1
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
#
# This file 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.
# serial 3
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])

1530
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

80
config.h.in Normal file
View File

@ -0,0 +1,80 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#undef HAVE_LIBCRYPTO
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <openssl/aes.h> header file. */
#undef HAVE_OPENSSL_AES_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

1773
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

14857
configure vendored Executable file

File diff suppressed because it is too large Load Diff

114
configure.in Normal file
View File

@ -0,0 +1,114 @@
#
# configure.in
#
# See the LICENSE file for the license associated with this file.
AC_INIT([libtpms], [0.5.1])
AC_PREREQ(2.12)
AC_CONFIG_SRCDIR(Makefile.am)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign 1.6])
LIBTPMS_VER_MAJOR=`echo $PACKAGE_VERSION | awk -F. '{print $1}'`
LIBTPMS_VER_MINOR=`echo $PACKAGE_VERSION | awk -F. '{print $2}'`
LIBTPMS_VER_MICRO=`echo $PACKAGE_VERSION | awk -F. '{print $3}'`
LIBTPMS_VERSION=$PACKAGE_VERSION
LIBTPMS_VERSION_INFO=`expr $LIBTPMS_VER_MAJOR + $LIBTPMS_VER_MINOR`:$LIBTPMS_VER_MICRO:$LIBTPMS_VER_MINOR
AC_SUBST([LIBTPMS_VER_MAJOR])
AC_SUBST([LIBTPMS_VER_MINOR])
AC_SUBST([LIBTPMS_VER_MICRO])
AC_SUBST([LIBTPMS_VERSION])
AC_SUBST([LIBTPMS_VERSION_INFO])
DEBUG=""
AC_MSG_CHECKING([for debug-enabled build])
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [create a debug build]),
[if test "$enableval" = "yes"; then
DEBUG="yes"
AC_MSG_RESULT([yes])
else
DEBUG="no"
AC_MSG_RESULT([no])
fi],
[DEBUG="no",
AC_MSG_RESULT([no])])
# If the user has not set CFLAGS, do something appropriate
test_CFLAGS=${CFLAGS+set}
if test "$test_CFLAGS" != set; then
if test "$DEBUG" == "yes"; then
CFLAGS="-O0 -g -DDEBUG"
else
CFLAGS="-g -O2"
fi
elif test "$DEBUG" == "yes"; then
CFLAGS="$CFLAGS -O0 -g -DDEBUG"
fi
debug_defines=
if test "$DEBUG" == "yes"; then
debug_defines="-DTPM_DEBUG -DTPM_VOLATILE_STORE"
fi
AC_SUBST(DEBUG_DEFINES, $debug_defines)
cryptolib=freebl
AC_ARG_WITH([openssl],
AC_HELP_STRING([--with-openssl],
[build libtpms with openssl library]),
[AC_CHECK_LIB(crypto,
[AES_set_encrypt_key],
[],
AC_MSG_ERROR(Faulty openssl crypto library))
AC_CHECK_HEADERS([openssl/aes.h])
AC_MSG_RESULT([Building with openssl crypto library])
cryptolib=openssl
]
)
case "$cryptolib" in
freebl)
AM_CONDITIONAL(LIBTPMS_USE_FREEBL, true)
AM_CONDITIONAL(LIBTPMS_USE_OPENSSL, false)
;;
openssl)
AM_CONDITIONAL(LIBTPMS_USE_FREEBL, false)
AM_CONDITIONAL(LIBTPMS_USE_OPENSSL, true)
;;
esac
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
#AM_GNU_GETTEXT_VERSION([0.15])
#AM_GNU_GETTEXT([external])
AC_HEADER_STDC
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
CFLAGS="$CFLAGS -Wall -Werror -Wreturn-type -Wsign-compare"
AC_CONFIG_FILES(Makefile \
dist/libtpms.spec \
include/Makefile \
include/libtpms/Makefile \
include/libtpms/tpm_library.h \
m4/Makefile \
man/Makefile \
man/man3/Makefile \
src/Makefile \
libtpms.pc \
tests/Makefile)
AC_OUTPUT
echo "CFLAGS=$CFLAGS"
echo "LDFLAGS=$LDFLAGS"

708
depcomp Executable file
View File

@ -0,0 +1,708 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2012-03-27.16; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# A tabulation character.
tab=' '
# A newline character.
nl='
'
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
# However on
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
# tcc 0.9.26 (FIXME still under development at the moment of writing)
# will emit a similar output, but also prepend the continuation lines
# with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form 'foo.o: dependent.h',
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
< "$tmpdepfile" > "$depfile"
sed '
s/[ '"$tab"'][ '"$tab"']*/ /g
s/^ *//
s/ *\\*$//
s/^[^:]*: *//
/^$/d
/:$/d
s/$/ :/
' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test "$stat" = 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' "$nl" < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

166
dist/libtpms.spec.in vendored Normal file
View File

@ -0,0 +1,166 @@
# --- libtpm rpm-spec ---
%define name @PACKAGE@
%define version @VERSION@
%define release 14
# Valid crypto subsystems are 'freebl' and 'openssl'
%define crypto_subsystem freebl
# Valid build types are 'production' or 'debug'
%define build_type production
Summary: Library providing Trusted Platform Module (TPM) functionality
Name: %{name}
Version: %{version}
Release: %{release}
License: BSD
Group: Development/Libraries
Url: http://sourceforge.net/projects/ibmswtpm
Source: http://bergerstefan.users.sourceforge.net/libtpms/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if %{crypto_subsystem} == openssl
BuildRequires: openssl-devel
%else
BuildRequires: nss-devel >= 3.12.9-2
BuildRequires: nss-softokn-freebl-devel >= 3.12.9-2
BuildRequires: nss-softokn-freebl-static >= 3.12.9-2
BuildRequires: nss-softokn-devel >= 3.12.9-2, gmp-devel
BuildRequires: pkgconfig gawk
Requires: nss-softokn-freebl >= 3.12.9-2, nss-softokn >= 3.12.9-2
%endif
%description
A library providing TPM functionality for VMs. Targeted for integration
into Qemu.
%package devel
Summary: Include files for libtpms
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Libtpms header files and documentation.
%files
%defattr(-, root, root, -)
%{_libdir}/%{name}.la
%{_libdir}/%{name}.so.%{version}
%{_libdir}/%{name}.so.0
%doc LICENSE README CHANGES
%files devel
%defattr(-, root, root, -)
%{_libdir}/%{name}.so
%dir %{_includedir}/%{name}
%attr(644, root, root) %{_libdir}/pkgconfig/*.pc
%attr(644, root, root) %{_includedir}/%{name}/*.h
%attr(644, root, root) %{_mandir}/man3/*
%prep
%setup -q
%build
%if %{crypto_subsystem} == openssl
%define _with_openssl --with-openssl
%endif
%if %{build_type} == debug
%define _enable_debug --enable-debug
%endif
%configure \
--disable-static \
--prefix=/usr \
--libdir=%{_libdir} \
%{?_with_openssl} \
%{?_enable_debug}
make %{?_smp_mflags}
make check
%install
install -d -m 0755 $RPM_BUILD_ROOT%{_libdir}
install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/libtpms
install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man3
make %{?_smp_mflags} install DESTDIR=${RPM_BUILD_ROOT}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog
* Fri Jan 27 2012 Stefan Berger - 0.5.1-14
- fix gcc-4.7 compilation problem
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Dec 20 2011 Dan Horák <dan[at]danny.cz> - 0.5.1-12
- fix build on secondary arches
* Wed Nov 2 2011 Stefan Berger - 0.5.1-11
- added (lib)gmp as runtime dependency
* Tue Oct 8 2011 Stefan Berger - 0.5.1-10
- internal fixes; callback fixes
* Tue Aug 30 2011 Stefan Berger - 0.5.1-9
- new directory structure and build process
* Tue Jul 12 2011 Stefan Berger - 0.5.1-8
- added pkgconfig as build dependency
- enabling __powerpc__ build following Bz 728220
* Wed May 25 2011 Stefan Berger - 0.5.1-7
- increasing NVRAM area space to have enough room for certificates
* Wed May 25 2011 Stefan Berger - 0.5.1-6
- adding libtpms.pc pkg-config file
* Wed Apr 13 2011 Stefan Berger - 0.5.1-5
- adding BuildRequires for nss-softokn-freebl-static
- several libtpms-internal changes around state serialization and
deserialization
- fixes to libtpms makefile (makefile-libtpms)
- adding build_type to generate a debug or production build
- need nss-devel to have nss-config
* Tue Mar 08 2011 Stefan Berger - 0.5.1-4
- small fixes to libtpms makefile
* Fri Feb 25 2011 Stefan Berger - 0.5.1-3
- removing release from tar ball name
- Use {?_smp_mflags} for make rather than hardcoding it
- Fixing post and postun scripts; removing the scripts for devel package
- Fixing usage of defattr
- Adding version information into the changelog headers and spaces between the changelog entries
- Adding LICENSE, README and CHANGELOG file into tar ball and main rpm
- Removing clean section
- removed command to clean the build root
- adding library version to the libries required for building and during
runtime
- Extended Requires in devel package with {?_isa}
* Fri Feb 18 2011 Stefan Berger - 0.5.1-2
- make rpmlint happy by replacing tabs with spaces
- providing a valid URL for the tgz file
- release is now 2 -> 0.5.1-2
* Mon Jan 17 2011 Stefan Berger - 0.5.1-1
- Update version to 0.5.1
* Fri Jan 14 2011 Stefan Berger - 0.5.0-1
- Changes following Fedora review comments
* Tue Dec 02 2010 Stefan Berger
- Small tweaks after reading the FedoreCore packaging requirements
* Tue Nov 16 2010 Stefan Berger
- Created initial version of rpm spec files
- Version of library is now 0.5.0
- Debuginfo rpm is built but empty -- seems to be a known problem
Check https://bugzilla.redhat.com/show_bug.cgi?id=209316

7
include/Makefile.am Normal file
View File

@ -0,0 +1,7 @@
#
# include/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
SUBDIRS = libtpms

596
include/Makefile.in Normal file
View File

@ -0,0 +1,596 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@
#
# include/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
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 = include
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_DEFINES = @DEBUG_DEFINES@
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@
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@
LIBTPMS_VERSION = @LIBTPMS_VERSION@
LIBTPMS_VERSION_INFO = @LIBTPMS_VERSION_INFO@
LIBTPMS_VER_MAJOR = @LIBTPMS_VER_MAJOR@
LIBTPMS_VER_MICRO = @LIBTPMS_VER_MICRO@
LIBTPMS_VER_MINOR = @LIBTPMS_VER_MINOR@
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@
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@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
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@
SUBDIRS = libtpms
all: all-recursive
.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 include/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign include/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):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
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-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic clean-libtool \
ctags ctags-recursive distclean distclean-generic \
distclean-libtool distclean-tags 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-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 installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
# 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:

View File

@ -0,0 +1,15 @@
#
# include/libtpms/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
libtpmsincludedir = $(includedir)/libtpms
libtpmsinclude_HEADERS = \
tpm_error.h \
tpm_library.h \
tpm_memory.h \
tpm_nvfilename.h \
tpm_tis.h \
tpm_types.h

512
include/libtpms/Makefile.in Normal file
View File

@ -0,0 +1,512 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@
#
# include/libtpms/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
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 = include/libtpms
DIST_COMMON = $(libtpmsinclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/tpm_library.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = tpm_library.h
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libtpmsincludedir)"
HEADERS = $(libtpmsinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
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@
CYGPATH_W = @CYGPATH_W@
DEBUG_DEFINES = @DEBUG_DEFINES@
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@
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@
LIBTPMS_VERSION = @LIBTPMS_VERSION@
LIBTPMS_VERSION_INFO = @LIBTPMS_VERSION_INFO@
LIBTPMS_VER_MAJOR = @LIBTPMS_VER_MAJOR@
LIBTPMS_VER_MICRO = @LIBTPMS_VER_MICRO@
LIBTPMS_VER_MINOR = @LIBTPMS_VER_MINOR@
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@
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@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
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@
libtpmsincludedir = $(includedir)/libtpms
libtpmsinclude_HEADERS = \
tpm_error.h \
tpm_library.h \
tpm_memory.h \
tpm_nvfilename.h \
tpm_tis.h \
tpm_types.h
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 include/libtpms/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign include/libtpms/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):
tpm_library.h: $(top_builddir)/config.status $(srcdir)/tpm_library.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-libtpmsincludeHEADERS: $(libtpmsinclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(libtpmsinclude_HEADERS)'; test -n "$(libtpmsincludedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(libtpmsincludedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libtpmsincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libtpmsincludedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(libtpmsincludedir)" || exit $$?; \
done
uninstall-libtpmsincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(libtpmsinclude_HEADERS)'; test -n "$(libtpmsincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(libtpmsincludedir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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 $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libtpmsincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
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 distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-libtpmsincludeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
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: uninstall-libtpmsincludeHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool ctags distclean distclean-generic \
distclean-libtool distclean-tags 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-html install-html-am install-info \
install-info-am install-libtpmsincludeHEADERS 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 \
tags uninstall uninstall-am uninstall-libtpmsincludeHEADERS
# 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:

249
include/libtpms/tpm_error.h Normal file
View File

@ -0,0 +1,249 @@
/********************************************************************************/
/* */
/* Error Response */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_error.h 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_ERROR_H
#define TPM_ERROR_H
/* 16. Return codes rev 99
The TPM has five types of return code. One indicates successful operation and four indicate
failure. TPM_SUCCESS (00000000) indicates successful execution. The failure reports are:
TPM defined fatal errors (00000001 to 000003FF), vendor defined fatal errors (00000400 to
000007FF), TPM defined non-fatal errors (00000800 to 00000BFF), and vendor defined
non-fatal errors (00000C00 to 00000FFF).
The range of vendor defined non-fatal errors was determined by the TSS-WG, which defined
XXXX YCCC with XXXX as OS specific and Y defining the TSS SW stack layer (0: TPM layer)
All failure cases return only a non-authenticated fixed set of information. This is because
the failure may have been due to authentication or other factors, and there is no possibility
of producing an authenticated response.
Fatal errors also terminate any authorization sessions. This is a result of returning only the
error code, as there is no way to return the nonces necessary to maintain an authorization
session. Non-fatal errors do not terminate authorization sessions.
The return code MUST use the following base. The return code MAY be TCG defined or vendor
defined. */
#define TPM_BASE 0x0 /* The start of TPM return codes */
#define TPM_SUCCESS TPM_BASE /* Successful completion of the operation */
#define TPM_VENDOR_ERROR TPM_Vendor_Specific32 /* Mask to indicate that the error code is
vendor specific for vendor specific
commands. */
#define TPM_NON_FATAL 0x00000800 /* Mask to indicate that the error code is a non-fatal
failure. */
/* TPM-defined fatal error codes */
#define TPM_AUTHFAIL TPM_BASE + 1 /* Authentication failed */
#define TPM_BADINDEX TPM_BASE + 2 /* The index to a PCR, DIR or other register is
incorrect */
#define TPM_BAD_PARAMETER TPM_BASE + 3 /* One or more parameter is bad */
#define TPM_AUDITFAILURE TPM_BASE + 4 /* An operation completed successfully but the auditing
of that operation failed. */
#define TPM_CLEAR_DISABLED TPM_BASE + 5 /* The clear disable flag is set and all clear
operations now require physical access */
#define TPM_DEACTIVATED TPM_BASE + 6 /* The TPM is deactivated */
#define TPM_DISABLED TPM_BASE + 7 /* The TPM is disabled */
#define TPM_DISABLED_CMD TPM_BASE + 8 /* The target command has been disabled */
#define TPM_FAIL TPM_BASE + 9 /* The operation failed */
#define TPM_BAD_ORDINAL TPM_BASE + 10 /* The ordinal was unknown or inconsistent */
#define TPM_INSTALL_DISABLED TPM_BASE + 11 /* The ability to install an owner is disabled */
#define TPM_INVALID_KEYHANDLE TPM_BASE + 12 /* The key handle presented was invalid */
#define TPM_KEYNOTFOUND TPM_BASE + 13 /* The target key was not found */
#define TPM_INAPPROPRIATE_ENC TPM_BASE + 14 /* Unacceptable encryption scheme */
#define TPM_MIGRATEFAIL TPM_BASE + 15 /* Migration authorization failed */
#define TPM_INVALID_PCR_INFO TPM_BASE + 16 /* PCR information could not be interpreted */
#define TPM_NOSPACE TPM_BASE + 17 /* No room to load key. */
#define TPM_NOSRK TPM_BASE + 18 /* There is no SRK set */
#define TPM_NOTSEALED_BLOB TPM_BASE + 19 /* An encrypted blob is invalid or was not created by
this TPM */
#define TPM_OWNER_SET TPM_BASE + 20 /* There is already an Owner */
#define TPM_RESOURCES TPM_BASE + 21 /* The TPM has insufficient internal resources to
perform the requested action. */
#define TPM_SHORTRANDOM TPM_BASE + 22 /* A random string was too short */
#define TPM_SIZE TPM_BASE + 23 /* The TPM does not have the space to perform the
operation. */
#define TPM_WRONGPCRVAL TPM_BASE + 24 /* The named PCR value does not match the current PCR
value. */
#define TPM_BAD_PARAM_SIZE TPM_BASE + 25 /* The paramSize argument to the command has the
incorrect value */
#define TPM_SHA_THREAD TPM_BASE + 26 /* There is no existing SHA-1 thread. */
#define TPM_SHA_ERROR TPM_BASE + 27 /* The calculation is unable to proceed because the
existing SHA-1 thread has already encountered an
error. */
#define TPM_FAILEDSELFTEST TPM_BASE + 28 /* Self-test has failed and the TPM has shutdown. */
#define TPM_AUTH2FAIL TPM_BASE + 29 /* The authorization for the second key in a 2 key
function failed authorization */
#define TPM_BADTAG TPM_BASE + 30 /* The tag value sent to for a command is invalid */
#define TPM_IOERROR TPM_BASE + 31 /* An IO error occurred transmitting information to
the TPM */
#define TPM_ENCRYPT_ERROR TPM_BASE + 32 /* The encryption process had a problem. */
#define TPM_DECRYPT_ERROR TPM_BASE + 33 /* The decryption process did not complete. */
#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 /* An invalid handle was used. */
#define TPM_NO_ENDORSEMENT TPM_BASE + 35 /* The TPM does not a EK installed */
#define TPM_INVALID_KEYUSAGE TPM_BASE + 36 /* The usage of a key is not allowed */
#define TPM_WRONG_ENTITYTYPE TPM_BASE + 37 /* The submitted entity type is not allowed */
#define TPM_INVALID_POSTINIT TPM_BASE + 38 /* The command was received in the wrong sequence
relative to TPM_Init and a subsequent TPM_Startup
*/
#define TPM_INAPPROPRIATE_SIG TPM_BASE + 39 /* Signed data cannot include additional DER
information */
#define TPM_BAD_KEY_PROPERTY TPM_BASE + 40 /* The key properties in TPM_KEY_PARMs are not
supported by this TPM */
#define TPM_BAD_MIGRATION TPM_BASE + 41 /* The migration properties of this key are incorrect.
*/
#define TPM_BAD_SCHEME TPM_BASE + 42 /* The signature or encryption scheme for this key is
incorrect or not permitted in this situation. */
#define TPM_BAD_DATASIZE TPM_BASE + 43 /* The size of the data (or blob) parameter is bad or
inconsistent with the referenced key */
#define TPM_BAD_MODE TPM_BASE + 44 /* A mode parameter is bad, such as capArea or
subCapArea for TPM_GetCapability, physicalPresence
parameter for TPM_PhysicalPresence, or
migrationType for TPM_CreateMigrationBlob. */
#define TPM_BAD_PRESENCE TPM_BASE + 45 /* Either the physicalPresence or physicalPresenceLock
bits have the wrong value */
#define TPM_BAD_VERSION TPM_BASE + 46 /* The TPM cannot perform this version of the
capability */
#define TPM_NO_WRAP_TRANSPORT TPM_BASE + 47 /* The TPM does not allow for wrapped transport
sessions */
#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 /* TPM audit construction failed and the
underlying command was returning a failure
code also */
#define TPM_AUDITFAIL_SUCCESSFUL TPM_BASE + 49 /* TPM audit construction failed and the underlying
command was returning success */
#define TPM_NOTRESETABLE TPM_BASE + 50 /* Attempt to reset a PCR register that does not have
the resettable attribute */
#define TPM_NOTLOCAL TPM_BASE + 51 /* Attempt to reset a PCR register that requires
locality and locality modifier not part of command
transport */
#define TPM_BAD_TYPE TPM_BASE + 52 /* Make identity blob not properly typed */
#define TPM_INVALID_RESOURCE TPM_BASE + 53 /* When saving context identified resource type does
not match actual resource */
#define TPM_NOTFIPS TPM_BASE + 54 /* The TPM is attempting to execute a command only
available when in FIPS mode */
#define TPM_INVALID_FAMILY TPM_BASE + 55 /* The command is attempting to use an invalid family
ID */
#define TPM_NO_NV_PERMISSION TPM_BASE + 56 /* The permission to manipulate the NV storage is not
available */
#define TPM_REQUIRES_SIGN TPM_BASE + 57 /* The operation requires a signed command */
#define TPM_KEY_NOTSUPPORTED TPM_BASE + 58 /* Wrong operation to load an NV key */
#define TPM_AUTH_CONFLICT TPM_BASE + 59 /* NV_LoadKey blob requires both owner and blob
authorization */
#define TPM_AREA_LOCKED TPM_BASE + 60 /* The NV area is locked and not writable */
#define TPM_BAD_LOCALITY TPM_BASE + 61 /* The locality is incorrect for the attempted
operation */
#define TPM_READ_ONLY TPM_BASE + 62 /* The NV area is read only and can't be written to
*/
#define TPM_PER_NOWRITE TPM_BASE + 63 /* There is no protection on the write to the NV area
*/
#define TPM_FAMILYCOUNT TPM_BASE + 64 /* The family count value does not match */
#define TPM_WRITE_LOCKED TPM_BASE + 65 /* The NV area has already been written to */
#define TPM_BAD_ATTRIBUTES TPM_BASE + 66 /* The NV area attributes conflict */
#define TPM_INVALID_STRUCTURE TPM_BASE + 67 /* The structure tag and version are invalid or
inconsistent */
#define TPM_KEY_OWNER_CONTROL TPM_BASE + 68 /* The key is under control of the TPM Owner and can
only be evicted by the TPM Owner. */
#define TPM_BAD_COUNTER TPM_BASE + 69 /* The counter handle is incorrect */
#define TPM_NOT_FULLWRITE TPM_BASE + 70 /* The write is not a complete write of the area */
#define TPM_CONTEXT_GAP TPM_BASE + 71 /* The gap between saved context counts is too large
*/
#define TPM_MAXNVWRITES TPM_BASE + 72 /* The maximum number of NV writes without an owner
has been exceeded */
#define TPM_NOOPERATOR TPM_BASE + 73 /* No operator authorization value is set */
#define TPM_RESOURCEMISSING TPM_BASE + 74 /* The resource pointed to by context is not loaded
*/
#define TPM_DELEGATE_LOCK TPM_BASE + 75 /* The delegate administration is locked */
#define TPM_DELEGATE_FAMILY TPM_BASE + 76 /* Attempt to manage a family other then the delegated
family */
#define TPM_DELEGATE_ADMIN TPM_BASE + 77 /* Delegation table management not enabled */
#define TPM_TRANSPORT_NOTEXCLUSIVE TPM_BASE + 78 /* There was a command executed outside of an
exclusive transport session */
#define TPM_OWNER_CONTROL TPM_BASE + 79 /* Attempt to context save a owner evict controlled
key */
#define TPM_DAA_RESOURCES TPM_BASE + 80 /* The DAA command has no resources available to
execute the command */
#define TPM_DAA_INPUT_DATA0 TPM_BASE + 81 /* The consistency check on DAA parameter inputData0
has failed. */
#define TPM_DAA_INPUT_DATA1 TPM_BASE + 82 /* The consistency check on DAA parameter inputData1
has failed. */
#define TPM_DAA_ISSUER_SETTINGS TPM_BASE + 83 /* The consistency check on DAA_issuerSettings has
failed. */
#define TPM_DAA_TPM_SETTINGS TPM_BASE + 84 /* The consistency check on DAA_tpmSpecific has
failed. */
#define TPM_DAA_STAGE TPM_BASE + 85 /* The atomic process indicated by the submitted DAA
command is not the expected process. */
#define TPM_DAA_ISSUER_VALIDITY TPM_BASE + 86 /* The issuer's validity check has detected an
inconsistency */
#define TPM_DAA_WRONG_W TPM_BASE + 87 /* The consistency check on w has failed. */
#define TPM_BAD_HANDLE TPM_BASE + 88 /* The handle is incorrect */
#define TPM_BAD_DELEGATE TPM_BASE + 89 /* Delegation is not correct */
#define TPM_BADCONTEXT TPM_BASE + 90 /* The context blob is invalid */
#define TPM_TOOMANYCONTEXTS TPM_BASE + 91 /* Too many contexts held by the TPM */
#define TPM_MA_TICKET_SIGNATURE TPM_BASE + 92 /* Migration authority signature validation failure
*/
#define TPM_MA_DESTINATION TPM_BASE + 93 /* Migration destination not authenticated */
#define TPM_MA_SOURCE TPM_BASE + 94 /* Migration source incorrect */
#define TPM_MA_AUTHORITY TPM_BASE + 95 /* Incorrect migration authority */
#define TPM_PERMANENTEK TPM_BASE + 97 /* Attempt to revoke the EK and the EK is not revocable */
#define TPM_BAD_SIGNATURE TPM_BASE + 98 /* Bad signature of CMK ticket */
#define TPM_NOCONTEXTSPACE TPM_BASE + 99 /* There is no room in the context list for additional
contexts */
/* As error codes are added here, they should also be added to lib/miscfunc.c */
/* TPM-defined non-fatal errors */
#define TPM_RETRY TPM_BASE + TPM_NON_FATAL /* The TPM is too busy to respond to the
command immediately, but the command
could be submitted at a later time */
#define TPM_NEEDS_SELFTEST TPM_BASE + TPM_NON_FATAL + 1 /* TPM_ContinueSelfTest has has not
been run*/
#define TPM_DOING_SELFTEST TPM_BASE + TPM_NON_FATAL + 2 /* The TPM is currently executing the
actions of TPM_ContinueSelfTest
because the ordinal required
resources that have not been
tested. */
#define TPM_DEFEND_LOCK_RUNNING TPM_BASE + TPM_NON_FATAL + 3
/* The TPM is defending against dictionary
attacks and is in some time-out
period. */
#endif

View File

@ -0,0 +1,128 @@
/********************************************************************************/
/* */
/* LibTPM interface functions */
/* Written by Stefan Berger */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_library.h 4623 2011-09-28 15:15:09Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_LIBRARY_H
#define TPM_LIBRARY_H
#include <stdint.h>
#include <sys/types.h>
#include "tpm_types.h"
#define TPM_LIBRARY_VER_MAJOR 0
#define TPM_LIBRARY_VER_MINOR 5
#define TPM_LIBRARY_VER_MICRO 1
#define TPM_LIBRARY_VERSION_GEN(MAJ, MIN, MICRO) \
(( MAJ << 16 ) | ( MIN << 8 ) | ( MICRO ))
#define TPM_LIBRARY_VERSION \
TPM_LIBRARY_VERSION_GEN(TPM_LIBRARY_VER_MAJOR, \
TPM_LIBRARY_VER_MINOR, \
TPM_LIBRARY_VER_MICRO)
uint32_t TPMLIB_GetVersion(void);
TPM_RESULT TPMLIB_MainInit(void);
void TPMLIB_Terminate(void);
TPM_RESULT TPMLIB_Process(unsigned char **respbuffer, uint32_t *resp_size,
uint32_t *respbufsize,
unsigned char *command, uint32_t command_size);
TPM_RESULT TPMLIB_VolatileAll_Store(unsigned char **buffer, uint32_t *buflen);
enum TPMLIB_TPMProperty {
TPMPROP_TPM_RSA_KEY_LENGTH_MAX = 1,
TPMPROP_TPM_BUFFER_MAX,
TPMPROP_TPM_KEY_HANDLES,
TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES,
TPMPROP_TPM_MIN_AUTH_SESSIONS,
TPMPROP_TPM_MIN_TRANS_SESSIONS,
TPMPROP_TPM_MIN_DAA_SESSIONS,
TPMPROP_TPM_MIN_SESSION_LIST,
TPMPROP_TPM_MIN_COUNTERS,
TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN,
TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN,
TPMPROP_TPM_SPACE_SAFETY_MARGIN,
TPMPROP_TPM_MAX_NV_SPACE,
TPMPROP_TPM_MAX_SAVESTATE_SPACE,
TPMPROP_TPM_MAX_VOLATILESTATE_SPACE,
};
TPM_RESULT TPMLIB_GetTPMProperty(enum TPMLIB_TPMProperty prop, int *result);
struct libtpms_callbacks {
int sizeOfStruct;
TPM_RESULT (*tpm_nvram_init)(void);
TPM_RESULT (*tpm_nvram_loaddata)(unsigned char **data,
uint32_t *length,
uint32_t tpm_number,
const char *name);
TPM_RESULT (*tpm_nvram_storedata)(const unsigned char *data,
uint32_t length,
uint32_t tpm_number,
const char *name);
TPM_RESULT (*tpm_nvram_deletename)(uint32_t tpm_number,
const char *name,
TPM_BOOL mustExist);
TPM_RESULT (*tpm_io_init)(void);
TPM_RESULT (*tpm_io_getlocality)(TPM_MODIFIER_INDICATOR *localityModifer,
uint32_t tpm_number);
TPM_RESULT (*tpm_io_getphysicalpresence)(TPM_BOOL *physicalPresence,
uint32_t tpm_number);
};
TPM_RESULT TPMLIB_RegisterCallbacks(struct libtpms_callbacks *);
enum TPMLIB_BlobType {
TPMLIB_BLOB_TYPE_INITSTATE,
TPMLIB_BLOB_TYPE_LAST,
};
#define TPMLIB_INITSTATE_START_TAG "-----BEGIN INITSTATE-----"
#define TPMLIB_INITSTATE_END_TAG "-----END INITSTATE-----"
TPM_RESULT TPMLIB_DecodeBlob(const char *data, enum TPMLIB_BlobType type,
unsigned char **result, size_t *result_len);
#endif /* TPM_LIBRARY_H */

View File

@ -0,0 +1,128 @@
/********************************************************************************/
/* */
/* LibTPM interface functions */
/* Written by Stefan Berger */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_library.h 4623 2011-09-28 15:15:09Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_LIBRARY_H
#define TPM_LIBRARY_H
#include <stdint.h>
#include <sys/types.h>
#include "tpm_types.h"
#define TPM_LIBRARY_VER_MAJOR @LIBTPMS_VER_MAJOR@
#define TPM_LIBRARY_VER_MINOR @LIBTPMS_VER_MINOR@
#define TPM_LIBRARY_VER_MICRO @LIBTPMS_VER_MICRO@
#define TPM_LIBRARY_VERSION_GEN(MAJ, MIN, MICRO) \
(( MAJ << 16 ) | ( MIN << 8 ) | ( MICRO ))
#define TPM_LIBRARY_VERSION \
TPM_LIBRARY_VERSION_GEN(TPM_LIBRARY_VER_MAJOR, \
TPM_LIBRARY_VER_MINOR, \
TPM_LIBRARY_VER_MICRO)
uint32_t TPMLIB_GetVersion(void);
TPM_RESULT TPMLIB_MainInit(void);
void TPMLIB_Terminate(void);
TPM_RESULT TPMLIB_Process(unsigned char **respbuffer, uint32_t *resp_size,
uint32_t *respbufsize,
unsigned char *command, uint32_t command_size);
TPM_RESULT TPMLIB_VolatileAll_Store(unsigned char **buffer, uint32_t *buflen);
enum TPMLIB_TPMProperty {
TPMPROP_TPM_RSA_KEY_LENGTH_MAX = 1,
TPMPROP_TPM_BUFFER_MAX,
TPMPROP_TPM_KEY_HANDLES,
TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES,
TPMPROP_TPM_MIN_AUTH_SESSIONS,
TPMPROP_TPM_MIN_TRANS_SESSIONS,
TPMPROP_TPM_MIN_DAA_SESSIONS,
TPMPROP_TPM_MIN_SESSION_LIST,
TPMPROP_TPM_MIN_COUNTERS,
TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN,
TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN,
TPMPROP_TPM_SPACE_SAFETY_MARGIN,
TPMPROP_TPM_MAX_NV_SPACE,
TPMPROP_TPM_MAX_SAVESTATE_SPACE,
TPMPROP_TPM_MAX_VOLATILESTATE_SPACE,
};
TPM_RESULT TPMLIB_GetTPMProperty(enum TPMLIB_TPMProperty prop, int *result);
struct libtpms_callbacks {
int sizeOfStruct;
TPM_RESULT (*tpm_nvram_init)(void);
TPM_RESULT (*tpm_nvram_loaddata)(unsigned char **data,
uint32_t *length,
uint32_t tpm_number,
const char *name);
TPM_RESULT (*tpm_nvram_storedata)(const unsigned char *data,
uint32_t length,
uint32_t tpm_number,
const char *name);
TPM_RESULT (*tpm_nvram_deletename)(uint32_t tpm_number,
const char *name,
TPM_BOOL mustExist);
TPM_RESULT (*tpm_io_init)(void);
TPM_RESULT (*tpm_io_getlocality)(TPM_MODIFIER_INDICATOR *localityModifer,
uint32_t tpm_number);
TPM_RESULT (*tpm_io_getphysicalpresence)(TPM_BOOL *physicalPresence,
uint32_t tpm_number);
};
TPM_RESULT TPMLIB_RegisterCallbacks(struct libtpms_callbacks *);
enum TPMLIB_BlobType {
TPMLIB_BLOB_TYPE_INITSTATE,
TPMLIB_BLOB_TYPE_LAST,
};
#define TPMLIB_INITSTATE_START_TAG "-----BEGIN INITSTATE-----"
#define TPMLIB_INITSTATE_END_TAG "-----END INITSTATE-----"
TPM_RESULT TPMLIB_DecodeBlob(const char *data, enum TPMLIB_BlobType type,
unsigned char **result, size_t *result_len);
#endif /* TPM_LIBRARY_H */

View File

@ -0,0 +1,49 @@
/********************************************************************************/
/* */
/* TPM Memory Allocation */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_memory.h 4609 2011-08-26 19:27:38Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_MEMORY_H
#define TPM_MEMORY_H
#include "tpm_types.h"
TPM_RESULT TPM_Malloc(unsigned char **buffer, uint32_t size);
TPM_RESULT TPM_Realloc(unsigned char **buffer, uint32_t size);
void TPM_Free(unsigned char *buffer);
#endif

View File

@ -0,0 +1,56 @@
/********************************************************************************/
/* */
/* NVRAM File Names */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_nvfilename.h 4438 2011-02-13 23:03:56Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
/* Contains the base names used to construct NV storage file names. */
#ifndef TPM_NVFILENAME_H
#define TPM_NVFILENAME_H
/*
Constants for NVRAM names
*/
#define TPM_PERMANENT_ALL_NAME "permall"
#define TPM_SAVESTATE_NAME "savestate"
#define TPM_VOLATILESTATE_NAME "volatilestate"
#endif

53
include/libtpms/tpm_tis.h Normal file
View File

@ -0,0 +1,53 @@
/********************************************************************************/
/* */
/* TPM TIS I/O */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_tis.h 4285 2011-01-17 21:27:05Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2011. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_TIS_H
#define TPM_TIS_H
#include "tpm_types.h"
TPM_RESULT TPM_IO_Hash_Start(void);
TPM_RESULT TPM_IO_Hash_Data(const unsigned char *data,
uint32_t data_length);
TPM_RESULT TPM_IO_Hash_End(void);
TPM_RESULT TPM_IO_TpmEstablished_Get(TPM_BOOL *tpmEstablished);
#endif

138
include/libtpms/tpm_types.h Normal file
View File

@ -0,0 +1,138 @@
/********************************************************************************/
/* */
/* TPM Types */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_types.h 4202 2010-11-17 16:26:06Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_TYPES_H
#define TPM_TYPES_H
#include <stdint.h>
#if defined (TPM_POSIX) || defined (TPM_SYSTEM_P)
#include <netinet/in.h> /* for byte order conversions */
#endif
/* 2.2.1 Basic data types rev 87 */
typedef unsigned char BYTE; /* Basic byte used to transmit all character fields. */
typedef unsigned char TPM_BOOL; /* TRUE/FALSE field. TRUE = 0x01, FALSE = 0x00 Use TPM_BOOL
because MS VC++ defines BOOL on Windows */
/* 2.2.2 Boolean types rev 107 */
#undef TRUE
#define TRUE 0x01 /* Assertion */
#undef FALSE
#define FALSE 0x00 /* Contradiction */
/* 2.2.3 Helper redefinitions rev 101
The following definitions are to make the definitions more explicit and easier to read.
NOTE: They cannot be changed without breaking the serialization.
*/
typedef BYTE TPM_AUTH_DATA_USAGE; /* Indicates the conditions where it is required that
authorization be presented. */
typedef BYTE TPM_PAYLOAD_TYPE; /* The information as to what the payload is in an encrypted
structure */
typedef BYTE TPM_VERSION_BYTE; /* The version info breakdown */
typedef BYTE TPM_DA_STATE; /* The state of the dictionary attack mitigation logic */
/* added kgold */
typedef BYTE TPM_ENT_TYPE; /* LSB of TPM_ENTITY_TYPE */
typedef BYTE TPM_ADIP_ENC_SCHEME; /* MSB of TPM_ENTITY_TYPE */
typedef uint16_t TPM_PROTOCOL_ID; /* The protocol in use. */
typedef uint16_t TPM_STARTUP_TYPE; /* Indicates the start state. */
typedef uint16_t TPM_ENC_SCHEME; /* The definition of the encryption scheme. */
typedef uint16_t TPM_SIG_SCHEME; /* The definition of the signature scheme. */
typedef uint16_t TPM_MIGRATE_SCHEME; /* The definition of the migration scheme */
typedef uint16_t TPM_PHYSICAL_PRESENCE; /* Sets the state of the physical presence mechanism. */
typedef uint16_t TPM_ENTITY_TYPE; /* Indicates the types of entity that are supported by the
TPM. */
typedef uint16_t TPM_KEY_USAGE; /* Indicates the permitted usage of the key. */
typedef uint16_t TPM_EK_TYPE; /* The type of asymmetric encrypted structure in use by the
endorsement key */
typedef uint16_t TPM_STRUCTURE_TAG; /* The tag for the structure */
typedef uint16_t TPM_PLATFORM_SPECIFIC; /* The platform specific spec to which the information
relates to */
typedef uint32_t TPM_COMMAND_CODE; /* The command ordinal. */
typedef uint32_t TPM_CAPABILITY_AREA; /* Identifies a TPM capability area. */
typedef uint32_t TPM_KEY_FLAGS; /* Indicates information regarding a key. */
typedef uint32_t TPM_ALGORITHM_ID; /* Indicates the type of algorithm. */
typedef uint32_t TPM_MODIFIER_INDICATOR; /* The locality modifier */
typedef uint32_t TPM_ACTUAL_COUNT; /* The actual number of a counter. */
typedef uint32_t TPM_TRANSPORT_ATTRIBUTES; /* Attributes that define what options are in use
for a transport session */
typedef uint32_t TPM_AUTHHANDLE; /* Handle to an authorization session */
typedef uint32_t TPM_DIRINDEX; /* Index to a DIR register */
typedef uint32_t TPM_KEY_HANDLE; /* The area where a key is held assigned by the TPM. */
typedef uint32_t TPM_PCRINDEX; /* Index to a PCR register */
typedef uint32_t TPM_RESULT; /* The return code from a function */
typedef uint32_t TPM_RESOURCE_TYPE; /* The types of resources that a TPM may have using internal
resources */
typedef uint32_t TPM_KEY_CONTROL; /* Allows for controlling of the key when loaded and how to
handle TPM_Startup issues */
typedef uint32_t TPM_NV_INDEX; /* The index into the NV storage area */
typedef uint32_t TPM_FAMILY_ID; /* The family ID. Families ID's are automatically assigned a
sequence number by the TPM. A trusted process can set the
FamilyID value in an individual row to zero, which
invalidates that row. The family ID resets to zero on
each change of TPM Owner. */
typedef uint32_t TPM_FAMILY_VERIFICATION; /* A value used as a label for the most recent
verification of this family. Set to zero when not
in use. */
typedef uint32_t TPM_STARTUP_EFFECTS; /* How the TPM handles var */
typedef uint32_t TPM_SYM_MODE; /* The mode of a symmetric encryption */
typedef uint32_t TPM_FAMILY_FLAGS; /* The family flags */
typedef uint32_t TPM_DELEGATE_INDEX; /* The index value for the delegate NV table */
typedef uint32_t TPM_CMK_DELEGATE; /* The restrictions placed on delegation of CMK
commands */
typedef uint32_t TPM_COUNT_ID; /* The ID value of a monotonic counter */
typedef uint32_t TPM_REDIT_COMMAND; /* A command to execute */
typedef uint32_t TPM_TRANSHANDLE; /* A transport session handle */
typedef uint32_t TPM_HANDLE; /* A generic handle could be key, transport etc. */
typedef uint32_t TPM_FAMILY_OPERATION; /* What operation is happening */
/* Not in specification */
typedef uint16_t TPM_TAG; /* The command and response tags */
typedef unsigned char * TPM_SYMMETRIC_KEY_TOKEN; /* abstract symmetric key token */
typedef unsigned char * TPM_BIGNUM; /* abstract bignum */
#endif

527
install-sh Executable file
View File

@ -0,0 +1,527 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-01-19.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for `test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

8
libtpms.pc.in Normal file
View File

@ -0,0 +1,8 @@
libdir=@libdir@
includedir=@includedir@
Name: libtpms
Version: @VERSION@
Description: libtpms
Libs: -L${libdir} -ltpms
Cflags: -I${includedir}

9655
ltmain.sh Normal file

File diff suppressed because it is too large Load Diff

0
m4/Makefile.am Normal file
View File

390
m4/Makefile.in Normal file
View File

@ -0,0 +1,390 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
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 = m4
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
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@
CYGPATH_W = @CYGPATH_W@
DEBUG_DEFINES = @DEBUG_DEFINES@
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@
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@
LIBTPMS_VERSION = @LIBTPMS_VERSION@
LIBTPMS_VERSION_INFO = @LIBTPMS_VERSION_INFO@
LIBTPMS_VER_MAJOR = @LIBTPMS_VER_MAJOR@
LIBTPMS_VER_MICRO = @LIBTPMS_VER_MICRO@
LIBTPMS_VER_MINOR = @LIBTPMS_VER_MINOR@
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@
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@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
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@
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 m4/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign m4/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):
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: install-am
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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
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:
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:
.MAKE: install-am install-strip
.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-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
# 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:

7986
m4/libtool.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

384
m4/ltoptions.m4 vendored Normal file
View File

@ -0,0 +1,384 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

123
m4/ltsugar.m4 vendored Normal file
View File

@ -0,0 +1,123 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
m4/ltversion.m4 vendored Normal file
View File

@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file 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.
# @configure_input@
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

98
m4/lt~obsolete.m4 vendored Normal file
View File

@ -0,0 +1,98 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file 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.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

7
man/Makefile.am Normal file
View File

@ -0,0 +1,7 @@
#
# man/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
SUBDIRS = man3

596
man/Makefile.in Normal file
View File

@ -0,0 +1,596 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@
#
# man/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
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 = man
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_DEFINES = @DEBUG_DEFINES@
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@
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@
LIBTPMS_VERSION = @LIBTPMS_VERSION@
LIBTPMS_VERSION_INFO = @LIBTPMS_VERSION_INFO@
LIBTPMS_VER_MAJOR = @LIBTPMS_VER_MAJOR@
LIBTPMS_VER_MICRO = @LIBTPMS_VER_MICRO@
LIBTPMS_VER_MINOR = @LIBTPMS_VER_MINOR@
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@
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@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
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@
SUBDIRS = man3
all: all-recursive
.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 man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign man/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):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
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-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic clean-libtool \
ctags ctags-recursive distclean distclean-generic \
distclean-libtool distclean-tags 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-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 installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
# 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:

46
man/man3/Makefile.am Normal file
View File

@ -0,0 +1,46 @@
#
# man/man3/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
man3_PODS = \
TPM_IO_Hash_Start.pod \
TPM_IO_TpmEstablished_Get.pod \
TPMLIB_DecodeBlob.pod \
TPMLIB_GetTPMProperty.pod \
TPMLIB_GetVersion.pod \
TPMLIB_MainInit.pod \
TPMLIB_Process.pod \
TPMLIB_RegisterCallbacks.pod \
TPMLIB_VolatileAll_Store.pod \
TPM_Malloc.pod
man3_MANS = \
TPM_Free.3 \
TPM_IO_Hash_Data.3 \
TPM_IO_Hash_End.3 \
TPMLIB_Terminate.3 \
TPM_Realloc.3
man3_MANS += \
TPM_IO_Hash_Start.3 \
TPM_IO_TpmEstablished_Get.3 \
TPMLIB_DecodeBlob.3 \
TPMLIB_GetTPMProperty.3 \
TPMLIB_GetVersion.3 \
TPMLIB_MainInit.3 \
TPMLIB_Process.3 \
TPMLIB_RegisterCallbacks.3 \
TPMLIB_VolatileAll_Store.3 \
TPM_Malloc.3
%.3 : %.pod
@pod2man -r "libtpms" \
-c "" \
-n $(basename $@) \
--section=3 $< > $@
EXTRA_DIST = $(man3_MANS) $(man3_PODS)

512
man/man3/Makefile.in Normal file
View File

@ -0,0 +1,512 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@
#
# man/man3/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
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 = man/man3
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man3dir = $(mandir)/man3
am__installdirs = "$(DESTDIR)$(man3dir)"
NROFF = nroff
MANS = $(man3_MANS)
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@
CYGPATH_W = @CYGPATH_W@
DEBUG_DEFINES = @DEBUG_DEFINES@
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@
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@
LIBTPMS_VERSION = @LIBTPMS_VERSION@
LIBTPMS_VERSION_INFO = @LIBTPMS_VERSION_INFO@
LIBTPMS_VER_MAJOR = @LIBTPMS_VER_MAJOR@
LIBTPMS_VER_MICRO = @LIBTPMS_VER_MICRO@
LIBTPMS_VER_MINOR = @LIBTPMS_VER_MINOR@
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@
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@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
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@
man3_PODS = \
TPM_IO_Hash_Start.pod \
TPM_IO_TpmEstablished_Get.pod \
TPMLIB_DecodeBlob.pod \
TPMLIB_GetTPMProperty.pod \
TPMLIB_GetVersion.pod \
TPMLIB_MainInit.pod \
TPMLIB_Process.pod \
TPMLIB_RegisterCallbacks.pod \
TPMLIB_VolatileAll_Store.pod \
TPM_Malloc.pod
man3_MANS = TPM_Free.3 TPM_IO_Hash_Data.3 TPM_IO_Hash_End.3 \
TPMLIB_Terminate.3 TPM_Realloc.3 TPM_IO_Hash_Start.3 \
TPM_IO_TpmEstablished_Get.3 TPMLIB_DecodeBlob.3 \
TPMLIB_GetTPMProperty.3 TPMLIB_GetVersion.3 TPMLIB_MainInit.3 \
TPMLIB_Process.3 TPMLIB_RegisterCallbacks.3 \
TPMLIB_VolatileAll_Store.3 TPM_Malloc.3
EXTRA_DIST = $(man3_MANS) $(man3_PODS)
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 man/man3/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign man/man3/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):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man3: $(man3_MANS)
@$(NORMAL_INSTALL)
@list1='$(man3_MANS)'; \
list2=''; \
test -n "$(man3dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.3[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
done; }
uninstall-man3:
@$(NORMAL_UNINSTALL)
@list='$(man3_MANS)'; test -n "$(man3dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@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 $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man3dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
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-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man3
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: uninstall-man
uninstall-man: uninstall-man3
.MAKE: install-am install-strip
.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-html install-html-am \
install-info install-info-am install-man install-man3 \
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-man uninstall-man3
%.3 : %.pod
@pod2man -r "libtpms" \
-c "" \
-n $(basename $@) \
--section=3 $< > $@
# 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:

View File

@ -0,0 +1,179 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_DECODEBLOB 1"
.TH TPMLIB_DECODEBLOB 1 "2011-08-30" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPMLIB_DecodeBlob \- Decode a base64\-encode TPM blob
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_types.h\fR>
.PP
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_DecodeBlob(const char\fR *\fIbuffer\fR\fB,
enum TPMLIB_BlobType\fR \fItype\fR\fB,
unsigned char\fR **\fIresult\fR\fB
size_t\fR *\fIresult_len\fR\fB);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_DecodeBlob()\fB\fR function is used to decode a base64\-encoded
\&\s-1TPM\s0 state blob. The caller must pass what type of blob is expected to be
decoded and following that the function will look for the start and
end markers of the data.
.PP
The following types of blobs are supported along with their start and
end markers:
.IP "\fB\s-1BLOB_TYPE_INITSTATE\s0\fR" 4
.IX Item "BLOB_TYPE_INITSTATE"
\&'\-\-\-\-\-BEGIN \s-1INITSTATE\-\-\-\-\-\s0' marks the beginning of the base64\-encoded blob.
.Sp
\&'\-\-\-\-\-END \s-1INITSTATE\-\-\-\-\-\s0' marks the end of the base64\-encoded blob.
.PP
This function is useful when passing state to the \s-1TPM\s0 inside the
callback that is invoked to get the \s-1TPM\s0's state blob.
See \fITPMLIB_RegisterCallbacks\fR(3).
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_SIZE\s0\fR" 4
.IX Item "TPM_SIZE"
The size of a requested buffer exceeds the limit or the
system is out of memory.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
An error occurred while attempting to decode the blob.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3)

View File

@ -0,0 +1,66 @@
=head1 NAME
TPMLIB_DecodeBlob - Decode a base64-encode TPM blob
=head1 SYNOPSIS
B<#include <libtpms/tpm_types.h>>
B<#include <libtpms/tpm_library.h>>
B<TPM_RESULT TPMLIB_DecodeBlob(const char> *I<buffer>B<,
enum TPMLIB_BlobType> I<type>B<,
unsigned char> **I<result>B<
size_t> *I<result_len>B<);>
=head1 DESCRIPTION
The B<TPMLIB_DecodeBlob()> function is used to decode a base64-encoded
TPM state blob. The caller must pass what type of blob is expected to be
decoded and following that the function will look for the start and
end markers of the data.
The following types of blobs are supported along with their start and
end markers:
=over 4
=item B<BLOB_TYPE_INITSTATE>
'-----BEGIN INITSTATE-----' marks the beginning of the base64-encoded blob.
'-----END INITSTATE-----' marks the end of the base64-encoded blob.
=back
This function is useful when passing state to the TPM inside the
callback that is invoked to get the TPM's state blob.
See I<TPMLIB_RegisterCallbacks>(3).
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_SIZE>
The size of a requested buffer exceeds the limit or the
system is out of memory.
=item B<TPM_FAIL>
An error occurred while attempting to decode the blob.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_RegisterCallbacks>(3)
=cut

View File

@ -0,0 +1,247 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_GETTPMPROPERTY 1"
.TH TPMLIB_GETTPMPROPERTY 1 "2011-03-24" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPMLIB_GetTPMProperty \- Get a runtime property of the TPM
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_GetTPMProperty(enum TPMLIB_TPMProperty, int *result);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_GetTPMProperty()\fB\fR call is used to retrieve run-time parameters
of the \s-1TPM\s0 such as the number of authorization sessions it can hold or
the maximum sizes of the permanent state, savestate or volatile state blobs.
.PP
This function can be called before or after the \s-1TPM\s0 has been created.
The current implementation of libtpms will return the same value before
and after the \s-1TPM\s0 was started.
.PP
The following properties have been defined:
.IP "\fB\s-1TPMPROP_TPM_RSA_KEY_LENGTH_MAX\s0\fR" 4
.IX Item "TPMPROP_TPM_RSA_KEY_LENGTH_MAX"
The maximum size of an \s-1RSA\s0 key.
.IP "\fB\s-1TPMPROP_TPM_BUFFER_MAX\s0\fR" 4
.IX Item "TPMPROP_TPM_BUFFER_MAX"
The maximum sizes of the \s-1TPM\s0 command and result buffers.
.IP "\fB\s-1TPMPROP_TPM_KEY_HANDLES\s0\fR" 4
.IX Item "TPMPROP_TPM_KEY_HANDLES"
The number of key slots.
.IP "\fB\s-1TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES\s0\fR" 4
.IX Item "TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES"
The number of owner-evict keys.
.IP "\fB\s-1TPMPROP_TPM_MIN_AUTH_SESSIONS\s0\fR" 4
.IX Item "TPMPROP_TPM_MIN_AUTH_SESSIONS"
The number of authorization sessions.
.IP "\fB\s-1TPMPROP_TPM_MIN_TRANS_SESSIONS\s0\fR" 4
.IX Item "TPMPROP_TPM_MIN_TRANS_SESSIONS"
The number of transport sessions.
.IP "\fB\s-1TPMPROP_TPM_MIN_DAA_SESSIONS\s0\fR" 4
.IX Item "TPMPROP_TPM_MIN_DAA_SESSIONS"
The number of \s-1DAA\s0 sessions.
.IP "\fB\s-1TPMPROP_TPM_MIN_SESSION_LIST\s0\fR" 4
.IX Item "TPMPROP_TPM_MIN_SESSION_LIST"
The size of the session list.
.IP "\fB\s-1TPMPROP_TPM_MIN_COUNTERS\s0\fR" 4
.IX Item "TPMPROP_TPM_MIN_COUNTERS"
The number of monotonic counters.
.IP "\fB\s-1TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN\s0\fR" 4
.IX Item "TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN"
The number of family entries.
.IP "\fB\s-1TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN\s0\fR" 4
.IX Item "TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN"
The number of delegate entries.
.IP "\fB\s-1TPMPROP_TPM_SPACE_SAFETY_MARGIN\s0\fR" 4
.IX Item "TPMPROP_TPM_SPACE_SAFETY_MARGIN"
The space saftey margin used for the worst-case sizes of the savestate and
volatile state blobs. This safety marging is not used for the size of the
permanent data blob.
.IP "\fB\s-1TPMPROP_TPM_MAX_NV_SPACE\s0\fR" 4
.IX Item "TPMPROP_TPM_MAX_NV_SPACE"
The maximum size of the permanent data blob.
.IP "\fB\s-1TPMPROP_TPM_MAX_SAVESTATE_SPACE\s0\fR" 4
.IX Item "TPMPROP_TPM_MAX_SAVESTATE_SPACE"
The maximum size of the savestate blob (includes the space safety margin).
.IP "\fB\s-1TPMPROP_TPM_MAX_VOLATILESTATE_SPACE\s0\fR" 4
.IX Item "TPMPROP_TPM_MAX_VOLATILESTATE_SPACE"
The maximum size of the volatile state blob (includes the space saferty
margin).
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
An undefined property was queried.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "EXAMPLE"
.IX Header "EXAMPLE"
.Vb 1
\& #include <stdio.h>
\&
\& #include <libtpms/tpm_library.h>
\& #include <libtpms/tpm_error.h>
\&
\& int main(void) {
\& TPM_RESULT res;
\& int result;
\& int rc = 0;
\&
\& if (TPMLIB_MainInit() != TPM_SUCCESS) {
\& fprintf(stderr, "Could not start the TPM.\en");
\& return 1;
\& }
\&
\& if (TPMLIB_GetTPMProperty(TPMPROP_TPM_RSA_KEY_LENGTH_MAX, &result)
\& != TPM_SUCCESS) {
\& fprintf(stderr, "Could not read the max. size of RSA keys.\en");
\& goto err_exit;
\& }
\&
\& fprintf(stdout, "Max. size of RSA keys: %d\en", result);
\&
\& err_exit:
\& TPMLIB_Terminate();
\&
\& return 0;
\& }
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3),
\&\fBTPMLIB_Process\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3), \fBTPMLIB_GetVersion\fR(3)

View File

@ -0,0 +1,147 @@
=head1 NAME
TPMLIB_GetTPMProperty - Get a runtime property of the TPM
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_library.h>>
B<TPM_RESULT TPMLIB_GetTPMProperty(enum TPMLIB_TPMProperty, int *result);>
=head1 DESCRIPTION
The B<TPMLIB_GetTPMProperty()> call is used to retrieve run-time parameters
of the TPM such as the number of authorization sessions it can hold or
the maximum sizes of the permanent state, savestate or volatile state blobs.
This function can be called before or after the TPM has been created.
The current implementation of libtpms will return the same value before
and after the TPM was started.
The following properties have been defined:
=over 4
=item B<TPMPROP_TPM_RSA_KEY_LENGTH_MAX>
The maximum size of an RSA key.
=item B<TPMPROP_TPM_BUFFER_MAX>
The maximum sizes of the TPM command and result buffers.
=item B<TPMPROP_TPM_KEY_HANDLES>
The number of key slots.
=item B<TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES>
The number of owner-evict keys.
=item B<TPMPROP_TPM_MIN_AUTH_SESSIONS>
The number of authorization sessions.
=item B<TPMPROP_TPM_MIN_TRANS_SESSIONS>
The number of transport sessions.
=item B<TPMPROP_TPM_MIN_DAA_SESSIONS>
The number of DAA sessions.
=item B<TPMPROP_TPM_MIN_SESSION_LIST>
The size of the session list.
=item B<TPMPROP_TPM_MIN_COUNTERS>
The number of monotonic counters.
=item B<TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN>
The number of family entries.
=item B<TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN>
The number of delegate entries.
=item B<TPMPROP_TPM_SPACE_SAFETY_MARGIN>
The space saftey margin used for the worst-case sizes of the savestate and
volatile state blobs. This safety marging is not used for the size of the
permanent data blob.
=item B<TPMPROP_TPM_MAX_NV_SPACE>
The maximum size of the permanent data blob.
=item B<TPMPROP_TPM_MAX_SAVESTATE_SPACE>
The maximum size of the savestate blob (includes the space safety margin).
=item B<TPMPROP_TPM_MAX_VOLATILESTATE_SPACE>
The maximum size of the volatile state blob (includes the space saferty
margin).
=back
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
An undefined property was queried.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 EXAMPLE
#include <stdio.h>
#include <libtpms/tpm_library.h>
#include <libtpms/tpm_error.h>
int main(void) {
TPM_RESULT res;
int result;
int rc = 0;
if (TPMLIB_MainInit() != TPM_SUCCESS) {
fprintf(stderr, "Could not start the TPM.\n");
return 1;
}
if (TPMLIB_GetTPMProperty(TPMPROP_TPM_RSA_KEY_LENGTH_MAX, &result)
!= TPM_SUCCESS) {
fprintf(stderr, "Could not read the max. size of RSA keys.\n");
goto err_exit;
}
fprintf(stdout, "Max. size of RSA keys: %d\n", result);
err_exit:
TPMLIB_Terminate();
return 0;
}
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3),
B<TPMLIB_Process>(3), B<TPMLIB_RegisterCallbacks>(3), B<TPMLIB_GetVersion>(3)
=cut

View File

@ -0,0 +1,157 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_GETVERSION 1"
.TH TPMLIB_GETVERSION 1 "2011-03-09" "libtpms-0.5.1" "libtpms documentation"
.SH "NAME"
TPMLIB_GetVersion \- Get the version of the TPM library
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fBuint32_t TPMLIB_GetVersion(void);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_GetVersion()\fB\fR function returns the libtpms library version.
The \s-1TPM\s0 library version is formatted as follows:
.PP
.Vb 3
\& Bits 0 - 7 : revision of the library
\& Bits 8 -15 : minor version number of the library
\& Bits 16-23 : major version number of the library
.Ve
.PP
V0.5.1 is therefore represented as 0x00000501.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3)

View File

@ -0,0 +1,30 @@
=head1 NAME
TPMLIB_GetVersion - Get the version of the TPM library
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_library.h>>
B<uint32_t TPMLIB_GetVersion(void);>
=head1 DESCRIPTION
The B<TPMLIB_GetVersion()> function returns the libtpms library version.
The TPM library version is formatted as follows:
Bits 0 - 7 : revision of the library
Bits 8 -15 : minor version number of the library
Bits 16-23 : major version number of the library
V0.5.1 is therefore represented as 0x00000501.
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3)
=cut

211
man/man3/TPMLIB_MainInit.3 Normal file
View File

@ -0,0 +1,211 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_MAININIT 1"
.TH TPMLIB_MAININIT 1 "2011-08-30" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPMLIB_MainInit \- Initialize the TPM
.PP
TPMLIB_Terminate \- Terminate the TPM
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_types.h\fR>
.PP
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_MainInit(void);\fR
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_Terminate(void);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_MainInit()\fB\fR and \fB\f(BITPMLIB_Terminate()\fB\fR functions are used
to initialize and terminate the \s-1TPM\s0 respectively. The \fB\f(BITPMLIB_MainInit()\fB\fR
function must be called before the \s-1TPM\s0 processes any \s-1TPM\s0 command.
The \fB\f(BITPMLIB_Terminate()\fB\fR function is called to free all the internal
resources (memory allocations) the \s-1TPM\s0 has used and must be called after
the last \s-1TPM\s0 command was processed by the \s-1TPM\s0. The \fB\f(BITPMLIB_MainInit()\fB\fR
function can then be called again.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
General failure.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "EXAMPLE"
.IX Header "EXAMPLE"
.Vb 1
\& #include <stdio.h>
\&
\& #include <libtpms/tpm_types.h>
\& #include <libtpms/tpm_library.h>
\& #include <libtpms/tpm_error.h>
\&
\& int main(void) {
\& TPM_RESULT res;
\& unsigned char *respbuffer = NULL;
\& uint32_t resp_size = 0;
\& uint32_t respbufsize = 0;
\& unsigned char *command;
\& uint32_t command_size;
\&
\& [...]
\&
\& if (TPMLIB_MainInit() != TPM_SUCCESS) {
\& fprintf(stderr, "Could not start the TPM.\en");
\& return 1;
\& }
\&
\& [...]
\& /* build TPM command */
\& [...]
\&
\& res = TPMLIB_Process(&respbuffer, &resp_size,
\& &respbufsize,
\& command, command_size);
\& [...]
\&
\& TPMLIB_Terminate();
\&
\& return 0;
\& }
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_Process\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3), \fBTPMLIB_GetVersion\fR(3)
\&\fBTPMLIB_GetTPMProperty\fR(3), \fBTPMLIB_DecodeBlob\fR(3)

View File

@ -0,0 +1,92 @@
=head1 NAME
TPMLIB_MainInit - Initialize the TPM
TPMLIB_Terminate - Terminate the TPM
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_types.h>>
B<#include <libtpms/tpm_library.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPMLIB_MainInit(void);>
B<TPM_RESULT TPMLIB_Terminate(void);>
=head1 DESCRIPTION
The B<TPMLIB_MainInit()> and B<TPMLIB_Terminate()> functions are used
to initialize and terminate the TPM respectively. The B<TPMLIB_MainInit()>
function must be called before the TPM processes any TPM command.
The B<TPMLIB_Terminate()> function is called to free all the internal
resources (memory allocations) the TPM has used and must be called after
the last TPM command was processed by the TPM. The B<TPMLIB_MainInit()>
function can then be called again.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
General failure.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 EXAMPLE
#include <stdio.h>
#include <libtpms/tpm_types.h>
#include <libtpms/tpm_library.h>
#include <libtpms/tpm_error.h>
int main(void) {
TPM_RESULT res;
unsigned char *respbuffer = NULL;
uint32_t resp_size = 0;
uint32_t respbufsize = 0;
unsigned char *command;
uint32_t command_size;
[...]
if (TPMLIB_MainInit() != TPM_SUCCESS) {
fprintf(stderr, "Could not start the TPM.\n");
return 1;
}
[...]
/* build TPM command */
[...]
res = TPMLIB_Process(&respbuffer, &resp_size,
&respbufsize,
command, command_size);
[...]
TPMLIB_Terminate();
return 0;
}
=head1 SEE ALSO
B<TPMLIB_Process>(3), B<TPMLIB_RegisterCallbacks>(3), B<TPMLIB_GetVersion>(3)
B<TPMLIB_GetTPMProperty>(3), B<TPMLIB_DecodeBlob>(3)
=cut

227
man/man3/TPMLIB_Process.3 Normal file
View File

@ -0,0 +1,227 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_PROCESS 1"
.TH TPMLIB_PROCESS 1 "2011-02-17" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPMLIB_Process \- process a TPM command
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_Process(unsigned char\fR **\fIrespbuffer\fR\fB,
uint32_t\fR *\fIresp_size\fR\fB,
uint32_t\fR *\fIrespbufsize\fR\fB,
unsigned char\fR *\fIcommand\fR\fB,
uint32_t\fR \fIcommand_size\fR\fB);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_Process()\fB\fR function is used to send \s-1TPM\s0 commands to the \s-1TPM\s0
and receive the results.
.PP
The \fIcommand\fR parameter provides the buffer for the \s-1TPM\s0 command and
the \fIcommand_size\fR the number of valid \s-1TPM\s0 command bytes within that buffer.
.PP
The \fIrespbuffer\fR is a pointer to a buffer where the \s-1TPM\s0 will return its
result. If no buffer is given (\fIrespbuffer\fR is \s-1NULL\s0), the \s-1TPM\s0 will
allocate a buffer. The parameter \fIresp_size\fR returns the number of valid
\&\s-1TPM\s0 response bytes in the buffer. The number of valid bytes in the response
is guranteed to not exceed the maximum I/O buffer size. Use the
\&\fI\fITPMLIB_GetTPMProperty()\fI\fR \s-1API\s0 and parameter \fI\s-1TPMPROP_TPM_BUFFER_MAX\s0\fR for
getting the maximum size.
The user must indicate the size of a provided buffer with the \fIrespbufsize\fR
parameter. If the buffer is not big enough for the response, the \s-1TPM\s0 will
free the provided buffer and allocate one of sufficient size and adapt
\&\fIrespbufsize\fR. The returned buffer is only subject to size restrictions
as explained for \fI\fITPM_Malloc()\fI\fR.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
General failure.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "EXAMPLE"
.IX Header "EXAMPLE"
.Vb 1
\& #include <stdio.h>
\&
\& #include <libtpms/tpm_types.h>
\& #include <libtpms/tpm_library.h>
\& #include <libtpms/tpm_error.h>
\&
\& static unsigned char TPM_Startup_ST_CLEAR[] = {
\& 0x00, 0xC1, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x99,
\& 0x00, TPM_ST_CLEAR
\& };
\&
\& int main(void) {
\& TPM_RESULT res;
\& unsigned char *respbuffer = NULL;
\& uint32_t resp_size = 0;
\& uint32_t respbufsize = 0;
\& unsigned char *command;
\& uint32_t command_size;
\&
\& [...]
\&
\& if (TPMLIB_MainInit() != TPM_SUCCESS) {
\& fprintf(stderr, "Could not start the TPM.\en");
\& return 1;
\& }
\&
\& [...]
\& /* build TPM command */
\& command = TPM_Startup_ST_CLEAR;
\& command_size = sizeof(TPM_Startup_ST_CLEAR);
\& [...]
\&
\& res = TPMLIB_Process(&respbuffer, &resp_size,
\& &respbufsize,
\& command, command_size);
\& [...]
\&
\& TPMLIB_Terminate();
\&
\& return 0;
\& }
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3)
\&\fBTPMLIB_GetTPMProperty\fR(3), \fBTPMLIB_Malloc\fR(3), \fBTPMLIB_Realloc\fR(3)

108
man/man3/TPMLIB_Process.pod Normal file
View File

@ -0,0 +1,108 @@
=head1 NAME
TPMLIB_Process - process a TPM command
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_library.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPMLIB_Process(unsigned char> **I<respbuffer>B<,
uint32_t> *I<resp_size>B<,
uint32_t> *I<respbufsize>B<,
unsigned char> *I<command>B<,
uint32_t> I<command_size>B<);>
=head1 DESCRIPTION
The B<TPMLIB_Process()> function is used to send TPM commands to the TPM
and receive the results.
The I<command> parameter provides the buffer for the TPM command and
the I<command_size> the number of valid TPM command bytes within that buffer.
The I<respbuffer> is a pointer to a buffer where the TPM will return its
result. If no buffer is given (I<respbuffer> is NULL), the TPM will
allocate a buffer. The parameter I<resp_size> returns the number of valid
TPM response bytes in the buffer. The number of valid bytes in the response
is guranteed to not exceed the maximum I/O buffer size. Use the
I<TPMLIB_GetTPMProperty()> API and parameter I<TPMPROP_TPM_BUFFER_MAX> for
getting the maximum size.
The user must indicate the size of a provided buffer with the I<respbufsize>
parameter. If the buffer is not big enough for the response, the TPM will
free the provided buffer and allocate one of sufficient size and adapt
I<respbufsize>. The returned buffer is only subject to size restrictions
as explained for I<TPM_Malloc()>.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
General failure.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 EXAMPLE
#include <stdio.h>
#include <libtpms/tpm_types.h>
#include <libtpms/tpm_library.h>
#include <libtpms/tpm_error.h>
static unsigned char TPM_Startup_ST_CLEAR[] = {
0x00, 0xC1, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x99,
0x00, TPM_ST_CLEAR
};
int main(void) {
TPM_RESULT res;
unsigned char *respbuffer = NULL;
uint32_t resp_size = 0;
uint32_t respbufsize = 0;
unsigned char *command;
uint32_t command_size;
[...]
if (TPMLIB_MainInit() != TPM_SUCCESS) {
fprintf(stderr, "Could not start the TPM.\n");
return 1;
}
[...]
/* build TPM command */
command = TPM_Startup_ST_CLEAR;
command_size = sizeof(TPM_Startup_ST_CLEAR);
[...]
res = TPMLIB_Process(&respbuffer, &resp_size,
&respbufsize,
command, command_size);
[...]
TPMLIB_Terminate();
return 0;
}
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3), B<TPMLIB_RegisterCallbacks>(3)
B<TPMLIB_GetTPMProperty>(3), B<TPMLIB_Malloc>(3), B<TPMLIB_Realloc>(3)
=cut

View File

@ -0,0 +1,378 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_REGISTERCALLBACKS 1"
.TH TPMLIB_REGISTERCALLBACKS 1 "2011-10-12" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPMLIB_RegisterCallbacks \- Register callbacks for implementing customized
behavior of certain functions
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_types.h\fR>
.PP
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_RegisterCallbacks(struct tpmlibrary_callbacks *);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_RegisterCallbacks()\fB\fR functions allows to register several
callback functions with libtpms that enable a user to implement customized
behavior of several library-internal functions. This feature will typically
be used if the behavior of the provided internal functions is not as needed.
An example would be that libtpms writes all data into files with certain names.
If, however, the data needs to be written into a special type of storage
the user will register callbacks with the library that are invoked when
the \s-1TPM\s0 needs to write, read or delete data from storage and the user may
then implement custom behavior in these functions.
.PP
The following shows the data structure used for registering the callbacks.
.PP
.Vb 10
\& struct libtpms_callbacks {
\& int sizeOfStruct;
\& TPM_RESULT (*tpm_nvram_init)(void);
\& TPM_RESULT (*tpm_nvram_loaddata)(unsigned char **data,
\& uint32_t *length,
\& uint32_t tpm_number,
\& const char *name);
\& TPM_RESULT (*tpm_nvram_storedata)(const unsigned char *data,
\& uint32_t length,
\& uint32_t tpm_number,
\& const char *name);
\& TPM_RESULT (*tpm_nvram_deletename)(uint32_t tpm_number,
\& const char *name,
\& TPM_BOOL mustExist);
\& TPM_RESULT (*tpm_io_init)(void);
\& TPM_RESULT (*tpm_io_getlocality)(TPM_MODIFIER_INDICATOR *localityModifer,
\& uint32_t tpm_number);
\& TPM_RESULT (*tpm_io_getphysicalpresence)(TPM_BOOL *physicalPresence,
\& uint32_t tpm_number);
\& };
.Ve
.PP
Currently 7 callbacks are supported. If a callback pointer in the above
structure is set to \s-1NULL\s0 the default library-internal implementation
of that function will be used.
.PP
If one of the callbacks in either the \fItpm_nvram\fR or \fItpm_io\fR group is
set, then all of the callbacks in the respective group should
be implemented.
.IP "\fBtpm_nvram_init\fR" 4
.IX Item "tpm_nvram_init"
This function is called before any access to persitent storage is done. It
allows the user to perform initialization of access to persitent storage.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation requires that the environment variable
\&\fI\s-1TPM_PATH\s0\fR is set and points to a directory where the \s-1TPM\s0's state
can be written to. If the variable is not set, it will return \fB\s-1TPM_FAIL\s0\fR
and the initialization of the \s-1TPM\s0 in \fB\f(BITPMLIB_MainInit()\fB\fR will fail.
.IP "\fBtpm_nvram_loaddata\fR" 4
.IX Item "tpm_nvram_loaddata"
This function is called when the \s-1TPM\s0 wants to load state from persistent
storage. The implementing function must allocate a buffer (\fIdata\fR)
and return it to the \s-1TPM\s0 along with the length of the buffer (\fIlength\fR).
The \fItpm_number\fR is always 0 and can be ignored.
The \fIname\fR parameter is either one of \fB\s-1TPM_SAVESTATE_NAME\s0\fR,
\&\fB\s-1TPM_VOLATILESTATE_NAME\s0\fR, or \fB\s-1TPM_PERMANENT_ALL_NAME\s0\fR and indicates
which one of the 3 types of state is supposed to be loaded.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation writes the \s-1TPM\s0's state into files in a directory
where the \fI\s-1TPM_PATH\s0\fR environment variable pointed to when
\&\fB\f(BITPMLIB_MainInit()\fB\fR was executed. Failure to write the \s-1TPM\s0's state into
files will put the \s-1TPM\s0 into failure mode.
.IP "\fBtpm_nvram_storedata\fR" 4
.IX Item "tpm_nvram_storedata"
This function is called when the \s-1TPM\s0 wants to store state to persistent
storage. The \fIdata\fR and \fIlength\fR parameters provide the data to be
stored and the number of bytes. The implementing function must not
free the \fIdata\fR buffer.
The \fItpm_number\fR is always 0 and can be ignored.
The \fIname\fR parameter is either one of \fB\s-1TPM_SAVESTATE_NAME\s0\fR,
\&\fB\s-1TPM_VOLATILESTATE_NAME\s0\fR, or \fB\s-1TPM_PERMANENT_ALL_NAME\s0\fR and indicates
which one of the 3 types of state is supposed to be stored.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation reads the \s-1TPM\s0's state from files in a directory
where the \fI\s-1TPM_PATH\s0\fR environment variable pointed to when
\&\fB\f(BITPMLIB_MainInit()\fB\fR was executed. Failure to read the \s-1TPM\s0's state from
files may put the \s-1TPM\s0 into failure mode.
.IP "\fBtpm_nvram_deletename\fR" 4
.IX Item "tpm_nvram_deletename"
This function is called when the \s-1TPM\s0 wants to delete state on persistent
storage.
The \fItpm_number\fR is always 0 and can be ignored.
The \fIname\fR parameter is either one of \fB\s-1TPM_SAVESTATE_NAME\s0\fR,
\&\fB\s-1TPM_VOLATILESTATE_NAME\s0\fR, or \fB\s-1TPM_PERMANENT_ALL_NAME\s0\fR and indicates
which one of the 3 types of state is supposed to be deleted.
The \fImustExist\fR parameter indicates wheteher the given data must exist
and the implementing function should return \fB\s-1TPM_FAIL\s0\fR if the data did
not exist.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation deletes the \s-1TPM\s0's state files in a directory
where the \fI\s-1TPM_PATH\s0\fR environment variable pointed to when
\&\fB\f(BITPMLIB_MainInit()\fB\fR was executed. Failure to delete the \s-1TPM\s0's state
files may put the \s-1TPM\s0 into failure mode.
.IP "\fBtpm_io_init\fR" 4
.IX Item "tpm_io_init"
This function is called to initialize the \s-1IO\s0 subsystem of the \s-1TPM\s0.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation simply returns \fB\s-1TPM_SUCCESS\s0\fR.
.IP "\fBtpm_io_getlocality\fR" 4
.IX Item "tpm_io_getlocality"
This function is called when the \s-1TPM\s0 needs to determine the locality
under which a command is supposed to be executed. The implementing function
should return the number of the locality by writing it into the
\&\fBlocalityModifier\fR pointer.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation returns 0 as the locality.
.IP "\fBtpm_io_getphysicalpresence\fR" 4
.IX Item "tpm_io_getphysicalpresence"
This function is called when the \s-1TPM\s0 needs to determine whether physical
presence has been asserted. The implementing function should write either
\&\fB\s-1TRUE\s0\fR or \fB\s-1FALSE\s0\fR into the physicalPresence pointer.
.Sp
Upon success this function should return \fB\s-1TPM_SUCCESS\s0\fR, a failure code
otherwise.
.Sp
The default implementation returns \fB\s-1FALSE\s0\fR for physical presence.
.SH "RETURN VALUE"
.IX Header "RETURN VALUE"
Upon successful completion, \fB\f(BITPMLIB_MainInit()\fB\fR returns \fB\s-1TPM_SUCCESS\s0\fR,
an error value otherwise.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
General failure.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "EXAMPLE"
.IX Header "EXAMPLE"
.Vb 3
\& #include <libtpms/tpm_types.h>
\& #include <libtpms/tpm_library.h>
\& #include <libtpms/tpm_error.h>
\&
\& static TPM_MODIFIER_INDICATOR locality;
\&
\& static TPM_RESULT mytpm_io_init(void)
\& {
\& return TPM_SUCCESS;
\& }
\&
\& static TPM_RESULT tpm_io_getlocality(TPM_MODIFIER_INDICATOR *locModif)
\& {
\& *locModif = locality;
\&
\& return TPM_SUCCESS:
\& }
\&
\& static TPM_RESULT mytpm_io_getphysicalpresence(TPM_BOOL *phyPres)
\& {
\& *physicalPresence = FALSE;
\&
\& return TPM_SUCCESS;
\& }
\&
\& int main(void) {
\& TPM_RESULT res;
\& unsigned char *respbuffer;
\& uint32_t resp_size;
\& uint32_t respbufsize;
\& unsigned char *command;
\& uint32_t command_size;
\&
\& struct libtpms_callbacks cbs = {
\& .sizeOfStruct = sizeof(struct libtpms_callbacks),
\& .tpm_nvram_init = NULL,
\& .tpm_nvram_loaddata = NULL,
\& .tpm_nvram_storedata = NULL,
\& .tpm_nvram_deletename = NULL,
\& .tpm_io_init = mytpm_io_init,
\& .tpm_io_getlocality = mytpm_io_getlocality,
\& .tpm_io_getphysicalpresence = mytpm_io_getphysicalpresence,
\& };
\&
\&
\& [...]
\&
\& if (TPMLIB_RegisterCallbacks(cbs) != TPM_SUCCESS) {
\& fprintf(stderr, "Could not register the callbacks.\en");
\& return 1;
\& }
\&
\& if (TPMLIB_MainInit()) != TPM_SUCCESS) {
\& fprintf(stderr, "Could not start the TPM.\en");
\& return 1;
\& }
\&
\& [...]
\& /* build TPM command */
\& [...]
\&
\& res = TPMLIB_Process(&respbuffer, &resp_size,
\& &respbufsize,
\& command, command_size);
\& [...]
\&
\& TPMLIB_Terminate();
\&
\& return 0;
\& }
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_Process\fR(3), \fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3),
\&\fBTPMLIB_DecodeBlobs\fR(3)

View File

@ -0,0 +1,272 @@
=head1 NAME
TPMLIB_RegisterCallbacks - Register callbacks for implementing customized
behavior of certain functions
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_types.h>>
B<#include <libtpms/tpm_library.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPMLIB_RegisterCallbacks(struct tpmlibrary_callbacks *);>
=head1 DESCRIPTION
The B<TPMLIB_RegisterCallbacks()> functions allows to register several
callback functions with libtpms that enable a user to implement customized
behavior of several library-internal functions. This feature will typically
be used if the behavior of the provided internal functions is not as needed.
An example would be that libtpms writes all data into files with certain names.
If, however, the data needs to be written into a special type of storage
the user will register callbacks with the library that are invoked when
the TPM needs to write, read or delete data from storage and the user may
then implement custom behavior in these functions.
The following shows the data structure used for registering the callbacks.
struct libtpms_callbacks {
int sizeOfStruct;
TPM_RESULT (*tpm_nvram_init)(void);
TPM_RESULT (*tpm_nvram_loaddata)(unsigned char **data,
uint32_t *length,
uint32_t tpm_number,
const char *name);
TPM_RESULT (*tpm_nvram_storedata)(const unsigned char *data,
uint32_t length,
uint32_t tpm_number,
const char *name);
TPM_RESULT (*tpm_nvram_deletename)(uint32_t tpm_number,
const char *name,
TPM_BOOL mustExist);
TPM_RESULT (*tpm_io_init)(void);
TPM_RESULT (*tpm_io_getlocality)(TPM_MODIFIER_INDICATOR *localityModifer,
uint32_t tpm_number);
TPM_RESULT (*tpm_io_getphysicalpresence)(TPM_BOOL *physicalPresence,
uint32_t tpm_number);
};
Currently 7 callbacks are supported. If a callback pointer in the above
structure is set to NULL the default library-internal implementation
of that function will be used.
If one of the callbacks in either the I<tpm_nvram> or I<tpm_io> group is
set, then all of the callbacks in the respective group should
be implemented.
=over 4
=item B<tpm_nvram_init>
This function is called before any access to persitent storage is done. It
allows the user to perform initialization of access to persitent storage.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation requires that the environment variable
I<TPM_PATH> is set and points to a directory where the TPM's state
can be written to. If the variable is not set, it will return B<TPM_FAIL>
and the initialization of the TPM in B<TPMLIB_MainInit()> will fail.
=item B<tpm_nvram_loaddata>
This function is called when the TPM wants to load state from persistent
storage. The implementing function must allocate a buffer (I<data>)
and return it to the TPM along with the length of the buffer (I<length>).
The I<tpm_number> is always 0 and can be ignored.
The I<name> parameter is either one of B<TPM_SAVESTATE_NAME>,
B<TPM_VOLATILESTATE_NAME>, or B<TPM_PERMANENT_ALL_NAME> and indicates
which one of the 3 types of state is supposed to be loaded.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation writes the TPM's state into files in a directory
where the I<TPM_PATH> environment variable pointed to when
B<TPMLIB_MainInit()> was executed. Failure to write the TPM's state into
files will put the TPM into failure mode.
=item B<tpm_nvram_storedata>
This function is called when the TPM wants to store state to persistent
storage. The I<data> and I<length> parameters provide the data to be
stored and the number of bytes. The implementing function must not
free the I<data> buffer.
The I<tpm_number> is always 0 and can be ignored.
The I<name> parameter is either one of B<TPM_SAVESTATE_NAME>,
B<TPM_VOLATILESTATE_NAME>, or B<TPM_PERMANENT_ALL_NAME> and indicates
which one of the 3 types of state is supposed to be stored.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation reads the TPM's state from files in a directory
where the I<TPM_PATH> environment variable pointed to when
B<TPMLIB_MainInit()> was executed. Failure to read the TPM's state from
files may put the TPM into failure mode.
=item B<tpm_nvram_deletename>
This function is called when the TPM wants to delete state on persistent
storage.
The I<tpm_number> is always 0 and can be ignored.
The I<name> parameter is either one of B<TPM_SAVESTATE_NAME>,
B<TPM_VOLATILESTATE_NAME>, or B<TPM_PERMANENT_ALL_NAME> and indicates
which one of the 3 types of state is supposed to be deleted.
The I<mustExist> parameter indicates wheteher the given data must exist
and the implementing function should return B<TPM_FAIL> if the data did
not exist.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation deletes the TPM's state files in a directory
where the I<TPM_PATH> environment variable pointed to when
B<TPMLIB_MainInit()> was executed. Failure to delete the TPM's state
files may put the TPM into failure mode.
=item B<tpm_io_init>
This function is called to initialize the IO subsystem of the TPM.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation simply returns B<TPM_SUCCESS>.
=item B<tpm_io_getlocality>
This function is called when the TPM needs to determine the locality
under which a command is supposed to be executed. The implementing function
should return the number of the locality by writing it into the
B<localityModifier> pointer.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation returns 0 as the locality.
=item B<tpm_io_getphysicalpresence>
This function is called when the TPM needs to determine whether physical
presence has been asserted. The implementing function should write either
B<TRUE> or B<FALSE> into the physicalPresence pointer.
Upon success this function should return B<TPM_SUCCESS>, a failure code
otherwise.
The default implementation returns B<FALSE> for physical presence.
=back
=head1 RETURN VALUE
Upon successful completion, B<TPMLIB_MainInit()> returns B<TPM_SUCCESS>,
an error value otherwise.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
General failure.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 EXAMPLE
#include <libtpms/tpm_types.h>
#include <libtpms/tpm_library.h>
#include <libtpms/tpm_error.h>
static TPM_MODIFIER_INDICATOR locality;
static TPM_RESULT mytpm_io_init(void)
{
return TPM_SUCCESS;
}
static TPM_RESULT tpm_io_getlocality(TPM_MODIFIER_INDICATOR *locModif)
{
*locModif = locality;
return TPM_SUCCESS:
}
static TPM_RESULT mytpm_io_getphysicalpresence(TPM_BOOL *phyPres)
{
*physicalPresence = FALSE;
return TPM_SUCCESS;
}
int main(void) {
TPM_RESULT res;
unsigned char *respbuffer;
uint32_t resp_size;
uint32_t respbufsize;
unsigned char *command;
uint32_t command_size;
struct libtpms_callbacks cbs = {
.sizeOfStruct = sizeof(struct libtpms_callbacks),
.tpm_nvram_init = NULL,
.tpm_nvram_loaddata = NULL,
.tpm_nvram_storedata = NULL,
.tpm_nvram_deletename = NULL,
.tpm_io_init = mytpm_io_init,
.tpm_io_getlocality = mytpm_io_getlocality,
.tpm_io_getphysicalpresence = mytpm_io_getphysicalpresence,
};
[...]
if (TPMLIB_RegisterCallbacks(cbs) != TPM_SUCCESS) {
fprintf(stderr, "Could not register the callbacks.\n");
return 1;
}
if (TPMLIB_MainInit()) != TPM_SUCCESS) {
fprintf(stderr, "Could not start the TPM.\n");
return 1;
}
[...]
/* build TPM command */
[...]
res = TPMLIB_Process(&respbuffer, &resp_size,
&respbufsize,
command, command_size);
[...]
TPMLIB_Terminate();
return 0;
}
=head1 SEE ALSO
B<TPMLIB_Process>(3), B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3),
B<TPMLIB_DecodeBlobs>(3)
=cut

View File

@ -0,0 +1 @@
.so man3/TPMLIB_MainInit.3

View File

@ -0,0 +1,164 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPMLIB_VOLATILEALL_STORE 1"
.TH TPMLIB_VOLATILEALL_STORE 1 "2011-03-09" "libtpms-0.5.1" "libtpms documentation"
.SH "NAME"
TPMLIB_VolatileAll_Store \- store all volatile state of the TPM in a buffer
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_library.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPMLIB_VolatileAll_Store(unsigned char **buffer,
uint32_t *buflen);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPMLIB_VolatileAll_Store()\fB\fR function is used to get the volatile
state of the \s-1TPM\s0. The function will allocate a \fIbuffer\fR and return
the number of bytes of state information in the \fIbuflen\fR variable.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
General failure.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3)

View File

@ -0,0 +1,45 @@
=head1 NAME
TPMLIB_VolatileAll_Store - store all volatile state of the TPM in a buffer
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_library.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPMLIB_VolatileAll_Store(unsigned char **buffer,
uint32_t *buflen);>
=head1 DESCRIPTION
The B<TPMLIB_VolatileAll_Store()> function is used to get the volatile
state of the TPM. The function will allocate a I<buffer> and return
the number of bytes of state information in the I<buflen> variable.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
General failure.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3), B<TPMLIB_RegisterCallbacks>(3)
=cut

1
man/man3/TPM_Free.3 Normal file
View File

@ -0,0 +1 @@
.so man3/TPM_Malloc.3

View File

@ -0,0 +1 @@
.so man3/TPM_IO_Hash_Start.3

View File

@ -0,0 +1 @@
.so man3/TPM_IO_Hash_Start.3

View File

@ -0,0 +1,194 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPM_IO_HASH_START 1"
.TH TPM_IO_HASH_START 1 "2011-02-02" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPM_IO_Hash_Start \- indicate the beginging of a TPM TIS hash operation
.PP
TPM_IO_Hash_Data \- hash the provided data
.PP
TPM_IO_Hash_End \- indicate the end of a TPM TIS hash operation
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_types.h\fR>
.PP
\&\fB#include <libtpms/tpm_tis.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPM_IO_Hash_Start(void);\fR
.PP
\&\fB\s-1TPM_RESULT\s0 TPM_IO_Hash_Data(const unsigned char\fR *\fIdata\fR\fB,
uint32_t\fR \fIdata_length\fR\fB);\fR
.PP
\&\fB\s-1TPM_RESULT\s0 TPM_IO_Hash_End(void);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPM_IO_Hash_Start()\fB\fR function can be used by an implementation of the
\&\s-1TPM\s0 \s-1TIS\s0 hardware interface to indicate the beginning of a hash operation.
Following the \s-1TPM\s0 \s-1TIS\s0 interface specification it resets several PCRs and
terminates existing transport sessions.
The \fB\f(BITPM_IO_Hash_Data()\fB\fR function is used to send the data to be hashed to
the \s-1TPM\s0.
The \fB\f(BITPM_IO_Hash_End()\fB\fR function calculates the final hash and stores it
in the locality 4 \s-1PCR\s0.
The 3 functions must be called in the order they were explained.
.PP
The implementation of the above functions handles all TPM-internal actions
such as the setting and clearing of permanent flags and PCRs and the
calculation of the hash. Any functionality related to the \s-1TPM\s0's \s-1TIS\s0 interface
and the handling of flags, locality and state has to be implemented by the
caller.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
General failure.
.IP "\fB\s-1TPM_INVALID_POSTINIT\s0\fR" 4
.IX Item "TPM_INVALID_POSTINIT"
The \fB\f(BITPM_IO_Hash_Start()\fB\fR function was called before the \s-1TPM\s0 received
a TPM_Startup command.
.IP "\fB\s-1TPM_SHA_THREAD\s0\fR" 4
.IX Item "TPM_SHA_THREAD"
The \fB\f(BITPM_IO_Hash_Data()\fB\fR or \fB\f(BITPM_IO_Hash_End()\fB\fR functions were called before
the \fB\f(BITPM_IO_Hash_Start()\fB\fR function.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3),
\&\fBTPMLIB_Process\fR(3)

View File

@ -0,0 +1,78 @@
=head1 NAME
TPM_IO_Hash_Start - indicate the beginging of a TPM TIS hash operation
TPM_IO_Hash_Data - hash the provided data
TPM_IO_Hash_End - indicate the end of a TPM TIS hash operation
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_types.h>>
B<#include <libtpms/tpm_tis.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPM_IO_Hash_Start(void);>
B<TPM_RESULT TPM_IO_Hash_Data(const unsigned char> *I<data>B<,
uint32_t> I<data_length>B<);>
B<TPM_RESULT TPM_IO_Hash_End(void);>
=head1 DESCRIPTION
The B<TPM_IO_Hash_Start()> function can be used by an implementation of the
TPM TIS hardware interface to indicate the beginning of a hash operation.
Following the TPM TIS interface specification it resets several PCRs and
terminates existing transport sessions.
The B<TPM_IO_Hash_Data()> function is used to send the data to be hashed to
the TPM.
The B<TPM_IO_Hash_End()> function calculates the final hash and stores it
in the locality 4 PCR.
The 3 functions must be called in the order they were explained.
The implementation of the above functions handles all TPM-internal actions
such as the setting and clearing of permanent flags and PCRs and the
calculation of the hash. Any functionality related to the TPM's TIS interface
and the handling of flags, locality and state has to be implemented by the
caller.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
General failure.
=item B<TPM_INVALID_POSTINIT>
The B<TPM_IO_Hash_Start()> function was called before the TPM received
a TPM_Startup command.
=item B<TPM_SHA_THREAD>
The B<TPM_IO_Hash_Data()> or B<TPM_IO_Hash_End()> functions were called before
the B<TPM_IO_Hash_Start()> function.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3), B<TPMLIB_RegisterCallbacks>(3),
B<TPMLIB_Process>(3)
=cut

View File

@ -0,0 +1,165 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPM_IO_TPMESTABLISHED_GET 1"
.TH TPM_IO_TPMESTABLISHED_GET 1 "2011-02-17" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPM_IO_TpmEstablished_Get \- get the value of the TPMEstablished flag
.SH "LIBRARY"
.IX Header "LIBRARY"
\&\s-1TPM\s0 library (libtpms, \-ltpms)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_types.h\fR>
.PP
\&\fB#include <libtpms/tpm_tis.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPM_IO_TpmEstablished_Get(\s-1TPM_BOOL\s0\fR *\fItpmEstablished\fR\fB);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPM_IO_TpmEstablished_Get()\fB\fR function returns the value of the
TPMEstablished flag of the \s-1TPM\s0's permanent data.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
General failure.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3),
\&\fBTPMLIB_Process\fR(3), \fBTPM_IO_Hash_Start\fR(3), \fBTPM_IO_Hash_End\fR(3),
\&\fBTPM_IO_Hash_Data\fR(3)

View File

@ -0,0 +1,47 @@
=head1 NAME
TPM_IO_TpmEstablished_Get - get the value of the TPMEstablished flag
=head1 LIBRARY
TPM library (libtpms, -ltpms)
=head1 SYNOPSIS
B<#include <libtpms/tpm_types.h>>
B<#include <libtpms/tpm_tis.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPM_IO_TpmEstablished_Get(TPM_BOOL> *I<tpmEstablished>B<);>
=head1 DESCRIPTION
The B<TPM_IO_TpmEstablished_Get()> function returns the value of the
TPMEstablished flag of the TPM's permanent data.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_FAIL>
General failure.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3), B<TPMLIB_RegisterCallbacks>(3),
B<TPMLIB_Process>(3), B<TPM_IO_Hash_Start>(3), B<TPM_IO_Hash_End>(3),
B<TPM_IO_Hash_Data>(3)
=cut

190
man/man3/TPM_Malloc.3 Normal file
View File

@ -0,0 +1,190 @@
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "TPM_MALLOC 1"
.TH TPM_MALLOC 1 "2011-10-12" "libtpms-0.5.1" "libtpms documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
TPM_Malloc \- Allocate memory
.PP
TPM_Realloc \- Reallocate memory
.PP
TPM_Free \- Free memory
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fB#include <libtpms/tpm_types.h\fR>
.PP
\&\fB#include <libtpms/tpm_memory.h\fR>
.PP
\&\fB#include <libtpms/tpm_error.h\fR>
.PP
\&\fB\s-1TPM_RESULT\s0 TPM_Malloc(unsigned char\fR **\fIbuffer\fR\fB,
uint32_t\fR \fIsize\fR\fB);\fR
.PP
\&\fB\s-1TPM_RESULT\s0 TPM_Realloc(unsigned char\fR **\fIbuffer\fR\fB,
uint32_t\fR \fIsize\fR\fB);\fR
.PP
\&\fBvoid TPM_Free(unsigned char\fR *\fIbuffer\fR\fB);\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB\f(BITPM_Malloc()\fB\fR function is used to allocate a buffer of the given size.
The allocated buffer will be returned in the \fIbuffer\fR parameter.
.PP
The \fB\f(BITPM_Realloc()\fB\fR function is used to resize a buffer. The new size of
the buffer is given in the \fIsize\fR parameter. The reallocated buffer will
contain the data from the original buffer.
.PP
Both functions have the restriction that the buffer they can allocate
is limited to \fB\s-1TPM_ALLOC_MAX\s0\fR (64k) bytes. This size is sufficent
for all buffers needed by the \s-1TPM\s0.
.PP
Upon successful completion, the functions return \fB\s-1TPM_SUCCESS\s0\fR. In case the
requested buffer exceeds the limit, \fB\s-1TPM_SIZE\s0\fR will be returned. See further
possible error codes below.
.PP
The \fB\f(BITPM_Free()\fB\fR function frees the memory previously allocated using
either \fB\f(BITPM_Malloc()\fB\fR or \fB\f(BITPM_Realloc()\fB\fR.
.SH "ERRORS"
.IX Header "ERRORS"
.IP "\fB\s-1TPM_SUCCESS\s0\fR" 4
.IX Item "TPM_SUCCESS"
The function completed sucessfully.
.IP "\fB\s-1TPM_SIZE\s0\fR" 4
.IX Item "TPM_SIZE"
The size of the requested buffer exceeds the limit or the
system is out of memory.
.IP "\fB\s-1TPM_FAIL\s0\fR" 4
.IX Item "TPM_FAIL"
Requested buffer is of size 0.
.PP
For a complete list of \s-1TPM\s0 error codes please consult the include file
\&\fBlibtpms/tpm_error.h\fR
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3)
\&\fBTPMLIB_Process\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3), \fBTPMLIB_GetVersion\fR(3)

72
man/man3/TPM_Malloc.pod Normal file
View File

@ -0,0 +1,72 @@
=head1 NAME
TPM_Malloc - Allocate memory
TPM_Realloc - Reallocate memory
TPM_Free - Free memory
=head1 SYNOPSIS
B<#include <libtpms/tpm_types.h>>
B<#include <libtpms/tpm_memory.h>>
B<#include <libtpms/tpm_error.h>>
B<TPM_RESULT TPM_Malloc(unsigned char> **I<buffer>B<,
uint32_t> I<size>B<);>
B<TPM_RESULT TPM_Realloc(unsigned char> **I<buffer>B<,
uint32_t> I<size>B<);>
B<void TPM_Free(unsigned char> *I<buffer>B<);>
=head1 DESCRIPTION
The B<TPM_Malloc()> function is used to allocate a buffer of the given size.
The allocated buffer will be returned in the I<buffer> parameter.
The B<TPM_Realloc()> function is used to resize a buffer. The new size of
the buffer is given in the I<size> parameter. The reallocated buffer will
contain the data from the original buffer.
Both functions have the restriction that the buffer they can allocate
is limited to B<TPM_ALLOC_MAX> (64k) bytes. This size is sufficent
for all buffers needed by the TPM.
Upon successful completion, the functions return B<TPM_SUCCESS>. In case the
requested buffer exceeds the limit, B<TPM_SIZE> will be returned. See further
possible error codes below.
The B<TPM_Free()> function frees the memory previously allocated using
either B<TPM_Malloc()> or B<TPM_Realloc()>.
=head1 ERRORS
=over 4
=item B<TPM_SUCCESS>
The function completed sucessfully.
=item B<TPM_SIZE>
The size of the requested buffer exceeds the limit or the
system is out of memory.
=item B<TPM_FAIL>
Requested buffer is of size 0.
=back
For a complete list of TPM error codes please consult the include file
B<libtpms/tpm_error.h>
=head1 SEE ALSO
B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3)
B<TPMLIB_Process>(3), B<TPMLIB_RegisterCallbacks>(3), B<TPMLIB_GetVersion>(3)
=cut

1
man/man3/TPM_Realloc.3 Normal file
View File

@ -0,0 +1 @@
.so man3/TPM_Malloc.3

331
missing Executable file
View File

@ -0,0 +1,331 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2012-01-06.13; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

166
src/Makefile.am Normal file
View File

@ -0,0 +1,166 @@
#
# src/Makefile.am
#
# For the license, see the LICENSE file in the root directory.
#
lib_LTLIBRARIES=libtpms.la
libtpms_la_LIBADD=
libtpms_la_LDFLAGS = -Wl,--version-script=./libtpms.syms \
-version-info $(LIBTPMS_VERSION_INFO)
libtpms_la_CFLAGS = -include tpm_library_conf.h -I$(top_srcdir)/include/libtpms
#Build 1.2 TPM
libtpms_la_CFLAGS += -DTPM_V12
# build a PC Client TPM
libtpms_la_CFLAGS += -DTPM_PCCLIENT
# upon initialization have the TPM load the volatile state
libtpms_la_CFLAGS += -DTPM_VOLATILE_LOAD
# build the TPM enabled and activated
libtpms_la_CFLAGS += -DTPM_ENABLE_ACTIVATE
# build with AES support for symmetric crypto
libtpms_la_CFLAGS += -DTPM_AES
# build with libtpms callback support
libtpms_la_CFLAGS += -DTPM_LIBTPMS_CALLBACKS
# let the default NVRAM write to disk
libtpms_la_CFLAGS += -DTPM_NV_DISK
# build a POSIX type of TPM
libtpms_la_CFLAGS += -DTPM_POSIX
libtpms_la_CFLAGS += @DEBUG_DEFINES@
CRYPTO_OBJFILES =
libtpms_la_SOURCES = \
tpm_admin.c \
tpm_audit.c \
tpm_auth.c \
tpm_cryptoh.c \
tpm_counter.c \
tpm_daa.c \
tpm_debug.c \
tpm_delegate.c \
tpm_digest.c \
tpm_error.c \
tpm_global.c \
tpm_identity.c \
tpm_init.c \
tpm_libtpms_io.c \
tpm_key.c \
tpm_library.c \
tpm_load.c \
tpm_maint.c \
tpm_memory.c \
tpm_migration.c \
tpm_nonce.c \
tpm_nvfile.c \
tpm_nvram.c \
tpm_owner.c \
tpm_pcr.c \
tpm_permanent.c \
tpm_platform.c \
tpm_process.c \
tpm_secret.c \
tpm_session.c \
tpm_sizedbuffer.c \
tpm_startup.c \
tpm_store.c \
tpm_storage.c \
tpm_ticks.c \
tpm_time.c \
tpm_tis.c \
tpm_transport.c \
tpm_ver.c \
tpm_svnrevision.c
noinst_HEADERS = \
tpm_admin.h \
tpm_audit.h \
tpm_auth.h \
tpm_commands.h \
tpm_constants.h \
tpm_counter.h \
tpm_crypto.h \
tpm_cryptoh.h \
tpm_daa.h \
tpm_debug.h \
tpm_delegate.h \
tpm_digest.h \
tpm_global.h \
tpm_identity.h \
tpm_init.h \
tpm_io.h \
tpm_key.h \
tpm_library_conf.h \
tpm_library_intern.h \
tpm_load.h \
tpm_maint.h \
tpm_migration.h \
tpm_nonce.h \
tpm_nvfile.h \
tpm_nvram_const.h \
tpm_nvram.h \
tpm_owner.h \
tpm_pcr.h \
tpm_permanent.h \
tpm_platform.h \
tpm_process.h \
tpm_secret.h \
tpm_session.h \
tpm_sizedbuffer.h \
tpm_startup.h \
tpm_storage.h \
tpm_store.h \
tpm_structures.h \
tpm_svnrevision.h \
tpm_ticks.h \
tpm_time.h \
tpm_transport.h \
tpm_ver.h
if LIBTPMS_USE_FREEBL
libtpms_la_SOURCES += tpm_crypto_freebl.c
libtpms_la_LIBADD += -lfreebl -lgmp -lnspr4 -lnssutil3 -lnss3
#work-around broken freebl includes
libtpms_la_CFLAGS += $(shell [ ! -r /usr/include/nss3/alghmac.h ] && \
touch alghmac.h && \
echo -I./)
# tpm_crypto_freebl.c: work around #include "blapi.h" : should be <nss3/blapi.h>
libtpms_la_CFLAGS += $(shell nss-config --cflags)
#including nss3/blapi.h requires a look into nspr4 dir
libtpms_la_CFLAGS += $(shell nspr-config --cflags)
else
if LIBTPMS_USE_OPENSSL
libtpms_la_SOURCES += tpm_crypto.c
libtpms_la_LIBADD += -lcrypto
libtpms_la_LDFLAGS += $(shell nspr-config --libs)
libtpms_la_CFLAGS += $(shell nspr-config --cflags)
endif # LIBTPMS_USE_OPENSSL
endif # LIBTPMS_USE_FREEBL
LDFLAGS_ARCH = $(findstring -m32, $(CFLAGS))
LDFLAGS_ARCH += $(findstring -m64, $(CFLAGS))
LDFLAGS_ARCH += $(findstring -m32, $(LDFLAGS))
LDFLAGS_ARCH += $(findstring -m64, $(LDFLAGS))
check-local:
@($(CC) $(LDFLAGS_ARCH) -nostdlib -L./.libs -ltpms 2>/dev/null || \
(echo "There are undefined symbols in libtpms ($(LDFLAGS_ARCH))";\
$(CC) $(LDFLAGS_ARCH) -nostdlib -L./.libs -ltpms 2>&1 | grep libtpms))
@$(CC) $(LDFLAGS_ARCH) -nostdlib -L./.libs -ltpms 2>/dev/null
EXTRA_DIST = \
tpm_crypto_freebl.c \
tpm_crypto.c \
libtpms.syms

1046
src/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

22
src/libtpms.syms Normal file
View File

@ -0,0 +1,22 @@
# Symbol file for the linker. For newer versions add new sections.
LIBTPMS_0.5.1 {
global:
TPM_IO_Hash_Data;
TPM_IO_Hash_End;
TPM_IO_Hash_Start;
TPM_IO_TpmEstablished_Get;
TPMLIB_DecodeBlob;
TPMLIB_GetTPMProperty;
TPMLIB_GetVersion;
TPMLIB_MainInit;
TPMLIB_Process;
TPMLIB_RegisterCallbacks;
TPMLIB_Terminate;
TPMLIB_VolatileAll_Store;
TPM_Free;
TPM_Malloc;
TPM_Realloc;
local:
*;
};

2004
src/tpm_admin.c Normal file

File diff suppressed because it is too large Load Diff

141
src/tpm_admin.h Normal file
View File

@ -0,0 +1,141 @@
/********************************************************************************/
/* */
/* TPM Admin Test and Opt-in */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_admin.h 4403 2011-02-08 18:28:22Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_ADMIN_H
#define TPM_ADMIN_H
#include "tpm_types.h"
#include "tpm_global.h"
#include "tpm_store.h"
TPM_RESULT TPM_LimitedSelfTestCommon(void);
TPM_RESULT TPM_LimitedSelfTestTPM(tpm_state_t *tpm_state);
TPM_RESULT TPM_ContinueSelfTestCmd(tpm_state_t *tpm_state);
TPM_RESULT TPM_SelfTestFullCmd(tpm_state_t *tpm_state);
TPM_RESULT TPM_Process_ContinueSelfTest(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SelfTestFull(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_GetTestResult(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SetOwnerInstall(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_OwnerSetDisable(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_PhysicalDisable(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_PhysicalEnable(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_PhysicalSetDeactivated(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SetTempDeactivated(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SetOperatorAuth(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ResetLockValue(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

1271
src/tpm_audit.c Normal file

File diff suppressed because it is too large Load Diff

117
src/tpm_audit.h Normal file
View File

@ -0,0 +1,117 @@
/********************************************************************************/
/* */
/* Audit Handler */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_audit.h 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_AUDIT_H
#define TPM_AUDIT_H
#include "tpm_global.h"
#include "tpm_store.h"
#include "tpm_structures.h"
/*
TPM_AUDIT_EVENT_IN
*/
void TPM_AuditEventIn_Init(TPM_AUDIT_EVENT_IN *tpm_audit_event_in);
TPM_RESULT TPM_AuditEventIn_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_AUDIT_EVENT_IN *tpm_audit_event_in);
void TPM_AuditEventIn_Delete(TPM_AUDIT_EVENT_IN *tpm_audit_event_in);
/*
TPM_AUDIT_EVENT_OUT
*/
void TPM_AuditEventOut_Init(TPM_AUDIT_EVENT_OUT *tpm_audit_event_out);
TPM_RESULT TPM_AuditEventOut_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_AUDIT_EVENT_OUT *tpm_audit_event_out);
void TPM_AuditEventOut_Delete(TPM_AUDIT_EVENT_OUT *tpm_audit_event_out);
/*
ordinalAuditStatus Processing
*/
TPM_RESULT TPM_OrdinalAuditStatus_Init(TPM_PERMANENT_DATA *tpm_permanent_data);
TPM_RESULT TPM_OrdinalAuditStatus_Store(TPM_SIZED_BUFFER *ordinalList,
TPM_PERMANENT_DATA *tpm_permanent_data,
TPM_COMMAND_CODE startOrdinal);
TPM_RESULT TPM_OrdinalAuditStatus_GetAuditStatus(TPM_BOOL *auditStatus,
TPM_COMMAND_CODE ordinal,
TPM_PERMANENT_DATA *tpm_permanent_data);
TPM_RESULT TPM_OrdinalAuditStatus_SetAuditStatus(TPM_BOOL *altered,
TPM_PERMANENT_DATA *tpm_permanent_data,
TPM_BOOL auditStatus,
TPM_COMMAND_CODE ordinal);
/*
Common Processing Functions
*/
TPM_RESULT TPM_AuditDigest_ExtendIn(tpm_state_t *tpm_state,
TPM_DIGEST inParamDigest);
TPM_RESULT TPM_AuditDigest_ExtendOut(tpm_state_t *tpm_state,
TPM_DIGEST outParamDigest);
/*
Processing Functions
*/
TPM_RESULT TPM_Process_GetAuditDigest(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_GetAuditDigestSigned(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SetOrdinalAuditStatus(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

2297
src/tpm_auth.c Normal file

File diff suppressed because it is too large Load Diff

176
src/tpm_auth.h Normal file
View File

@ -0,0 +1,176 @@
/********************************************************************************/
/* */
/* Authorization */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_auth.h 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_AUTH_H
#define TPM_AUTH_H
#include "tpm_global.h"
#include "tpm_session.h"
#include "tpm_store.h"
#include "tpm_structures.h"
#include "tpm_types.h"
/*
TPM_AUTHDATA
*/
void TPM_Authdata_Init(TPM_AUTHDATA tpm_authdata);
TPM_RESULT TPM_Authdata_Load(TPM_AUTHDATA tpm_authdata,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_Authdata_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_AUTHDATA tpm_authdata);
TPM_RESULT TPM_Authdata_Generate(TPM_AUTHDATA resAuth,
TPM_SECRET usageAuth,
TPM_DIGEST outParamDigest,
TPM_NONCE nonceEven,
TPM_NONCE nonceOdd,
TPM_BOOL continueSession);
TPM_RESULT TPM_Authdata_Check(tpm_state_t *tpm_state,
TPM_SECRET hmacKey,
TPM_DIGEST inParamDigest,
TPM_AUTH_SESSION_DATA *tpm_auth_session_data,
TPM_NONCE nonceOdd,
TPM_BOOL continueSession,
TPM_AUTHDATA usageAuth);
TPM_RESULT TPM_Auth2data_Check(tpm_state_t *tpm_state,
TPM_SECRET hmacKey,
TPM_DIGEST inParamDigest,
TPM_AUTH_SESSION_DATA *tpm_auth_session_data,
TPM_NONCE nonceOdd,
TPM_BOOL continueSession,
TPM_AUTHDATA usageAuth);
TPM_RESULT TPM_Authdata_Fail(tpm_state_t *tpm_state);
TPM_RESULT TPM_Authdata_GetState(TPM_DA_STATE *state,
uint32_t *timeLeft,
tpm_state_t *tpm_state);
TPM_RESULT TPM_Authdata_CheckState(tpm_state_t *tpm_state);
/*
Utilities for command input and output parameter load and store
*/
TPM_RESULT TPM_AuthParams_Get(TPM_AUTHHANDLE *authHandle,
TPM_BOOL *authHandleValid,
TPM_NONCE nonceOdd,
TPM_BOOL *continueAuthSession,
TPM_AUTHDATA authData,
unsigned char **command,
uint32_t *paramSize);
TPM_RESULT TPM_AuthParams_Set(TPM_STORE_BUFFER *response,
TPM_SECRET hmacKey,
TPM_AUTH_SESSION_DATA *auth_session_data,
TPM_DIGEST outParamDigest,
TPM_NONCE nonceOdd,
TPM_BOOL continueAuthSession);
/*
TPM_CHANGEAUTH_VALIDATE
*/
void TPM_ChangeauthValidate_Init(TPM_CHANGEAUTH_VALIDATE *tpm_changeauth_validate);
TPM_RESULT TPM_ChangeauthValidate_Load(TPM_CHANGEAUTH_VALIDATE *tpm_changeauth_validate,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_ChangeauthValidate_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_CHANGEAUTH_VALIDATE *tpm_changeauth_validate);
void TPM_ChangeauthValidate_Delete(TPM_CHANGEAUTH_VALIDATE *tpm_changeauth_validate);
/*
TPM_DA_INFO
*/
void TPM_DaInfo_Init(TPM_DA_INFO *tpm_da_info);
TPM_RESULT TPM_DaInfo_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DA_INFO *tpm_da_info);
void TPM_DaInfo_Delete(TPM_DA_INFO *tpm_da_info);
TPM_RESULT TPM_DaInfo_Set(TPM_DA_INFO *tpm_da_info,
tpm_state_t *tpm_state);
/*
TPM_DA_INFO_LIMITED
*/
void TPM_DaInfoLimited_Init(TPM_DA_INFO_LIMITED *tpm_da_info_limited);
TPM_RESULT TPM_DaInfoLimited_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DA_INFO_LIMITED *tpm_da_info_limited);
void TPM_DaInfoLimited_Delete(TPM_DA_INFO_LIMITED *tpm_da_info_limited);
TPM_RESULT TPM_DaInfoLimited_Set(TPM_DA_INFO_LIMITED *tpm_da_info_limited,
tpm_state_t *tpm_state);
/*
Processing functions
*/
TPM_RESULT TPM_Process_ChangeAuth(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ChangeAuthOwner(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ChangeAuthAsymStart(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ChangeAuthAsymFinish(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

51
src/tpm_commands.h Normal file
View File

@ -0,0 +1,51 @@
/********************************************************************************/
/* */
/* TPM Command Structure */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_commands.h 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_COMMANDS_H
#define TPM_COMMANDS_H
#include "tpm_types.h"
/* general structure for all commands */
#define TPM_TAG_OFFSET 0
#define TPM_PARAMSIZE_OFFSET (sizeof(TPM_TAG) + TPM_TAG_OFFSET)
#define TPM_ORDINAL_OFFSET (sizeof(uint32_t) + TPM_PARAMSIZE_OFFSET)
#endif

1652
src/tpm_constants.h Normal file

File diff suppressed because it is too large Load Diff

1565
src/tpm_counter.c Normal file

File diff suppressed because it is too large Load Diff

140
src/tpm_counter.h Normal file
View File

@ -0,0 +1,140 @@
/********************************************************************************/
/* */
/* Counter Handler */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_counter.h 4526 2011-03-24 21:14:42Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_COUNTER_H
#define TPM_COUNTER_H
#include "tpm_global.h"
#include "tpm_store.h"
#include "tpm_structures.h"
/*
Counter Resource Handling
*/
void TPM_Counters_Init(TPM_COUNTER_VALUE *monotonicCounters);
TPM_RESULT TPM_Counters_Load(TPM_COUNTER_VALUE *monotonicCountersa,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_Counters_Store(TPM_STORE_BUFFER *sbuffer,
TPM_COUNTER_VALUE *monotonicCounters);
TPM_RESULT TPM_Counters_StoreHandles(TPM_STORE_BUFFER *sbuffer,
TPM_COUNTER_VALUE *monotonicCounters);
TPM_RESULT TPM_Counters_GetNewHandle(TPM_COUNTER_VALUE **tpm_counter_value,
TPM_COUNT_ID *countID,
TPM_COUNTER_VALUE *monotonicCounters);
void TPM_Counters_GetSpace(uint32_t *space,
TPM_COUNTER_VALUE *monotonicCounters);
void TPM_Counters_GetNextCount(TPM_ACTUAL_COUNT *nextCount,
TPM_COUNTER_VALUE *monotonicCounters);
TPM_RESULT TPM_Counters_IsValidId(TPM_COUNTER_VALUE *monotonicCounters,
TPM_COUNT_ID countID);
TPM_RESULT TPM_Counters_GetCounterValue(TPM_COUNTER_VALUE **tpm_counter_value,
TPM_COUNTER_VALUE *monotonicCounters,
TPM_COUNT_ID countID);
TPM_RESULT TPM_Counters_Release(TPM_COUNTER_VALUE *monotonicCounters);
void TPM_Counters_GetActiveCounter(TPM_COUNT_ID *activeCounter,
TPM_COUNT_ID countID);
/*
TPM_COUNTER_VALUE
*/
void TPM_CounterValue_Init(TPM_COUNTER_VALUE *tpm_counter_value);
TPM_RESULT TPM_CounterValue_Load(TPM_COUNTER_VALUE *tpm_counter_value,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_CounterValue_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_COUNTER_VALUE *tpm_counter_value);
TPM_RESULT TPM_CounterValue_StorePublic(TPM_STORE_BUFFER *sbuffer,
const TPM_COUNTER_VALUE *tpm_counter_value);
void TPM_CounterValue_CopyPublic(TPM_COUNTER_VALUE *dst_tpm_counter_value,
TPM_COUNTER_VALUE *src_tpm_counter_value);
TPM_RESULT TPM_CounterValue_Set(TPM_COUNTER_VALUE *tpm_counter_value,
TPM_COUNT_ID countID,
BYTE *label,
TPM_ACTUAL_COUNT counter,
TPM_SECRET authData);
TPM_RESULT TPM_CounterValue_Release(TPM_COUNTER_VALUE *tpm_counter_value,
TPM_COUNT_ID countID);
/*
Processing Functions
*/
TPM_RESULT TPM_Process_CreateCounter(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_IncrementCounter(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ReadCounter(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ReleaseCounter(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ReleaseCounterOwner(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

2778
src/tpm_crypto.c Normal file

File diff suppressed because it is too large Load Diff

219
src/tpm_crypto.h Normal file
View File

@ -0,0 +1,219 @@
/********************************************************************************/
/* */
/* Platform Dependent Crypto */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_crypto.h 4406 2011-02-08 22:11:37Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_CRYPTO_H
#define TPM_CRYPTO_H
#include "tpm_secret.h"
#include "tpm_types.h"
/* self test */
TPM_RESULT TPM_Crypto_Init(void);
TPM_RESULT TPM_Crypto_TestSpecific(void);
/* random number */
TPM_RESULT TPM_Random(BYTE *buffer, size_t bytes);
TPM_RESULT TPM_StirRandomCmd(TPM_SIZED_BUFFER *inData);
/*
bignum
*/
TPM_RESULT TPM_BN_num_bytes(unsigned int *numBytes, TPM_BIGNUM bn_in);
TPM_RESULT TPM_BN_is_one(TPM_BIGNUM bn_in);
TPM_RESULT TPM_BN_mod(TPM_BIGNUM rem_in,
const TPM_BIGNUM a_in,
const TPM_BIGNUM m_in);
TPM_RESULT TPM_BN_mask_bits(TPM_BIGNUM bn_in, unsigned int n);
TPM_RESULT TPM_BN_rshift(TPM_BIGNUM *rBignum_in,
TPM_BIGNUM aBignum_in,
int n);
TPM_RESULT TPM_BN_lshift(TPM_BIGNUM *rBignum_in,
TPM_BIGNUM aBignum_in,
int n);
TPM_RESULT TPM_BN_add(TPM_BIGNUM rBignum_in,
TPM_BIGNUM aBignum_in,
TPM_BIGNUM bBignum_in);
TPM_RESULT TPM_BN_mul(TPM_BIGNUM rBignum_in,
TPM_BIGNUM aBignum_in,
TPM_BIGNUM bBignum_in);
TPM_RESULT TPM_BN_mod_exp(TPM_BIGNUM rBignum_in,
TPM_BIGNUM aBignum_in,
TPM_BIGNUM pBignum_in,
TPM_BIGNUM nBignum_in);
TPM_RESULT TPM_BN_mod_mul(TPM_BIGNUM rBignum_in,
TPM_BIGNUM aBignum_in,
TPM_BIGNUM bBignum_in,
TPM_BIGNUM mBignum_in);
TPM_RESULT TPM_BN_mod_add(TPM_BIGNUM rBignum_in,
TPM_BIGNUM aBignum_in,
TPM_BIGNUM bBignum_in,
TPM_BIGNUM mBignum_in);
TPM_RESULT TPM_bin2bn(TPM_BIGNUM *bn_in,
const unsigned char *bin,
unsigned int bytes);
TPM_RESULT TPM_bn2bin(unsigned char *bin,
TPM_BIGNUM bn_in);
TPM_RESULT TPM_BN_new(TPM_BIGNUM *bn_in);
void TPM_BN_free(TPM_BIGNUM bn_in);
/* RSA */
TPM_RESULT TPM_RSAGenerateKeyPair(unsigned char **n,
unsigned char **p,
unsigned char **q,
unsigned char **d,
int num_bit,
const unsigned char *earr,
uint32_t e_size);
TPM_RESULT TPM_RSAPrivateDecrypt(unsigned char *decrypt_data,
uint32_t *decrypt_data_length,
size_t decrypt_data_size,
TPM_ENC_SCHEME encScheme,
unsigned char* encrypt_data,
uint32_t encrypt_data_size,
unsigned char *n,
uint32_t nbytes,
unsigned char *e,
uint32_t ebytes,
unsigned char *d,
uint32_t dbytes);
TPM_RESULT TPM_RSAPublicEncrypt(unsigned char* encrypt_data,
size_t encrypt_data_size,
TPM_ENC_SCHEME encScheme,
const unsigned char *decrypt_data,
size_t decrypt_data_size,
unsigned char *narr,
uint32_t nbytes,
unsigned char *earr,
uint32_t ebytes);
TPM_RESULT TPM_RSAPublicEncryptRaw(unsigned char *encrypt_data,
uint32_t encrypt_data_size,
unsigned char *decrypt_data,
uint32_t decrypt_data_size,
unsigned char *narr,
uint32_t nbytes,
unsigned char *earr,
uint32_t ebytes);
TPM_RESULT TPM_RSAGetPrivateKey(uint32_t *qbytes, unsigned char **qarr,
uint32_t *dbytes, unsigned char **darr,
uint32_t nbytes, unsigned char *narr,
uint32_t ebytes, unsigned char *earr,
uint32_t pbytes, unsigned char *parr);
TPM_RESULT TPM_RSASign(unsigned char *signature,
unsigned int *signature_length,
unsigned int signature_size,
TPM_SIG_SCHEME sigScheme,
const unsigned char *message,
size_t message_size,
unsigned char *narr,
uint32_t nbytes,
unsigned char *earr,
uint32_t ebytes,
unsigned char *darr,
uint32_t dbytes);
TPM_RESULT TPM_RSAVerifySHA1(unsigned char *signature,
unsigned int signature_size,
const unsigned char *message,
uint32_t message_size,
unsigned char *narr,
uint32_t nbytes,
unsigned char *earr,
uint32_t ebytes);
/* SHA-1 */
TPM_RESULT TPM_SHA1InitCmd(void **context);
TPM_RESULT TPM_SHA1UpdateCmd(void *context, const unsigned char *data, uint32_t length);
TPM_RESULT TPM_SHA1FinalCmd(unsigned char *md, void *context);
void TPM_SHA1Delete(void **context);
/* SHA-1 Context */
TPM_RESULT TPM_Sha1Context_Load(void **context,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_Sha1Context_Store(TPM_STORE_BUFFER *sbuffer,
void *context);
/*
TPM_SYMMETRIC_KEY_DATA
*/
TPM_RESULT TPM_SymmetricKeyData_New(TPM_SYMMETRIC_KEY_TOKEN *tpm_symmetric_key_data);
void TPM_SymmetricKeyData_Free(TPM_SYMMETRIC_KEY_TOKEN *tpm_symmetric_key_data);
void TPM_SymmetricKeyData_Init(TPM_SYMMETRIC_KEY_TOKEN tpm_symmetric_key_token);
TPM_RESULT TPM_SymmetricKeyData_Load(TPM_SYMMETRIC_KEY_TOKEN tpm_symmetric_key_token,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_SymmetricKeyData_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_SYMMETRIC_KEY_TOKEN tpm_symmetric_key_token);
TPM_RESULT TPM_SymmetricKeyData_GenerateKey(TPM_SYMMETRIC_KEY_TOKEN tpm_symmetric_key_token);
TPM_RESULT TPM_SymmetricKeyData_Encrypt(unsigned char **encrypt_data,
uint32_t *encrypt_length,
const unsigned char *decrypt_data,
uint32_t decrypt_length,
const TPM_SYMMETRIC_KEY_TOKEN tpm_symmetric_key_token);
TPM_RESULT TPM_SymmetricKeyData_Decrypt(unsigned char **decrypt_data,
uint32_t *decrypt_length,
const unsigned char *encrypt_data,
uint32_t encrypt_length,
const TPM_SYMMETRIC_KEY_TOKEN tpm_symmetric_key_token);
TPM_RESULT TPM_SymmetricKeyData_CtrCrypt(unsigned char *data_out,
const unsigned char *data_in,
uint32_t data_size,
const unsigned char *symmetric_key,
uint32_t symmetric_key_size,
const unsigned char *ctr_in,
uint32_t ctr_in_size);
TPM_RESULT TPM_SymmetricKeyData_OfbCrypt(unsigned char *data_out,
const unsigned char *data_in,
uint32_t data_size,
const unsigned char *symmetric_key,
uint32_t symmetric_key_size,
unsigned char *ivec_in,
uint32_t ivec_in_size);
#endif

2648
src/tpm_crypto_freebl.c Normal file

File diff suppressed because it is too large Load Diff

5362
src/tpm_cryptoh.c Normal file

File diff suppressed because it is too large Load Diff

358
src/tpm_cryptoh.h Normal file
View File

@ -0,0 +1,358 @@
/********************************************************************************/
/* */
/* High Level Platform Independent Crypto */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_cryptoh.h 4300 2011-01-18 18:00:27Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_CRYPTOH_H
#define TPM_CRYPTOH_H
#include "tpm_global.h"
#include "tpm_types.h"
#include "tpm_sizedbuffer.h"
#include "tpm_structures.h"
/*
TPM_SIGN_INFO
*/
void TPM_SignInfo_Init(TPM_SIGN_INFO *tpm_sign_info);
TPM_RESULT TPM_SignInfo_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_SIGN_INFO *tpm_sign_info);
void TPM_SignInfo_Delete(TPM_SIGN_INFO *tpm_sign_info);
/*
TPM_CERTIFY_INFO
*/
void TPM_CertifyInfo_Init(TPM_CERTIFY_INFO *tpm_certify_info);
TPM_RESULT TPM_CertifyInfo_Load(TPM_CERTIFY_INFO *tpm_certify_info,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_CertifyInfo_Store(TPM_STORE_BUFFER *sbuffer,
TPM_CERTIFY_INFO *tpm_certify_info);
void TPM_CertifyInfo_Delete(TPM_CERTIFY_INFO *tpm_certify_info);
TPM_RESULT TPM_CertifyInfo_Set(TPM_CERTIFY_INFO *tpm_certify_info,
TPM_KEY *tpm_key);
/*
TPM_CERTIFY_INFO2
*/
void TPM_CertifyInfo2_Init(TPM_CERTIFY_INFO2 *tpm_certify_info2);
TPM_RESULT TPM_CertifyInfo2_Load(TPM_CERTIFY_INFO2 *tpm_certify_info2,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_CertifyInfo2_Store(TPM_STORE_BUFFER *sbuffer,
TPM_CERTIFY_INFO2 *tpm_certify_info2);
void TPM_CertifyInfo2_Delete(TPM_CERTIFY_INFO2 *tpm_certify_info2);
TPM_RESULT TPM_CertifyInfo2_Set(TPM_CERTIFY_INFO2 *tpm_certify_info2,
TPM_KEY *tpm_key);
/*
TPM_SYMMETRIC_KEY
*/
void TPM_SymmetricKey_Init(TPM_SYMMETRIC_KEY *tpm_symmetric_key);
TPM_RESULT TPM_SymmetricKey_Load(TPM_SYMMETRIC_KEY *tpm_symmetric_key,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_SymmetricKey_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_SYMMETRIC_KEY *tpm_symmetric_key);
void TPM_SymmetricKey_Delete(TPM_SYMMETRIC_KEY *tpm_symmetric_key);
TPM_RESULT TPM_SymmetricKeyData_EncryptSbuffer(TPM_SIZED_BUFFER *encrypt_data,
TPM_STORE_BUFFER *sbuffer,
const TPM_SYMMETRIC_KEY_TOKEN
tpm_symmetric_key_data);
TPM_RESULT TPM_SymmetricKeyData_StreamCrypt(unsigned char *data_out,
const unsigned char *data_in,
uint32_t data_size,
TPM_ALGORITHM_ID algId,
TPM_ENC_SCHEME encScheme,
const unsigned char *symmetric_key,
uint32_t symmetric_key_size,
unsigned char *pad_in,
uint32_t pad_in_size);
/*
RSA functions
*/
TPM_RESULT TPM_RSAPrivateDecryptMalloc(unsigned char **decrypt_data,
uint32_t *decrypt_data_length,
unsigned char *encrypt_data,
uint32_t encrypt_data_size,
TPM_KEY *tpm_key);
TPM_RESULT TPM_RSAPrivateDecryptH(unsigned char *decrypt_data,
uint32_t *decrypt_data_length,
uint32_t decrypt_data_size,
unsigned char *encrypt_data,
uint32_t encrypt_data_size,
TPM_KEY *tpm_key);
TPM_RESULT TPM_RSAPublicEncryptSbuffer_Key(TPM_SIZED_BUFFER *enc_data,
TPM_STORE_BUFFER *sbuffer,
TPM_KEY *tpm_key);
TPM_RESULT TPM_RSAPublicEncrypt_Key(TPM_SIZED_BUFFER *enc_data,
const unsigned char *decrypt_data,
size_t decrypt_data_size,
TPM_KEY *tpm_key);
TPM_RESULT TPM_RSAPublicEncrypt_Pubkey(TPM_SIZED_BUFFER *enc_data,
const unsigned char *decrypt_data,
size_t decrypt_data_size,
TPM_PUBKEY *tpm_pubkey);
TPM_RESULT TPM_RSAPublicEncrypt_Common(TPM_SIZED_BUFFER *enc_data,
const unsigned char *decrypt_data,
size_t decrypt_data_size,
TPM_ENC_SCHEME encScheme,
unsigned char *narr,
uint32_t nbytes,
unsigned char *earr,
uint32_t ebytes);
TPM_RESULT TPM_RSASignH(unsigned char *signature,
unsigned int *signature_length,
unsigned int signature_size,
const unsigned char *message,
size_t message_size,
TPM_KEY *tpm_key);
TPM_RESULT TPM_RSASignToSizedBuffer(TPM_SIZED_BUFFER *signature,
const unsigned char *message,
size_t message_size,
TPM_KEY *tpm_key);
TPM_RESULT TPM_RSAVerifyH(TPM_SIZED_BUFFER *signature,
const unsigned char *message,
uint32_t message_size,
TPM_PUBKEY *tpm_pubkey);
TPM_RESULT TPM_RSAVerify(unsigned char *signature,
unsigned int signature_size,
TPM_SIG_SCHEME sigScheme,
const unsigned char *message,
uint32_t message_size,
unsigned char *narr,
uint32_t nbytes,
unsigned char *earr,
uint32_t ebytes);
TPM_RESULT TPM_RSA_exponent_verify(unsigned long exponent);
/*
OAEP Padding
*/
TPM_RESULT TPM_RSA_padding_add_PKCS1_OAEP(unsigned char *em, uint32_t emLen,
const unsigned char *from, uint32_t fLen,
const unsigned char *pHash,
const unsigned char *seed);
TPM_RESULT TPM_RSA_padding_check_PKCS1_OAEP(unsigned char *to, uint32_t *tLen, uint32_t tSize,
const unsigned char *em, uint32_t emLen,
unsigned char *pHash,
unsigned char *seed);
/*
Digest functions - SHA-1 and HMAC
*/
TPM_RESULT TPM_SHA1(TPM_DIGEST md, ...);
TPM_RESULT TPM_SHA1_Check(TPM_DIGEST digest_expect, ...);
TPM_RESULT TPM_SHA1Sbuffer(TPM_DIGEST tpm_digest,
TPM_STORE_BUFFER *sbuffer);
TPM_RESULT TPM_SHA1_GenerateStructure(TPM_DIGEST tpm_digest,
void *tpmStructure,
TPM_STORE_FUNCTION_T storeFunction);
TPM_RESULT TPM_SHA1_CheckStructure(TPM_DIGEST expected_digest,
void *tpmStructure,
TPM_STORE_FUNCTION_T storeFunction,
TPM_RESULT error);
TPM_RESULT TPM_HMAC_GenerateSbuffer(TPM_HMAC tpm_hmac,
const TPM_SECRET hmac_key,
TPM_STORE_BUFFER *sbuffer);
TPM_RESULT TPM_HMAC_GenerateStructure(TPM_HMAC tpm_hmac,
const TPM_SECRET hmac_key,
void *tpmStructure,
TPM_STORE_FUNCTION_T storeFunction);
TPM_RESULT TPM_HMAC_Generate(TPM_HMAC tpm_hmac,
const TPM_SECRET hmac_key,
...);
TPM_RESULT TPM_HMAC_CheckSbuffer(TPM_BOOL *valid,
TPM_HMAC expect,
const TPM_SECRET hmac_key,
TPM_STORE_BUFFER *sbuffer);
TPM_RESULT TPM_HMAC_Check(TPM_BOOL *valid,
TPM_HMAC expect,
const TPM_SECRET key,
...);
TPM_RESULT TPM_HMAC_CheckStructure(const TPM_SECRET hmac_key,
void *structure,
TPM_HMAC expect,
TPM_STORE_FUNCTION_T storeFunction,
TPM_RESULT error);
/*
XOR
*/
void TPM_XOR(unsigned char *out,
const unsigned char *in1,
const unsigned char *in2,
size_t length);
/*
MGF1
*/
TPM_RESULT TPM_MGF1(unsigned char *array,
uint32_t arrayLen,
const unsigned char *seed,
uint32_t seedLen);
TPM_RESULT TPM_MGF1_GenerateArray(unsigned char **array,
uint32_t arrayLen,
uint32_t seedLen,
...);
/* bignum */
TPM_RESULT TPM_bn2binMalloc(unsigned char **bin,
unsigned int *bytes,
TPM_BIGNUM bn_in,
uint32_t padBytes);
TPM_RESULT TPM_bn2binArray(unsigned char *bin,
unsigned int bytes,
TPM_BIGNUM bn);
TPM_RESULT TPM_2bin2bn(TPM_BIGNUM *bignum_in,
const unsigned char *bin0, uint32_t size0,
const unsigned char *bin1, uint32_t size1);
/*
Self Test
*/
TPM_RESULT TPM_CryptoTest(void);
/*
Processing functions
*/
TPM_RESULT TPM_Process_Sign(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SHA1Start(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SHA1Update(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SHA1Complete(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_SHA1CompleteExtend(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_GetRandom(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_StirRandom(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_CertifyKey(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_CertifyKey2(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_CertifySelfTest(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

5728
src/tpm_daa.c Normal file

File diff suppressed because it is too large Load Diff

405
src/tpm_daa.h Normal file
View File

@ -0,0 +1,405 @@
/********************************************************************************/
/* */
/* DAA Functions */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_daa.h 4526 2011-03-24 21:14:42Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_DAA_H
#define TPM_DAA_H
#include "tpm_global.h"
#include "tpm_store.h"
/*
TPM_DAA_SESSION_DATA (the entire array)
*/
void TPM_DaaSessions_Init(TPM_DAA_SESSION_DATA *daaSessions);
TPM_RESULT TPM_DaaSessions_Load(TPM_DAA_SESSION_DATA *daaSessions,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DaaSessions_Store(TPM_STORE_BUFFER *sbuffer,
TPM_DAA_SESSION_DATA *daaSessions);
void TPM_DaaSessions_Delete(TPM_DAA_SESSION_DATA *daaSessions);
void TPM_DaaSessions_IsSpace(TPM_BOOL *isSpace,
uint32_t *index,
TPM_DAA_SESSION_DATA *daaSessions);
void TPM_DaaSessions_GetSpace(uint32_t *space,
TPM_DAA_SESSION_DATA *daaSessions);
TPM_RESULT TPM_DaaSessions_StoreHandles(TPM_STORE_BUFFER *sbuffer,
TPM_DAA_SESSION_DATA *daaSessions);
TPM_RESULT TPM_DaaSessions_GetNewHandle(TPM_DAA_SESSION_DATA **tpm_daa_session_data,
TPM_HANDLE *daaHandle,
TPM_BOOL *daaHandleValid,
TPM_DAA_SESSION_DATA *daaSessions);
TPM_RESULT TPM_DaaSessions_GetEntry(TPM_DAA_SESSION_DATA **tpm_daa_session_data,
TPM_DAA_SESSION_DATA *daaSessions,
TPM_HANDLE daaHandle);
TPM_RESULT TPM_DaaSessions_AddEntry(TPM_HANDLE *tpm_handle,
TPM_BOOL keepHandle,
TPM_DAA_SESSION_DATA *daaSessions,
TPM_DAA_SESSION_DATA *tpm_daa_session_data);
TPM_RESULT TPM_DaaSessions_TerminateHandle(TPM_DAA_SESSION_DATA *daaSessions,
TPM_HANDLE daaHandle);
/*
TPM_DAA_SESSION_DATA (one element of the array)
*/
void TPM_DaaSessionData_Init(TPM_DAA_SESSION_DATA *tpm_daa_session_data);
TPM_RESULT TPM_DaaSessionData_Load(TPM_DAA_SESSION_DATA *tpm_daa_session_data,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DaaSessionData_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_SESSION_DATA *tpm_daa_session_data);
void TPM_DaaSessionData_Delete(TPM_DAA_SESSION_DATA *tpm_daa_session_data);
void TPM_DaaSessionData_Copy(TPM_DAA_SESSION_DATA *dest_daa_session_data,
TPM_HANDLE tpm_handle,
TPM_DAA_SESSION_DATA *src_daa_session_data);
TPM_RESULT TPM_DaaSessionData_CheckStage(TPM_DAA_SESSION_DATA *tpm_daa_session_data,
BYTE stage);
/*
TPM_DAA_ISSUER
*/
void TPM_DAAIssuer_Init(TPM_DAA_ISSUER *tpm_daa_issuer);
TPM_RESULT TPM_DAAIssuer_Load(TPM_DAA_ISSUER *tpm_daa_issuer,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DAAIssuer_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_ISSUER *tpm_daa_issuer);
void TPM_DAAIssuer_Delete(TPM_DAA_ISSUER *tpm_daa_issuer);
void TPM_DAAIssuer_Copy(TPM_DAA_ISSUER *dest_daa_issuer,
TPM_DAA_ISSUER *src_daa_issuer);
/*
TPM_DAA_TPM
*/
void TPM_DAATpm_Init(TPM_DAA_TPM *tpm_daa_tpm);
TPM_RESULT TPM_DAATpm_Load(TPM_DAA_TPM *tpm_daa_tpm,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DAATpm_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_TPM *tpm_daa_tpm);
void TPM_DAATpm_Delete(TPM_DAA_TPM *tpm_daa_tpm);
void TPM_DAATpm_Copy(TPM_DAA_TPM *dest_daa_tpm, TPM_DAA_TPM *src_daa_tpm);
/*
TPM_DAA_CONTEXT
*/
void TPM_DAAContext_Init(TPM_DAA_CONTEXT *tpm_daa_context);
TPM_RESULT TPM_DAAContext_Load(TPM_DAA_CONTEXT *tpm_daa_context,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DAAContext_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_CONTEXT *tpm_daa_context);
void TPM_DAAContext_Delete(TPM_DAA_CONTEXT *tpm_daa_context);
void TPM_DAAContext_Copy(TPM_DAA_CONTEXT *dest_daa_context, TPM_DAA_CONTEXT *src_daa_context);
/*
TPM_DAA_JOINDATA
*/
void TPM_DAAJoindata_Init(TPM_DAA_JOINDATA *tpm_daa_joindata);
TPM_RESULT TPM_DAAJoindata_Load(TPM_DAA_JOINDATA *tpm_daa_joindata,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DAAJoindata_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_JOINDATA *tpm_daa_joindata);
void TPM_DAAJoindata_Delete(TPM_DAA_JOINDATA *tpm_daa_joindata);
void TPM_DAAJoindata_Copy(TPM_DAA_JOINDATA *dest_daa_joindata,
TPM_DAA_JOINDATA *src_daa_joindata);
/*
TPM_DAA_BLOB
*/
void TPM_DAABlob_Init(TPM_DAA_BLOB *tpm_daa_blob);
TPM_RESULT TPM_DAABlob_Load(TPM_DAA_BLOB *tpm_daa_blob,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DAABlob_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_BLOB *tpm_daa_blob);
void TPM_DAABlob_Delete(TPM_DAA_BLOB *tpm_daa_blob);
/*
TPM_DAA_SENSITIVE
*/
void TPM_DAASensitive_Init(TPM_DAA_SENSITIVE *tpm_daa_sensitive);
TPM_RESULT TPM_DAASensitive_Load(TPM_DAA_SENSITIVE *tpm_daa_sensitive,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DAASensitive_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DAA_SENSITIVE *tpm_daa_sensitive);
void TPM_DAASensitive_Delete(TPM_DAA_SENSITIVE *tpm_daa_sensitive);
/*
Stage Common Code
*/
TPM_RESULT TPM_DAADigestContext_GenerateDigestJoin(TPM_DIGEST tpm_digest,
TPM_DAA_SESSION_DATA *tpm_daa_session_data);
TPM_RESULT TPM_DAADigestContext_CheckDigestJoin(TPM_DAA_SESSION_DATA *tpm_daa_session_data);
TPM_RESULT TPM_DAASession_CheckStage(TPM_DAA_SESSION_DATA *tpm_daa_session_data,
BYTE stage);
TPM_RESULT TPM_ComputeF(TPM_BIGNUM *fBignum,
TPM_DAA_SESSION_DATA *tpm_daa_session_data);
TPM_RESULT TPM_ComputeAexpPmodn(BYTE *DAA_scratch,
uint32_t DAA_scratch_size,
TPM_BIGNUM *rBignum,
TPM_BIGNUM xBignum,
TPM_BIGNUM fBignum,
TPM_BIGNUM nBignum);
TPM_RESULT TPM_ComputeZxAexpPmodn(BYTE *DAA_scratch,
uint32_t DAA_scratch_size,
TPM_BIGNUM zBignum,
TPM_BIGNUM aBignum,
TPM_BIGNUM pBignum,
TPM_BIGNUM nBignum);
TPM_RESULT TPM_ComputeApBmodn(TPM_BIGNUM *rBignum,
TPM_BIGNUM aBignum,
TPM_BIGNUM bBignum,
TPM_BIGNUM nBignum);
TPM_RESULT TPM_ComputeApBxC(TPM_BIGNUM *rBignum,
TPM_BIGNUM aBignum,
TPM_BIGNUM bBignum,
TPM_BIGNUM cBignum);
TPM_RESULT TPM_ComputeApBxCpD(TPM_BIGNUM *rBignum,
TPM_BIGNUM aBignum,
TPM_BIGNUM bBignum,
TPM_BIGNUM cBignum,
TPM_BIGNUM dBignum);
TPM_RESULT TPM_ComputeDAAScratch(BYTE *DAA_scratch,
uint32_t DAA_scratch_size,
TPM_BIGNUM bn);
TPM_RESULT TPM_ComputeEnlarge(unsigned char **out,
uint32_t outSize,
unsigned char *in,
uint32_t inSize);
TPM_RESULT TPM_SizedBuffer_ComputeEnlarge(TPM_SIZED_BUFFER *tpm_sized_buffer, uint32_t size);
TPM_RESULT TPM_ComputeEncrypt(TPM_SIZED_BUFFER *outputData,
tpm_state_t *tpm_state,
TPM_DAA_SENSITIVE *tpm_daa_sensitive,
TPM_RESOURCE_TYPE resourceType);
TPM_RESULT TPM_ComputeDecrypt(TPM_DAA_SENSITIVE *tpm_daa_sensitive,
tpm_state_t *tpm_state,
TPM_SIZED_BUFFER *inputData,
TPM_RESOURCE_TYPE resourceType);
TPM_RESULT TPM_SHA1_BignumGenerate(TPM_DIGEST tpm_digest,
TPM_BIGNUM bn,
uint32_t size);
TPM_RESULT TPM_SHA1_SizedBufferCheck(TPM_DIGEST tpm_digest,
TPM_SIZED_BUFFER *tpm_sized_buffer,
uint32_t size);
/*
Processing Common Functions
*/
TPM_RESULT TPM_DAAJoin_Stage00(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA **tpm_daa_session_data,
TPM_BOOL *daaHandleValid,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage01(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage02(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage03(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage04(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage05(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage06(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage07(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage08(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage09_Sign_Stage2(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage10_Sign_Stage3(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage11_Sign_Stage4(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage12(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage13_Sign_Stage6(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAAJoin_Stage14_Sign_Stage7(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage15_Sign_Stage8(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage16_Sign_Stage9(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage17_Sign_Stage11(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData);
TPM_RESULT TPM_DAAJoin_Stage18_Sign_Stage12(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData);
TPM_RESULT TPM_DAAJoin_Stage19(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData);
TPM_RESULT TPM_DAAJoin_Stage20(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData);
TPM_RESULT TPM_DAAJoin_Stage21(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData);
TPM_RESULT TPM_DAAJoin_Stage22(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage23(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAAJoin_Stage24(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData);
TPM_RESULT TPM_DAASign_Stage00(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA **tpm_daa_session_data,
TPM_BOOL *daaHandleValid,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAASign_Stage01(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAASign_Stage05(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAASign_Stage10(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0,
TPM_SIZED_BUFFER *inputData1);
TPM_RESULT TPM_DAASign_Stage13(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAASign_Stage14(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
TPM_RESULT TPM_DAASign_Stage15(tpm_state_t *tpm_state,
TPM_DAA_SESSION_DATA *tpm_daa_session_data,
TPM_SIZED_BUFFER *outputData,
TPM_SIZED_BUFFER *inputData0);
/*
Processing functions
*/
TPM_RESULT TPM_Process_DAAJoin(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DAASign(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

100
src/tpm_debug.c Normal file
View File

@ -0,0 +1,100 @@
/********************************************************************************/
/* */
/* TPM Debug Utilities */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_debug.c 4179 2010-11-10 20:10:24Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#include <stdio.h>
#include "tpm_commands.h"
#include "tpm_load.h"
#include "tpm_debug.h"
#ifndef TPM_DEBUG
int swallow_rc = 0;
int tpm_swallow_printf_args(const char *format, ...)
{
format = format; /* to silence compiler */
return 0;
}
#else
/* TPM_PrintFour() prints a prefix plus 4 bytes of a buffer */
void TPM_PrintFour(const char *string, const unsigned char* buff)
{
if (buff != NULL) {
printf("%s %02x %02x %02x %02x\n",
string,
buff[0],
buff[1],
buff[2],
buff[3]);
}
else {
printf("%s null\n", string);
}
return;
}
#endif
/* TPM_PrintAll() prints 'string', the length, and then the entire byte array
*/
void TPM_PrintAll(const char *string, const unsigned char* buff, uint32_t length)
{
uint32_t i;
if (buff != NULL) {
printf("%s length %u\n ", string, length);
for (i = 0 ; i < length ; i++) {
if (i && !( i % 16 )) {
printf("\n ");
}
printf("%.2X ",buff[i]);
}
printf("\n");
}
else {
printf("%s null\n", string);
}
return;
}

65
src/tpm_debug.h Normal file
View File

@ -0,0 +1,65 @@
/********************************************************************************/
/* */
/* TPM Debug Utilities */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_debug.h 4179 2010-11-10 20:10:24Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_DEBUG_H
#define TPM_DEBUG_H
#include "tpm_types.h"
/* prototypes */
void TPM_PrintFour(const char *string, const unsigned char* buff);
void TPM_PrintAll(const char *string, const unsigned char* buff, uint32_t length);
#ifndef TPM_DEBUG /* if debug is turned off */
/* dummy function to match the printf prototype */
int tpm_swallow_printf_args(const char *format, ...);
/* assign to this dummy value to eliminate "statement has no effect" warnings */
extern int swallow_rc;
/* redefine printf to null */
#define printf swallow_rc = swallow_rc && tpm_swallow_printf_args
#define TPM_PrintFour(arg1, arg2)
#endif /* TPM_DEBUG */
#endif

3944
src/tpm_delegate.c Normal file

File diff suppressed because it is too large Load Diff

257
src/tpm_delegate.h Normal file
View File

@ -0,0 +1,257 @@
/********************************************************************************/
/* */
/* Delegate Handler */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_delegate.h 4526 2011-03-24 21:14:42Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_DELEGATE_H
#define TPM_DELEGATE_H
#include "tpm_structures.h"
/*
TPM_DELEGATE_PUBLIC
*/
void TPM_DelegatePublic_Init(TPM_DELEGATE_PUBLIC *tpm_delegate_public);
TPM_RESULT TPM_DelegatePublic_Load(TPM_DELEGATE_PUBLIC *tpm_delegate_public,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DelegatePublic_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_PUBLIC *tpm_delegate_public);
void TPM_DelegatePublic_Delete(TPM_DELEGATE_PUBLIC *tpm_delegate_public);
TPM_RESULT TPM_DelegatePublic_Copy(TPM_DELEGATE_PUBLIC *dest,
TPM_DELEGATE_PUBLIC *src);
/*
TPM_DELEGATE_SENSITIVE
*/
void TPM_DelegateSensitive_Init(TPM_DELEGATE_SENSITIVE *tpm_delegate_sensitive);
TPM_RESULT TPM_DelegateSensitive_Load(TPM_DELEGATE_SENSITIVE *tpm_delegate_sensitive,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DelegateSensitive_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_SENSITIVE *tpm_delegate_sensitive);
void TPM_DelegateSensitive_Delete(TPM_DELEGATE_SENSITIVE *tpm_delegate_sensitive);
TPM_RESULT TPM_DelegateSensitive_DecryptEncData(TPM_DELEGATE_SENSITIVE *tpm_delegate_sensitive,
TPM_SIZED_BUFFER *sensitiveArea,
TPM_SYMMETRIC_KEY_TOKEN delegateKey);
/*
TPM_DELEGATIONS
*/
void TPM_Delegations_Init(TPM_DELEGATIONS *tpm_delegations);
TPM_RESULT TPM_Delegations_Load(TPM_DELEGATIONS *tpm_delegations,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_Delegations_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATIONS *tpm_delegations);
void TPM_Delegations_Delete(TPM_DELEGATIONS *tpm_delegations);
void TPM_Delegations_Copy(TPM_DELEGATIONS *dest,
TPM_DELEGATIONS *src);
TPM_RESULT TPM_Delegations_CheckPermissionDelegation(TPM_DELEGATIONS *newDelegations,
TPM_DELEGATIONS *currentDelegations);
TPM_RESULT TPM_Delegations_CheckPermission(tpm_state_t *tpm_state,
TPM_DELEGATE_PUBLIC *delegatePublic,
TPM_ENT_TYPE entityType,
TPM_COMMAND_CODE ordinal);
TPM_RESULT TPM_Delegations_CheckOwnerPermission(TPM_DELEGATIONS *tpm_delegations,
TPM_COMMAND_CODE ordinal);
TPM_RESULT TPM_Delegations_CheckKeyPermission(TPM_DELEGATIONS *tpm_delegations,
TPM_COMMAND_CODE ordinal);
/*
TPM_DELEGATE_OWNER_BLOB
*/
void TPM_DelegateOwnerBlob_Init(TPM_DELEGATE_OWNER_BLOB *tpm_delegate_owner_blob);
TPM_RESULT TPM_DelegateOwnerBlob_Load(TPM_DELEGATE_OWNER_BLOB *tpm_delegate_owner_blob,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DelegateOwnerBlob_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_OWNER_BLOB *tpm_delegate_owner_blob);
void TPM_DelegateOwnerBlob_Delete(TPM_DELEGATE_OWNER_BLOB *tpm_delegate_owner_blob);
/*
TPM_DELEGATE_KEY_BLOB
*/
void TPM_DelegateKeyBlob_Init(TPM_DELEGATE_KEY_BLOB *tpm_delegate_key_blob);
TPM_RESULT TPM_DelegateKeyBlob_Load(TPM_DELEGATE_KEY_BLOB *tpm_delegate_key_blob,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DelegateKeyBlob_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_KEY_BLOB *tpm_delegate_key_blob);
void TPM_DelegateKeyBlob_Delete(TPM_DELEGATE_KEY_BLOB *tpm_delegate_key_blob);
/*
TPM_FAMILY_TABLE
*/
void TPM_FamilyTable_Init(TPM_FAMILY_TABLE *tpm_family_table);
TPM_RESULT TPM_FamilyTable_Load(TPM_FAMILY_TABLE *tpm_family_table,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_FamilyTable_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_FAMILY_TABLE *tpm_family_table,
TPM_BOOL store_tag);
void TPM_FamilyTable_Delete(TPM_FAMILY_TABLE *tpm_family_table);
TPM_RESULT TPM_FamilyTable_StoreValid(TPM_STORE_BUFFER *sbuffer,
const TPM_FAMILY_TABLE *tpm_family_table,
TPM_BOOL store_tag);
TPM_RESULT TPM_FamilyTable_GetEntry(TPM_FAMILY_TABLE_ENTRY **tpm_family_table_entry,
TPM_FAMILY_TABLE *tpm_family_table,
TPM_FAMILY_ID familyID);
TPM_RESULT TPM_FamilyTable_GetEnabledEntry(TPM_FAMILY_TABLE_ENTRY **tpm_family_table_entry,
TPM_FAMILY_TABLE *tpm_family_table,
TPM_FAMILY_ID familyID);
TPM_RESULT TPM_FamilyTable_IsSpace(TPM_FAMILY_TABLE_ENTRY **tpm_family_table_entry,
TPM_FAMILY_TABLE *tpm_family_table);
/*
TPM_FAMILY_TABLE_ENTRY
*/
void TPM_FamilyTableEntry_Init(TPM_FAMILY_TABLE_ENTRY *tpm_family_table_entry);
TPM_RESULT TPM_FamilyTableEntry_Load(TPM_FAMILY_TABLE_ENTRY *tpm_family_table_entry,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_FamilyTableEntry_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_FAMILY_TABLE_ENTRY *tpm_family_table_entry,
TPM_BOOL store_tag);
TPM_RESULT TPM_FamilyTableEntry_StorePublic(TPM_STORE_BUFFER *sbuffer,
const TPM_FAMILY_TABLE_ENTRY *tpm_family_table_entry,
TPM_BOOL store_tag);
void TPM_FamilyTableEntry_Delete(TPM_FAMILY_TABLE_ENTRY *tpm_family_table_entry);
/*
TPM_DELEGATE_TABLE
*/
void TPM_DelegateTable_Init(TPM_DELEGATE_TABLE *tpm_delegate_table);
TPM_RESULT TPM_DelegateTable_Load(TPM_DELEGATE_TABLE *tpm_delegate_table,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DelegateTable_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_TABLE *tpm_delegate_table);
void TPM_DelegateTable_Delete(TPM_DELEGATE_TABLE *tpm_delegate_table);
TPM_RESULT TPM_DelegateTable_StoreValid(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_TABLE *tpm_delegate_table);
TPM_RESULT TPM_DelegateTable_GetRow(TPM_DELEGATE_TABLE_ROW **delegateTableRow,
TPM_DELEGATE_TABLE *tpm_delegate_table,
uint32_t rowIndex);
TPM_RESULT TPM_DelegateTable_GetValidRow(TPM_DELEGATE_TABLE_ROW **delegateTableRow,
TPM_DELEGATE_TABLE *tpm_delegate_table,
uint32_t rowIndex);
/*
TPM_DELEGATE_TABLE_ROW
*/
void TPM_DelegateTableRow_Init(TPM_DELEGATE_TABLE_ROW *tpm_delegate_table_row);
TPM_RESULT TPM_DelegateTableRow_Load(TPM_DELEGATE_TABLE_ROW *tpm_delegate_table_row,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_DelegateTableRow_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DELEGATE_TABLE_ROW *tpm_delegate_table_row);
void TPM_DelegateTableRow_Delete(TPM_DELEGATE_TABLE_ROW *tpm_delegate_table_row);
/*
Processing Functions
*/
TPM_RESULT TPM_Process_DelegateManage(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DelegateCreateKeyDelegation(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DelegateCreateOwnerDelegation(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DelegateLoadOwnerDelegation(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DelegateReadTable(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DelegateUpdateVerification(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_DelegateVerifyDelegation(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

161
src/tpm_digest.c Normal file
View File

@ -0,0 +1,161 @@
/********************************************************************************/
/* */
/* Digest Handler */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_digest.c 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#include <stdio.h>
#include <string.h>
#include "tpm_debug.h"
#include "tpm_error.h"
#include "tpm_structures.h"
#include "tpm_digest.h"
/* TPM_Digest_Init resets a digest structure to zeros */
void TPM_Digest_Init(TPM_DIGEST tpm_digest)
{
printf(" TPM_Digest_Init:\n");
memset(tpm_digest, 0, TPM_DIGEST_SIZE);
return;
}
/* TPM_Digest_Load()
deserialize the structure from a 'stream'
'stream_size' is checked for sufficient data
returns 0 or error codes
*/
TPM_RESULT TPM_Digest_Load(TPM_DIGEST tpm_digest,
unsigned char **stream,
uint32_t *stream_size)
{
TPM_RESULT rc = 0;
printf(" TPM_Digest_Load:\n");
rc = TPM_Loadn(tpm_digest, TPM_DIGEST_SIZE, stream, stream_size);
return rc;
}
/* TPM_Digest_Store()
serialize the structure to a stream contained in 'sbuffer'
returns 0 or error codes
After use, call TPM_Sbuffer_Delete() to free memory
*/
TPM_RESULT TPM_Digest_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DIGEST tpm_digest)
{
TPM_RESULT rc = 0;
printf(" TPM_Digest_Store:\n");
rc = TPM_Sbuffer_Append(sbuffer, tpm_digest, TPM_DIGEST_SIZE);
return rc;
}
void TPM_Digest_Set(TPM_DIGEST tpm_digest)
{
printf(" TPM_Digest_Set:\n");
memset(tpm_digest, 0xff, TPM_DIGEST_SIZE);
}
void TPM_Digest_Copy(TPM_DIGEST destination, const TPM_DIGEST source)
{
printf(" TPM_Digest_Copy:\n");
memcpy(destination, source, TPM_DIGEST_SIZE);
return;
}
void TPM_Digest_XOR(TPM_DIGEST out, const TPM_DIGEST in1, const TPM_DIGEST in2)
{
size_t i;
printf(" TPM_Digest_XOR:\n");
for (i = 0 ; i < TPM_DIGEST_SIZE ; i++) {
out[i] = in1[i] ^ in2[i];
}
return;
}
/* TPM_Digest_Compare() compares two digests, returning 0 if they are equal
*/
TPM_RESULT TPM_Digest_Compare(const TPM_DIGEST expect, const TPM_DIGEST actual)
{
TPM_RESULT rc = 0;
printf(" TPM_Digest_Compare:\n");
rc = memcmp(expect, actual, TPM_DIGEST_SIZE);
if (rc != 0) {
printf("TPM_Digest_Compare: Error comparing digest\n");
TPM_PrintFour(" TPM_Digest_Compare: Expect", expect);
TPM_PrintFour(" TPM_Digest_Compare: Actual", actual);
rc = TPM_AUTHFAIL;
}
return rc;
}
void TPM_Digest_IsZero(TPM_BOOL *isZero, TPM_DIGEST tpm_digest)
{
size_t i;
printf(" TPM_Digest_IsZero:\n");
for (i = 0, *isZero = TRUE ; (i < TPM_DIGEST_SIZE) && *isZero ; i++) {
if (tpm_digest[i] != 0) {
*isZero = FALSE;
}
}
return;
}
void TPM_Digest_IsMinusOne(TPM_BOOL *isMinusOne, TPM_DIGEST tpm_digest)
{
size_t i;
printf(" TPM_Digest_IsMinusOne:\n");
for (i = 0, *isMinusOne = TRUE ; (i < TPM_DIGEST_SIZE) && *isMinusOne ; i++) {
if (tpm_digest[i] != 0xff) {
*isMinusOne = FALSE;
}
}
return;
}

62
src/tpm_digest.h Normal file
View File

@ -0,0 +1,62 @@
/********************************************************************************/
/* */
/* Digest Handler */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_digest.h 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_DIGEST_H
#define TPM_DIGEST_H
#include "tpm_structures.h"
#include "tpm_store.h"
void TPM_Digest_Init(TPM_DIGEST tpm_digest);
TPM_RESULT TPM_Digest_Load(TPM_DIGEST tpm_digest,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_Digest_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_DIGEST tpm_digest);
void TPM_Digest_Set(TPM_DIGEST tpm_digest);
void TPM_Digest_Copy(TPM_DIGEST destination, const TPM_DIGEST source);
void TPM_Digest_XOR(TPM_DIGEST out,
const TPM_DIGEST in1,
const TPM_DIGEST in2);
TPM_RESULT TPM_Digest_Compare(const TPM_DIGEST expect, const TPM_DIGEST actual);
void TPM_Digest_IsZero(TPM_BOOL *isZero, TPM_DIGEST tpm_digest);
void TPM_Digest_IsMinusOne(TPM_BOOL *isMinusOne, TPM_DIGEST tpm_digest);
#endif

43
src/tpm_error.c Normal file
View File

@ -0,0 +1,43 @@
/********************************************************************************/
/* */
/* Error Response */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_error.c 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#include <stdio.h>
#include "tpm_error.h"

233
src/tpm_global.c Normal file
View File

@ -0,0 +1,233 @@
/********************************************************************************/
/* */
/* Global Variables */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_global.c 4621 2011-09-09 20:19:42Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#include <string.h>
#include <stdio.h>
#include "tpm_crypto.h"
#include "tpm_debug.h"
#include "tpm_digest.h"
#include "tpm_error.h"
#include "tpm_io.h"
#include "tpm_init.h"
#include "tpm_key.h"
#include "tpm_nvfile.h"
#include "tpm_nvram.h"
#include "tpm_permanent.h"
#include "tpm_platform.h"
#include "tpm_startup.h"
#include "tpm_structures.h"
#include "tpm_global.h"
/* state for the TPM's */
tpm_state_t *tpm_instances[TPMS_MAX];
/* TPM_Global_Init initializes the tpm_state to default values.
It does not load any data from or store data to NVRAM
*/
TPM_RESULT TPM_Global_Init(tpm_state_t *tpm_state)
{
TPM_RESULT rc = 0;
printf("TPM_Global_Init: TPMs %lu\n",
(unsigned long)sizeof(tpm_instances)/sizeof(tpm_state_t *));
/* initialize the TPM_STANY_FLAGS structure */
if (rc == 0) {
/* set the structure to 0 for security, clean out old secrets */
memset(tpm_state, 0 , sizeof(tpm_state_t));
/* the virtual TPM number NOTE: This must be done early as it is used to construct
nn.permall file names */
tpm_state->tpm_number = TPM_ILLEGAL_INSTANCE_HANDLE;
/* initialize the TPM_PERMANENT_FLAGS structure */
printf("TPM_Global_Init: Initializing TPM_PERMANENT_FLAGS\n");
TPM_PermanentFlags_Init(&(tpm_state->tpm_permanent_flags));
/* initialize the TPM_STCLEAR_FLAGS structure */
printf("TPM_Global_Init: Initializing TPM_STCLEAR_FLAGS\n");
TPM_StclearFlags_Init(&(tpm_state->tpm_stclear_flags));
/* initialize the TPM_STANY_FLAGS structure */
printf("TPM_Global_Init: Initializing TPM_STANY_FLAGS\n");
TPM_StanyFlags_Init(&(tpm_state->tpm_stany_flags));
/* initialize TPM_PERMANENT_DATA structure */
printf("TPM_Global_Init: Initializing TPM_PERMANENT_DATA\n");
rc = TPM_PermanentData_Init(&(tpm_state->tpm_permanent_data), TRUE);
}
if (rc == 0) {
/* initialize TPM_STCLEAR_DATA structure */
printf("TPM_Global_Init: Initializing TPM_STCLEAR_DATA\n");
TPM_StclearData_Init(&(tpm_state->tpm_stclear_data),
tpm_state->tpm_permanent_data.pcrAttrib,
TRUE); /* initialize the PCR's */
/* initialize TPM_STANY_DATA structure */
printf("TPM_Global_Init: Initializing TPM_STANY_DATA\n");
rc = TPM_StanyData_Init(&(tpm_state->tpm_stany_data));
}
/* initialize the TPM_KEY_HANDLE_LIST structure */
if (rc == 0) {
printf("TPM_Global_Init: Initializing TPM_KEY_HANDLE_LIST\n");
TPM_KeyHandleEntries_Init(tpm_state->tpm_key_handle_entries);
/* initialize the SHA1 thread context */
tpm_state->sha1_context = NULL;
/* initialize the TIS SHA1 thread context */
tpm_state->sha1_context_tis = NULL;
tpm_state->transportHandle = 0;
printf("TPM_Global_Init: Initializing TPM_NV_INDEX_ENTRIES\n");
TPM_NVIndexEntries_Init(&(tpm_state->tpm_nv_index_entries));
}
/* comes up in limited operation mode */
/* shutdown is set on a self test failure, before calling TPM_Global_Init() */
if (rc == 0) {
printf(" TPM_Global_Init: Set testState to %u \n", TPM_TEST_STATE_LIMITED);
tpm_state->testState = TPM_TEST_STATE_LIMITED;
}
else {
printf(" TPM_Global_Init: Set testState to %u \n", TPM_TEST_STATE_FAILURE);
tpm_state->testState = TPM_TEST_STATE_FAILURE;
}
return rc;
}
/* TPM_Global_Load() loads the tpm_state_t global structures for the TPM instance from NVRAM.
tpm_state->tpm_number must be set by the caller.
Returns
0 on success.
TPM_FAIL on failure to load (fatal), since it should never occur
*/
TPM_RESULT TPM_Global_Load(tpm_state_t *tpm_state)
{
TPM_RESULT rc = 0;
printf("TPM_Global_Load:\n");
/* TPM_PERMANENT_DATA, TPM_PERMANENT_FLAGS, owner evict keys, and NV defined space. */
if (rc == 0) {
rc = TPM_PermanentAll_NVLoad(tpm_state);
}
if (rc == 0) {
rc = TPM_VolatileAll_NVLoad(tpm_state);
}
return rc;
}
/* TPM_Global_Store() store the tpm_state_t global structure for the TPM instance to NVRAM
tpm_state->tpm_number must be set by the caller.
*/
TPM_RESULT TPM_Global_Store(tpm_state_t *tpm_state)
{
TPM_RESULT rc = 0;
printf(" TPM_Global_Store:\n");
if (rc == 0) {
rc = TPM_PermanentAll_NVStore(tpm_state, TRUE, 0);
}
if (rc == 0) {
rc = TPM_VolatileAll_NVStore(tpm_state);
}
return rc;
}
/* TPM_Global_Delete()
No-OP if the parameter is NULL, else:
frees memory allocated for the object
sets pointers to NULL
calls TPM_Global_Init to set members back to default values
The object itself is not freed
*/
void TPM_Global_Delete(tpm_state_t *tpm_state)
{
printf(" TPM_Global_Delete:\n");
if (tpm_state != NULL) {
/* TPM_PERMANENT_FLAGS have no allocated memory or secrets */
/* TPM_STCLEAR_FLAGS have no allocated memory or secrets */
/* TPM_STANY_FLAGS have no allocated memory or secrets */
printf(" TPM_Global_Delete: Deleting TPM_PERMANENT_DATA\n");
TPM_PermanentData_Delete(&(tpm_state->tpm_permanent_data), TRUE);
printf(" TPM_Global_Delete: Deleting TPM_STCLEAR_DATA\n");
TPM_StclearData_Delete(&(tpm_state->tpm_stclear_data),
tpm_state->tpm_permanent_data.pcrAttrib,
TRUE); /* reset the PCR's */
printf(" TPM_Global_Delete: Deleting TPM_STANY_DATA\n");
TPM_StanyData_Delete(&(tpm_state->tpm_stany_data));
printf(" TPM_Global_Delete: Deleting key handle entries\n");
TPM_KeyHandleEntries_Delete(tpm_state->tpm_key_handle_entries);
printf(" TPM_Global_Delete: Deleting SHA1 contexts\n");
TPM_SHA1Delete(&(tpm_state->sha1_context));
TPM_SHA1Delete(&(tpm_state->sha1_context_tis));
TPM_NVIndexEntries_Delete(&(tpm_state->tpm_nv_index_entries));
}
return;
}
/* TPM_Global_GetPhysicalPresence() returns 'physicalPresence' TRUE if either TPM_STCLEAR_FLAGS ->
physicalPresence is TRUE or hardware physical presence is indicated.
*/
TPM_RESULT TPM_Global_GetPhysicalPresence(TPM_BOOL *physicalPresence,
const tpm_state_t *tpm_state)
{
TPM_RESULT rc = 0;
/* check for physicalPresence set by the command ordinal */
*physicalPresence = tpm_state->tpm_stclear_flags.physicalPresence;
printf(" TPM_Global_GetPhysicalPresence: physicalPresence flag is %02x\n", *physicalPresence);
/* if the software flag is true, result is true, no need to check the hardware */
/* if the TPM_STCLEAR_FLAGS flag is FALSE, check the hardware */
if (!(*physicalPresence)) {
/* if physicalPresenceHWEnable is FALSE, the hardware signal is disabled */
if (tpm_state->tpm_permanent_flags.physicalPresenceHWEnable) {
/* If it's TRUE, check the hardware signal */
rc = TPM_IO_GetPhysicalPresence(physicalPresence, tpm_state->tpm_number);
printf(" TPM_Global_GetPhysicalPresence: physicalPresence signal is %02x\n",
*physicalPresence);
}
}
return rc;
}

101
src/tpm_global.h Normal file
View File

@ -0,0 +1,101 @@
/********************************************************************************/
/* */
/* Global Variables */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_global.h 4285 2011-01-17 21:27:05Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_GLOBAL_H
#define TPM_GLOBAL_H
#include "tpm_nvram_const.h"
#include "tpm_types.h"
#include "tpm_structures.h"
#define TPM_TEST_STATE_LIMITED 1 /* limited operation mode */
#define TPM_TEST_STATE_FULL 2 /* full operation mode */
#define TPM_TEST_STATE_FAILURE 3 /* failure mode */
typedef struct tdTPM_STATE
{
/* the number of the virtual TPM */
uint32_t tpm_number;
/* 7.1 TPM_PERMANENT_FLAGS */
TPM_PERMANENT_FLAGS tpm_permanent_flags;
/* 7.2 TPM_STCLEAR_FLAGS */
TPM_STCLEAR_FLAGS tpm_stclear_flags;
/* 7.3 TPM_STANY_FLAGS */
TPM_STANY_FLAGS tpm_stany_flags;
/* 7.4 TPM_PERMANENT_DATA */
TPM_PERMANENT_DATA tpm_permanent_data;
/* 7.5 TPM_STCLEAR_DATA */
TPM_STCLEAR_DATA tpm_stclear_data;
/* 7.6 TPM_STANY_DATA */
TPM_STANY_DATA tpm_stany_data;
/* 5.6 TPM_KEY_HANDLE_ENTRY */
TPM_KEY_HANDLE_ENTRY tpm_key_handle_entries[TPM_KEY_HANDLES];
/* Context for SHA1 functions */
void *sha1_context;
void *sha1_context_tis;
TPM_TRANSHANDLE transportHandle; /* non-zero if the context was set up in a transport
session */
/* self test shutdown */
uint32_t testState;
/* NVRAM volatile data marker. Cleared at TPM_Startup(ST_Clear), it holds all indexes which
have been read. The index not being present indicates that some volatile fields should be
cleared at first read. */
TPM_NV_INDEX_ENTRIES tpm_nv_index_entries;
/* NOTE: members added here should be initialized by TPM_Global_Init() and possibly added to
TPM_SaveState_Load() and TPM_SaveState_Store() */
} tpm_state_t;
/* state for the TPM */
extern tpm_state_t *tpm_instances[];
/*
tpm_state_t
*/
TPM_RESULT TPM_Global_Init(tpm_state_t *tpm_state);
TPM_RESULT TPM_Global_Load(tpm_state_t *tpm_state);
TPM_RESULT TPM_Global_Store(tpm_state_t *tpm_state);
void TPM_Global_Delete(tpm_state_t *tpm_state);
TPM_RESULT TPM_Global_GetPhysicalPresence(TPM_BOOL *physicalPresence,
const tpm_state_t *tpm_state);
#endif

1439
src/tpm_identity.c Normal file

File diff suppressed because it is too large Load Diff

129
src/tpm_identity.h Normal file
View File

@ -0,0 +1,129 @@
/********************************************************************************/
/* */
/* TPM Identity Handling */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_identity.h 4071 2010-04-29 19:26:45Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_IDENTITY_H
#define TPM_IDENTITY_H
#include "tpm_global.h"
/*
TPM_EK_BLOB
*/
void TPM_EKBlob_Init(TPM_EK_BLOB *tpm_ek_blob);
TPM_RESULT TPM_EKBlob_Load(TPM_EK_BLOB *tpm_ek_blob,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_EKBlob_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_EK_BLOB *tpm_ek_blob);
void TPM_EKBlob_Delete(TPM_EK_BLOB *tpm_ek_blob);
/*
TPM_EK_BLOB_ACTIVATE
*/
void TPM_EKBlobActivate_Init(TPM_EK_BLOB_ACTIVATE *tpm_ek_blob_activate);
TPM_RESULT TPM_EKBlobActivate_Load(TPM_EK_BLOB_ACTIVATE *tpm_ek_blob_activate,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_EKBlobActivate_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_EK_BLOB_ACTIVATE *tpm_ek_blob_activate);
void TPM_EKBlobActivate_Delete(TPM_EK_BLOB_ACTIVATE *tpm_ek_blob_activate);
/*
TPM_EK_BLOB_AUTH
*/
void TPM_EKBlobAuth_Init(TPM_EK_BLOB_AUTH *tpm_ek_blob_auth);
TPM_RESULT TPM_EKBlobAuth_Load(TPM_EK_BLOB_AUTH *tpm_ek_blob_auth,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_EKBlobAuth_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_EK_BLOB_AUTH *tpm_ek_blob_auth);
void TPM_EKBlobAuth_Delete(TPM_EK_BLOB_AUTH *tpm_ek_blob_auth);
/*
TPM_IDENTITY_CONTENTS
*/
void TPM_IdentityContents_Init(TPM_IDENTITY_CONTENTS *tpm_identity_contents);
TPM_RESULT TPM_IdentityContents_Load(TPM_IDENTITY_CONTENTS *tpm_identity_contents,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_IdentityContents_Store(TPM_STORE_BUFFER *sbuffer,
TPM_IDENTITY_CONTENTS *tpm_identity_contents);
void TPM_IdentityContents_Delete(TPM_IDENTITY_CONTENTS *tpm_identity_contents);
/*
TPM_ASYM_CA_CONTENTS
*/
void TPM_AsymCaContents_Init(TPM_ASYM_CA_CONTENTS *tpm_asym_ca_contents);
TPM_RESULT TPM_AsymCaContents_Load(TPM_ASYM_CA_CONTENTS *tpm_asym_ca_contents,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_AsymCaContents_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_ASYM_CA_CONTENTS *tpm_asym_ca_contents);
void TPM_AsymCaContents_Delete(TPM_ASYM_CA_CONTENTS *tpm_asym_ca_contents);
/*
Processing Functions
*/
TPM_RESULT TPM_Process_MakeIdentity(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
TPM_RESULT TPM_Process_ActivateIdentity(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
#endif

1134
src/tpm_init.c Normal file

File diff suppressed because it is too large Load Diff

136
src/tpm_init.h Normal file
View File

@ -0,0 +1,136 @@
/********************************************************************************/
/* */
/* TPM Initialization */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_init.h 4403 2011-02-08 18:28:22Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_INIT_H
#define TPM_INIT_H
#include "tpm_global.h"
#include "tpm_store.h"
#include "tpm_structures.h"
/* Power up initialization */
TPM_RESULT TPM_MainInit(void);
/*
TPM_STANY_FLAGS
*/
void TPM_StanyFlags_Init(TPM_STANY_FLAGS *tpm_stany_flags);
TPM_RESULT TPM_StanyFlags_Load(TPM_STANY_FLAGS *tpm_stany_flags,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_StanyFlags_Store(TPM_STORE_BUFFER *sbuffer,
TPM_STANY_FLAGS *tpm_stany_flags);
/*
TPM_STCLEAR_FLAGS
*/
void TPM_StclearFlags_Init(TPM_STCLEAR_FLAGS *tpm_stclear_flags);
TPM_RESULT TPM_StclearFlags_Load(TPM_STCLEAR_FLAGS *tpm_stclear_flags,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_StclearFlags_Store(TPM_STORE_BUFFER *sbuffer,
const TPM_STCLEAR_FLAGS *tpm_stclear_flags);
TPM_RESULT TPM_StclearFlags_StoreBitmap(uint32_t *tpm_bitmap,
const TPM_STCLEAR_FLAGS *tpm_stclear_flags);
/*
TPM_STANY_DATA
*/
TPM_RESULT TPM_StanyData_Init(TPM_STANY_DATA *tpm_stany_data);
TPM_RESULT TPM_StanyData_Load(TPM_STANY_DATA *tpm_stany_data,
unsigned char **stream,
uint32_t *stream_size);
TPM_RESULT TPM_StanyData_Store(TPM_STORE_BUFFER *sbuffer,
TPM_STANY_DATA *tpm_stany_data);
void TPM_StanyData_Delete(TPM_STANY_DATA *tpm_stany_data);
/*
TPM_STCLEAR_DATA
*/
void TPM_StclearData_Init(TPM_STCLEAR_DATA *tpm_stclear_data,
TPM_PCR_ATTRIBUTES *pcrAttrib,
TPM_BOOL pcrInit);
TPM_RESULT TPM_StclearData_Load(TPM_STCLEAR_DATA *tpm_stclear_data,
unsigned char **stream,
uint32_t *stream_size,
TPM_PCR_ATTRIBUTES *pcrAttrib);
TPM_RESULT TPM_StclearData_Store(TPM_STORE_BUFFER *sbuffer,
TPM_STCLEAR_DATA *tpm_stclear_data,
TPM_PCR_ATTRIBUTES *pcrAttrib);
void TPM_StclearData_Delete(TPM_STCLEAR_DATA *tpm_stclear_data,
TPM_PCR_ATTRIBUTES *pcrAttrib,
TPM_BOOL pcrInit);
void TPM_StclearData_SessionInit(TPM_STCLEAR_DATA *tpm_stclear_data);
void TPM_StclearData_SessionDelete(TPM_STCLEAR_DATA *tpm_stclear_data);
void TPM_StclearData_AuthSessionDelete(TPM_STCLEAR_DATA *tpm_stclear_data);
/* Actions */
TPM_RESULT TPM_InitCmd(tpm_state_t *tpm_state);
/*
Processing Functions
*/
TPM_RESULT TPM_Process_Init(tpm_state_t *tpm_state,
TPM_STORE_BUFFER *response,
TPM_TAG tag,
uint32_t paramSize,
TPM_COMMAND_CODE ordinal,
unsigned char *command,
TPM_TRANSPORT_INTERNAL *transportInternal);
/* generic function prototype for a handle array getEntry callback function */
typedef TPM_RESULT (*TPM_GETENTRY_FUNCTION_T )(void **entry,
void *entries,
TPM_HANDLE handle);
TPM_RESULT TPM_Handle_GenerateHandle(TPM_HANDLE *tpm_handle,
void *tpm_handle_entries,
TPM_BOOL keepHandle,
TPM_BOOL isKeyHandle,
TPM_GETENTRY_FUNCTION_T getEntryFunction);
#endif

71
src/tpm_io.h Normal file
View File

@ -0,0 +1,71 @@
/********************************************************************************/
/* */
/* TPM Host IO */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: tpm_io.h 4211 2010-11-22 21:07:24Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_IO_H
#define TPM_IO_H
#include "tpm_types.h"
/* non-portable structure to pass around IO file descriptor */
typedef struct TPM_CONNECTION_FD {
#ifdef TPM_POSIX
int fd; /* for socket, just an int */
#endif
} TPM_CONNECTION_FD;
TPM_RESULT TPM_IO_IsNotifyAvailable(TPM_BOOL *isAvailable);
TPM_RESULT TPM_IO_Connect(TPM_CONNECTION_FD *connection_fd,
void *mainLoopArgs);
TPM_RESULT TPM_IO_Read(TPM_CONNECTION_FD *connection_fd,
unsigned char *buffer,
uint32_t *paramSize,
size_t buffer_size,
void *mainLoopArgs);
TPM_RESULT TPM_IO_Write(TPM_CONNECTION_FD *connection_fd,
const unsigned char *buffer,
size_t buffer_length);
TPM_RESULT TPM_IO_Disconnect(TPM_CONNECTION_FD *connection_fd);
/* function for notifying listener(s) about PCRExtend events */
TPM_RESULT TPM_IO_ClientSendNotification(const void *buf, size_t count);
#endif

5526
src/tpm_key.c Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More