From 064f5be37a24b4418b77faad95fdca1913273cbf Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:33:17 +0000 Subject: import tpm2-tss-1.3.0-2.el7 --- diff --git a/.gitignore b/.gitignore index 37b6e61..39a2070 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/TPM2.0-TSS-1.0.tar.gz +SOURCES/tpm2-tss-1.3.0.tar.gz diff --git a/.tpm2-tss.metadata b/.tpm2-tss.metadata index 5394e16..23246df 100644 --- a/.tpm2-tss.metadata +++ b/.tpm2-tss.metadata @@ -1 +1 @@ -c610fa5273909394fa54174afcd7541a5c87d16b SOURCES/TPM2.0-TSS-1.0.tar.gz +5b72beeaadf36571b41fd7a96d1a895c6205615b SOURCES/tpm2-tss-1.3.0.tar.gz diff --git a/SOURCES/Fix-memory-leaks-on-error-conditions-in-InitSysConte.patch b/SOURCES/Fix-memory-leaks-on-error-conditions-in-InitSysConte.patch deleted file mode 100644 index bedd07d..0000000 --- a/SOURCES/Fix-memory-leaks-on-error-conditions-in-InitSysConte.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -ur TPM2.0-TSS-1.0/common/syscontext.c TPM2.0-TSS-1.0-new/common/syscontext.c ---- TPM2.0-TSS-1.0/common/syscontext.c 2016-11-01 06:53:15.000000000 -0700 -+++ TPM2.0-TSS-1.0-new/common/syscontext.c 2017-04-02 16:36:47.603294296 -0700 -@@ -58,10 +58,12 @@ - // Initialized the system context structure. - rval = Tss2_Sys_Initialize( sysContext, contextSize, tctiContext, abiVersion ); - -- if( rval == TSS2_RC_SUCCESS ) -+ if( rval == TSS2_RC_SUCCESS ) { - return sysContext; -- else -- return 0; -+ } else { -+ free (sysContext); -+ return NULL; -+ } - } - else - { -diff -ur TPM2.0-TSS-1.0/resourcemgr/resourcemgr.c TPM2.0-TSS-1.0-new/resourcemgr/resourcemgr.c ---- TPM2.0-TSS-1.0/resourcemgr/resourcemgr.c 2016-11-01 06:53:15.000000000 -0700 -+++ TPM2.0-TSS-1.0-new/resourcemgr/resourcemgr.c 2017-04-02 16:36:47.604294312 -0700 -@@ -2708,6 +2708,7 @@ - if( cmdServerStruct->connectSock == INVALID_SOCKET ) - { - printf( "Accept failed. Error is 0x%x\n", WSAGetLastError() ); -+ (*rmFree)( cmdServerStruct ); - continue; - } - -@@ -2752,6 +2753,7 @@ - if( 0 == strcmp( &otherCmdStr[0], serverStruct->serverName ) ) - { - printf( "SockServer died (%s), socket: 0x%x.\n", serverStruct->serverName, serverStruct->connectSock ); -+ (*rmFree)( cmdServerStruct ); - ExitThread( 0 ); - } - diff --git a/SOURCES/autoconf-fixup.patch b/SOURCES/autoconf-fixup.patch new file mode 100644 index 0000000..14a957b --- /dev/null +++ b/SOURCES/autoconf-fixup.patch @@ -0,0 +1,10 @@ +diff -urN tpm2-tss-1.3.0/configure.ac tpm2-tss-1.3.0-new/configure.ac +--- tpm2-tss-1.3.0/configure.ac 2017-12-07 18:02:44.000000000 -0700 ++++ tpm2-tss-1.3.0-new/configure.ac 2017-12-14 13:33:53.164624755 -0700 +@@ -1,5 +1,4 @@ +-AC_INIT([tpm2-tss], +- [m4_esyscmd_s([git describe --tags --always --dirty])]) ++AC_INIT([tpm2-tss],[1.3.0]) + AC_CONFIG_MACRO_DIR([m4]) + AC_PROG_CC + AC_PROG_CXX diff --git a/SOURCES/avoid-potential-null-deref.patch b/SOURCES/avoid-potential-null-deref.patch deleted file mode 100644 index b71ff66..0000000 --- a/SOURCES/avoid-potential-null-deref.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur TPM2.0-TSS-1.0/sysapi/sysapi_util/CommandUtil.c TPM2.0-TSS-1.0-new/sysapi/sysapi_util/CommandUtil.c ---- TPM2.0-TSS-1.0/sysapi/sysapi_util/CommandUtil.c 2016-11-01 06:53:15.000000000 -0700 -+++ TPM2.0-TSS-1.0-new/sysapi/sysapi_util/CommandUtil.c 2017-04-03 10:19:11.337348997 -0700 -@@ -184,13 +184,18 @@ - // Common to all _Complete - TSS2_RC CommonComplete( TSS2_SYS_CONTEXT *sysContext ) - { -- UINT32 rspSize = CHANGE_ENDIAN_DWORD( ( (TPM20_Header_Out *)( SYS_CONTEXT->tpmOutBuffPtr ) )->responseSize ); -+ UINT32 rspSize; - - if( sysContext == NULL ) - { - return TSS2_SYS_RC_BAD_REFERENCE; - } -- else if( SYS_CONTEXT->previousStage != CMD_STAGE_RECEIVE_RESPONSE || SYS_CONTEXT->rval != TSS2_RC_SUCCESS ) -+ else -+ { -+ rspSize = CHANGE_ENDIAN_DWORD( ( (TPM20_Header_Out *)( SYS_CONTEXT->tpmOutBuffPtr ) )->responseSize ); -+ } -+ -+ if( SYS_CONTEXT->previousStage != CMD_STAGE_RECEIVE_RESPONSE || SYS_CONTEXT->rval != TSS2_RC_SUCCESS ) - { - SYS_CONTEXT->rval = TSS2_SYS_RC_BAD_SEQUENCE; - } diff --git a/SOURCES/resourcemgr.8 b/SOURCES/resourcemgr.8 deleted file mode 100644 index 4c5f45d..0000000 --- a/SOURCES/resourcemgr.8 +++ /dev/null @@ -1,28 +0,0 @@ -.TH RESOURCEMGR "8" "2017-05-24" "TPM Management" -.SH NAME -resourcemgr \- TPM resource manager -.SH SYNOPSIS -.B resourcemgr -[\fIOPTION\fR]... -.SH DESCRIPTION -.PP -Manage resources for Trusted Platform Module usage. -.TP -\fB\-h\fR, \fB\-\-help\fR -display this help and exit -.TP -\fB\-sim\fR -Tells resource manager to communicate with TPM 2.0 simulator (default: communicates with local TPM) -.TP -\fB\-tpmhost \fIaddress\fB\fR -Specifies the host IP address for communicating with the TPM (default: 127.0.0.1; only valid if -sim used) -.TP -\fB\-tpmport \fIport\fB\fR -Specifies the port number for communicating with the TPM (default: 2321; only valid if -sim used) -.TP -\fB\-apport \fIport\fB\fR -Specifies the port number for communicating with the calling application (default: 2323) -.SH AUTHOR -Written by Jerry Snitselaar. -.SH COPYRIGHT -Copyright \(co 2017 Red Hat Inc. diff --git a/SOURCES/resourcemgr.service b/SOURCES/resourcemgr.service deleted file mode 100644 index 9c3b3b4..0000000 --- a/SOURCES/resourcemgr.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=TPM2 resource manager & access broker -Documentation=http://www.github.com/01org/TPM2.0-TSS - -[Service] -Type=simple -ExecStart=/usr/sbin/resourcemgr - -[Install] -WantedBy=multi-user.target diff --git a/SOURCES/swap-pthread-check.patch b/SOURCES/swap-pthread-check.patch deleted file mode 100644 index a724fa0..0000000 --- a/SOURCES/swap-pthread-check.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ur TPM2.0-TSS-1.0/configure.ac TPM2.0-TSS-1.0-new/configure.ac ---- TPM2.0-TSS-1.0/configure.ac 2016-11-01 06:53:15.000000000 -0700 -+++ TPM2.0-TSS-1.0-new/configure.ac 2017-03-05 23:59:35.063459673 -0700 -@@ -7,7 +7,9 @@ - AC_PROG_CC - AC_PROG_CXX - LT_INIT() --AX_PTHREAD([], [AC_MSG_ERROR([requires pthread])]) -+AC_CHECK_LIB([pthread], [pthread_create], [PTHREAD_CFLAGS+=-pthread], -+ [AC_MSG_ERROR([requires pthread])]) -+AC_SUBST([PTHREAD_CFLAGS]) - AM_INIT_AUTOMAKE([foreign - subdir-objects]) - AC_CONFIG_FILES([Makefile]) -Only in TPM2.0-TSS-1.0-new/: configure.ac~ diff --git a/SOURCES/test-app.patch b/SOURCES/test-app.patch deleted file mode 100644 index f9dbd05..0000000 --- a/SOURCES/test-app.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur TPM2.0-TSS-1.0/Makefile.am TPM2.0-TSS-1.0-new/Makefile.am ---- TPM2.0-TSS-1.0/Makefile.am 2016-11-01 06:53:15.000000000 -0700 -+++ TPM2.0-TSS-1.0-new/Makefile.am 2017-03-11 16:51:38.164636194 -0700 -@@ -34,7 +34,7 @@ - - # stuff to build, what that stuff is, and where/if to install said stuff - sbin_PROGRAMS = $(resourcemgr) --noinst_PROGRAMS = $(tpmclient) $(tpmtest) -+bin_PROGRAMS = $(tpmclient) $(tpmtest) - lib_LTLIBRARIES = $(libsapi) $(libtcti_device) $(libtcti_socket) - - # unit tests diff --git a/SPECS/tpm2-tss.spec b/SPECS/tpm2-tss.spec index ea21221..574ae59 100755 --- a/SPECS/tpm2-tss.spec +++ b/SPECS/tpm2-tss.spec @@ -1,35 +1,23 @@ Name: tpm2-tss -Version: 1.0 -Release: 5%{?dist} +Version: 1.3.0 +Release: 2%{?dist} Summary: TPM2.0 Software Stack -%global pkg_prefix TPM2.0-TSS - # The entire source code is under BSD except implementation.h and tpmb.h which # is under TCGL(Trusted Computing Group License). License: BSD and TCGL -URL: https://github.com/01org/TPM2.0-TSS -Source0: https://github.com/01org/TPM2.0-TSS/archive/%{version}.tar.gz#/%{pkg_prefix}-%{version}.tar.gz -Source1: resourcemgr.service -Source2: resourcemgr.8 - -# RHEL only (resolves building on RHEL) -Patch0001: swap-pthread-check.patch -# RHEL only (enable install of test programs) -Patch0002: test-app.patch -# backport of upstream commit b0f09514467f3 -Patch0003: Fix-memory-leaks-on-error-conditions-in-InitSysConte.patch -# backport of upstream commit b6ad056f2050b -Patch0004: avoid-potential-null-deref.patch +URL: https://github.com/01org/tpm2-tss +Source0: https://github.com/01org/tpm2-tss/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz + +Patch0: autoconf-fixup.patch BuildRequires: gcc BuildRequires: gcc-c++ +BuildRequires: autoconf-archive BuildRequires: libtool BuildRequires: pkgconfig -BuildRequires: systemd-units -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units + +Obsoletes: %{name}-utils <= 1.1.0-1 # this package does not support big endian arch so far, # and has been verified only on Intel platforms. @@ -41,7 +29,7 @@ APIs. It sits between TPM driver and applications, providing TPM2.0 specified APIs for applications to access TPM module through kernel TPM drivers. %prep -%autosetup -p1 -n %{pkg_prefix}-%{version} +%autosetup -p1 -n %{name}-%{version} ./bootstrap @@ -52,35 +40,15 @@ APIs for applications to access TPM module through kernel TPM drivers. %install %make_install find %{buildroot}%{_libdir} -type f -name \*.la -delete -mkdir -p %{buildroot}%{_bindir} -mkdir -p %{buildroot}%{_unitdir}/ -install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/ -mkdir -p %{buildroot}%{_mandir}/man8/ -install -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man8/ %clean rm -rf %{buildroot} -%post -%systemd_post resourcemgr.service -/sbin/ldconfig - -%preun -%systemd_preun resourcemgr.service - -%postun -%systemd_postun resourcemgr.service -/sbin/ldconfig - %files -%doc README.md CHANGELOG.md %license LICENSE %{_libdir}/libsapi.so.* %{_libdir}/libtcti-device.so.* %{_libdir}/libtcti-socket.so.* -%{_sbindir}/resourcemgr -%attr(644,root,root) %{_unitdir}/resourcemgr.service -%{_mandir}/man8/resourcemgr.8.gz %package devel Summary: Headers and libraries for building apps that use tpm2-tss @@ -99,20 +67,26 @@ use tpm2-tss. %{_libdir}/pkgconfig/sapi.pc %{_libdir}/pkgconfig/tcti-device.pc %{_libdir}/pkgconfig/tcti-socket.pc +%{_mandir}/man3/Init*Tcti.3.gz +%{_mandir}/man7/tcti-*.7.gz -%package utils -Summary: Utilities for tpm2-tss -Requires: %{name}%{_isa} = %{version}-%{release} - -%description utils -Utilities for tpm2-tss, such as testing features of -tpm device or simulator. +%post -p /sbin/ldconfig -%files utils -%{_bindir}/tpmclient -%{_bindir}/tpmtest +%postun -p /sbin/ldconfig %changelog +* Thu Dec 14 2017 Jerry Snitselaar - 1.3.0-2 +- Fix package version in autoconf +resolves: rhbz#1463097 + +* Wed Dec 13 2017 Jerry Snitselaar - 1.3.0-1 +- Rebase to 1.3.0 release +resolves: rhbz#1463097 + +* Thu Aug 31 2017 Jerry Snitselaar - 1.1.0-1 +- Rebase to 1.1.0 +resolves: rhbz#1463097 + * Wed Jun 07 2017 Jerry Snitselaar - 1.0-5 - Add manpage for resourcemgr resolves: rhbz#1459635