From 150b7eb4fc496728385d5e102f48e0de99a38a11 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Thu, 15 Oct 2020 13:04:53 -0700 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/tss2#f6612215aa8e32a28f5e07d07d0ad7fc40343030 --- .gitignore | 4 ++ flags-fixup.patch | 33 +++++++++ hash_generate.patch | 18 +++++ picfix.patch | 12 ++++ sources | 1 + tss2.spec | 170 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 238 insertions(+) create mode 100644 flags-fixup.patch create mode 100644 hash_generate.patch create mode 100644 picfix.patch create mode 100644 sources create mode 100644 tss2.spec diff --git a/.gitignore b/.gitignore index e69de29..10d1640 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,4 @@ +/ibmtss713withman.tar +/ibmtss1027.tar.gz +/makeman.sh +/ibmtss1331.tar.gz diff --git a/flags-fixup.patch b/flags-fixup.patch new file mode 100644 index 0000000..a92a541 --- /dev/null +++ b/flags-fixup.patch @@ -0,0 +1,33 @@ +diff -ur tss2-1234/utils/makefile-common tss2-1234-new/utils/makefile-common +--- tss2-1234/utils/makefile-common 2018-05-29 12:00:46.000000000 -0700 ++++ tss2-1234-new/utils/makefile-common 2018-10-02 15:10:20.783078580 -0700 +@@ -44,7 +44,7 @@ + CCFLAGS += \ + -Wall -W -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wformat=2 -Wold-style-definition -Wno-self-assign \ +- -ggdb -O0 -c ++ -ggdb -c + + # to compile with optimizations on (warning will result) + # -O3 -c +diff -ur tss2-1234/utils/makefile.fedora tss2-1234-new/utils/makefile.fedora +--- tss2-1234/utils/makefile.fedora 2018-05-15 10:07:20.000000000 -0700 ++++ tss2-1234-new/utils/makefile.fedora 2018-10-02 15:11:33.909083615 -0700 +@@ -71,7 +71,7 @@ + + # compile - common flags for TSS library and applications + +-CCFLAGS += -DTPM_POSIX ++CCFLAGS += -DTPM_POSIX -DTPM_INTERFACE_TYPE_DEFAULT="\"dev\"" -DTPM_DEVICE_DEFAULT="\"/dev/tpmrm0\"" + + # example of pointing to a locally built openssl 1.1 + # CCFLAGS += -I/home/kgold/openssl-1.1.0c/include +@@ -119,7 +119,7 @@ + LNLFLAGS += -shared -Wl,-z,now + + # This is an alternative to using the bfd linker on Ubuntu +-# LNLLIBS += -lcrypto ++LNLLIBS += -lcrypto + + # link - for applications, TSS path, TSS and OpenSSl libraries + diff --git a/hash_generate.patch b/hash_generate.patch new file mode 100644 index 0000000..f6a5387 --- /dev/null +++ b/hash_generate.patch @@ -0,0 +1,18 @@ +diff -ur tss2-1234/utils/policymaker.c tss2-1234-new/utils/policymaker.c +--- tss2-1234/utils/policymaker.c 2018-10-18 12:16:59.742439220 -0700 ++++ tss2-1234-new/utils/policymaker.c 2018-10-18 12:34:34.991755536 -0700 +@@ -208,10 +208,10 @@ + } + /* hash extend */ + if ((rc == 0) && (prc != NULL)) { +- TSS_Hash_Generate(&digest, +- startSizeInBytes, (uint8_t *)&digest.digest, /* extend */ +- lineLength /2, lineBinary, +- 0, NULL); ++ rc = TSS_Hash_Generate(&digest, ++ startSizeInBytes, (uint8_t *)&digest.digest, /* extend */ ++ lineLength /2, lineBinary, ++ 0, NULL); + } + if ((rc == 0) && (prc != NULL)) { + if (verbose) TSS_PrintAll("intermediate policy digest", diff --git a/picfix.patch b/picfix.patch new file mode 100644 index 0000000..82f13be --- /dev/null +++ b/picfix.patch @@ -0,0 +1,12 @@ +diff -Nrup a/utils/makefile.fedora b/utils/makefile.fedora +--- a/utils/makefile.fedora 2019-12-19 16:26:06.695476012 -0700 ++++ b/utils/makefile.fedora 2019-12-19 16:25:58.153501665 -0700 +@@ -181,6 +181,8 @@ tsscryptoh.o: $(TSS_HEADERS) tsscryptoh + $(CC) $(CCFLAGS) $(CCLFLAGS) tsscryptoh.c + tsscrypto.o: $(TSS_HEADERS) tsscrypto.c + $(CC) $(CCFLAGS) $(CCLFLAGS) tsscrypto.c ++tssprintcmd.o: $(TSS_HEADERS) tssprintcmd.c ++ $(CC) $(CCFLAGS) $(CCLFLAGS) tssprintcmd.c + tssutils.o: $(TSS_HEADERS) tssutils.c + $(CC) $(CCFLAGS) $(CCLFLAGS) tssutils.c + tssfile.o: $(TSS_HEADERS) tssfile.c diff --git a/sources b/sources new file mode 100644 index 0000000..a672917 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ibmtss1331.tar.gz) = b1d41e0779f2ada6a61e38b8686b64272df5bf0c73b6fd8baac2d4ea9ae23e56910d95e6412683b44fc8bb7da7bc4a349709b02bf9b137498100b4d7288aca11 diff --git a/tss2.spec b/tss2.spec new file mode 100644 index 0000000..f818460 --- /dev/null +++ b/tss2.spec @@ -0,0 +1,170 @@ +# +# Spec file for IBM's TSS for the TPM 2.0 +# +%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro} + +%global incname ibmtss + +Name: tss2 +Version: 1331 +Release: 6%{?dist} +Summary: IBM's TCG Software Stack (TSS) for TPM 2.0 and related utilities + +License: BSD +URL: http://sourceforge.net/projects/ibmtpm20tss/ +Source0: https://sourceforge.net/projects/ibmtpm20tss/files/ibmtss%{version}.tar.gz +Patch1: flags-fixup.patch +Patch2: hash_generate.patch +Patch3: picfix.patch + +BuildRequires: gcc +BuildRequires: help2man +BuildRequires: openssl-devel +Requires: openssl + +%description +TSS2 is a user space Trusted Computing Group's Software Stack (TSS) for +TPM 2.0. It implements the functionality equivalent to the TCG TSS +working group's ESAPI, SAPI, and TCTI layers (and perhaps more) but with +a hopefully far simpler interface. + +It comes with about 80 "TPM tools" that can be used for rapid prototyping, +education and debugging. + +%package devel +Summary: Development libraries and headers for IBM's TSS 2.0 +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development libraries and headers for IBM's TSS 2.0. You will need this in +order to build TSS 2.0 applications. + +%prep +%autosetup -p1 -c %{name}-%{version} + +%build +# nonstandard variable names are used in place of CFLAGS and LDFLAGS +pushd utils +CCFLAGS="%{optflags}" \ +LNFLAGS="%{__global_ldflags}" \ +%{make_build} -f makefile.fedora +popd + +%install +# Prefix for namespacing +BIN_PREFIX=tss +mkdir -p %{buildroot}/%{_bindir} +mkdir -p %{buildroot}/%{_libdir} +mkdir -p %{buildroot}/%{_includedir}/%{incname}/ +mkdir -p %{buildroot}/%{_mandir}/man1 +pushd utils +# Pick out executables and copy with namespacing +for f in *; do + if [[ -x $f && -f $f && ! $f =~ .*\..* ]]; then + cp -p $f %{buildroot}/%{_bindir}/${BIN_PREFIX}$f + fi; +done +cp -p *.so.1.1 %{buildroot}/%{_libdir} +cp -p %{incname}/*.h %{buildroot}/%{_includedir}/%{incname}/ +cp -p man/man1/tss*.1 %{buildroot}/%{_mandir}/man1/ +popd + + +# Make symbolic links to the shared lib +pushd %{buildroot}/%{_libdir} +rm -f libibmtss.so.1 +ln -sf libibmtss.so.1.1 libibmtss.so.1 +rm -f libibmtss.so +ln -sf libibmtss.so.1 libibmtss.so +popd + +%ldconfig_scriptlets + +%files +%license LICENSE +%{_bindir}/tss* +%{_libdir}/libibmtss.so.1 +%{_libdir}/libibmtss.so.1.* +%attr(0644, root, root) %{_mandir}/man1/tss*.1* + +%files devel +%{_includedir}/%{incname} +%{_libdir}/libibmtss.so +%doc ibmtss.doc + +%changelog +* Wed Jul 29 2020 Fedora Release Engineering - 1331-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Feb 14 2020 Tom Stellard - 1331-5 +- Use make_build macro +- https://docs.fedoraproject.org/en-US/packaging-guidelines/#_parallel_make + +* Fri Jan 31 2020 Fedora Release Engineering - 1331-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jan 17 2020 Jeff Law - 1331-3 +- Ensure tssprintcmd has the compilation compilation flags, + PIC in particular + +* Sat Jul 27 2019 Fedora Release Engineering - 1331-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu May 30 2019 Jerry Snitselaar - 1331-1 +- Rebase to version 1331 + +* Tue May 28 2019 Jerry Snitselaar - 1234-4 +- Fix covscan issues +- Fix compile and linker flag issues + +* Sun Feb 03 2019 Fedora Release Engineering - 1234-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1234-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 18 2018 Jerry Snitselaar - 1234-1 +- Version bump. + +* Fri Feb 09 2018 Fedora Release Engineering - 1027-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Jan 19 2018 Merlin Mathesius - 1027-1 +- Version bump. Now supported for all architectures. +- Generate man pages since they are no longer included in source archive. + +* Thu Aug 03 2017 Fedora Release Engineering - 713-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 713-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 713-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Oct 05 2016 Hon Ching(Vicky) Lo - 713-7 +- Removed defattr from the devel subpackage + +* Mon Sep 26 2016 Hon Ching(Vicky) Lo - 713-6 +- Added s390x arch as another "ExcludeArch" + +* Mon Sep 26 2016 Hon Ching(Vicky) Lo - 713-5 +- Replaced ExclusiveArch with ExcludeArch + +* Mon Sep 19 2016 Hon Ching(Vicky) Lo - 713-4 +- Used ExclusiveArch instead of BuildArch tag +- Removed attr from symlink in devel subpackage +- Added manpages and modified the Source0 +- Added CCFLAGS and LNFLAGS to enforce hardening and optimization + +* Wed Aug 17 2016 Hon Ching(Vicky) Lo - 713-3 +- Modified supported arch to ppc64le + +* Sat Aug 13 2016 Hon Ching(Vicky) Lo - 713-2 +- Minor spec fixes + +* Tue Aug 09 2016 Hon Ching(Vicky) Lo - 713-1 +- Updated for initial submission + +* Fri Mar 20 2015 George Wilson +- Initial implementation