#6 Update to 2.0.0 release
Merged 5 years ago by yunyings. Opened 5 years ago by javierm.
rpms/ javierm/tpm2-abrmd master  into  master

file modified
+1
@@ -0,0 +1,1 @@ 

+ /tpm2-abrmd-2.0.0.tar.gz

@@ -1,50 +0,0 @@ 

- From 418d49669a33f9e6b029787e3869b3a534bb7de8 Mon Sep 17 00:00:00 2001

- From: Philip Tricca <philip.b.tricca@intel.com>

- Date: Mon, 14 Aug 2017 13:57:51 -0700

- Subject: [PATCH] tcti-tabrmd: Fix NULL deref bug by moving debug output after

-  NULL check.

- 

- This one speaks for itself: The debug output dereferences the pointer to

- the context structure before checking for NULL. Switching these two

- things around fixes the issue.

- 

- Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>

- ---

-  src/tcti-tabrmd.c | 8 ++++----

-  1 file changed, 4 insertions(+), 4 deletions(-)

- 

- diff --git a/src/tcti-tabrmd.c b/src/tcti-tabrmd.c

- index 970702c..134cf8d 100644

- --- a/src/tcti-tabrmd.c

- +++ b/src/tcti-tabrmd.c

- @@ -293,11 +293,11 @@ tss2_tcti_tabrmd_cancel (TSS2_TCTI_CONTEXT *context)

-      GError *error = NULL;

-      gboolean cancel_ret;

-  

- -    g_info("tss2_tcti_tabrmd_cancel: id 0x%" PRIx64,

- -           TSS2_TCTI_TABRMD_ID (context));

-      if (context == NULL) {

-          return TSS2_TCTI_RC_BAD_CONTEXT;

-      }

- +    g_info("tss2_tcti_tabrmd_cancel: id 0x%" PRIx64,

- +           TSS2_TCTI_TABRMD_ID (context));

-      if (TSS2_TCTI_TABRMD_STATE (context) != TABRMD_STATE_RECEIVE) {

-          return TSS2_TCTI_RC_BAD_SEQUENCE;

-      }

- @@ -346,11 +346,11 @@ tss2_tcti_tabrmd_set_locality (TSS2_TCTI_CONTEXT *context,

-      TSS2_RC ret = TSS2_RC_SUCCESS;

-      GError *error = NULL;

-  

- -    g_info ("tss2_tcti_tabrmd_set_locality: id 0x%" PRIx64,

- -            TSS2_TCTI_TABRMD_ID (context));

-      if (context == NULL) {

-          return TSS2_TCTI_RC_BAD_CONTEXT;

-      }

- +    g_info ("tss2_tcti_tabrmd_set_locality: id 0x%" PRIx64,

- +            TSS2_TCTI_TABRMD_ID (context));

-      if (TSS2_TCTI_TABRMD_STATE (context) != TABRMD_STATE_TRANSMIT) {

-          return TSS2_TCTI_RC_BAD_SEQUENCE;

-      }

- -- 

- 2.13.6

- 

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (tpm2-abrmd-1.1.0.tar.gz) = e44ddace9688b3b1b3bd6ea8c8b717eaccb870d6c2f6fa10e1741ed18dc88d57876bd95b09bd0128ea7f876e229f9f7c0a6c3e306f8b3d4b0b55c0c37c2652ff

+ SHA512 (tpm2-abrmd-2.0.0.tar.gz) = 28a1dadbea354c9186b987e98536e7fc5fbccc80c2a096d0335c8394b7b9989f4c5c338be4d10e5e9dcb7c98f9d03bcb38ddc3b529210ca6569406cef36bb509

@@ -0,0 +1,106 @@ 

+ From 9c4a30c22725948537911dafa664d3741fd0249b Mon Sep 17 00:00:00 2001

+ From: Javier Martinez Canillas <javierm@redhat.com>

+ Date: Wed, 4 Jul 2018 16:04:15 +0200

+ Subject: [PATCH 1/1] tcti-dynamic: Make the tss2 device TCTI library SONAME

+  the default

+ 

+ The raw libtss2-tcti-device.so is only included in the development package

+ but the tpm2-abrmd tries to dynamically load this instead of the library's

+ SONAME which is included in the tpm2-tss package.

+ 

+ This was reported in [0] and partially fixed by the commit d2f0b2d1f0f

+ ("tcti-util: Use proper SONAME for TCTI dlopen"). But I still needed these

+ changes so the tpm2-abrmd daemon could lookup the correct library name.

+ 

+ [0]: https://lists.01.org/pipermail/tpm2/2018-May/000700.html

+ 

+ Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

+ ---

+  man/tpm2-abrmd.8.in | 12 ++++++------

+  src/tabrmd.h        |  2 +-

+  src/tcti-dynamic.c  |  2 +-

+  src/tcti-dynamic.h  |  2 +-

+  4 files changed, 9 insertions(+), 9 deletions(-)

+ 

+ diff --git a/man/tpm2-abrmd.8.in b/man/tpm2-abrmd.8.in

+ index c745a7e5eac..e02cbf44a16 100644

+ --- a/man/tpm2-abrmd.8.in

+ +++ b/man/tpm2-abrmd.8.in

+ @@ -25,7 +25,7 @@ is formatted as "tcti-name:tcti-conf" where:

+  .IP 'tcti-name'

+  The name of the TCTI library shared object file. Libraries are found using

+  the same algorithm as dlopen (3). If the TCTI library file name follows the

+ -naming convention: \fBlibtss2-tcti-<name>.so\fR where <name> is the name for

+ +naming convention: \fBlibtss2-tcti-<name>.so.0\fR where <name> is the name for

+  the TCTI, the value of \fB<name>\fR may be supplied in place of the full

+  library file name. See 'EXAMPLES' below.

+  .IP 'tcti-conf'

+ @@ -89,21 +89,21 @@ Execute daemon with default TCTI and provided config string:

+  This is equivalent to:

+  .B tpm2-abrmd --tcti="device:/dev/tpm0"

+  .br

+ -.B tpm2-abrmd --tcti="libtss2-tcti-device.so:/dev/tpm0"

+ +.B tpm2-abrmd --tcti="libtss2-tcti-device.so.0:/dev/tpm0"

+  .TP

+  Have daemon use Microsoft/IBM TPM2 Simulator tcti library

+ -'libtss2-tcti-mssim.so'.

+ +'libtss2-tcti-mssim.so.0'.

+  This connects to a TPM2 simulator via a TCP mssim.

+  .br

+  .B tpm2-abrmd --tcti="mssim"

+  .br

+ -.B tpm2-abrmd --tcti="libtss2-tcti-mssim.so"

+ +.B tpm2-abrmd --tcti="libtss2-tcti-mssim.so.0"

+  .TP

+ -Have daemon use tcti library 'libtss2-tcti-mssim.so' and config string

+ +Have daemon use tcti library 'libtss2-tcti-mssim.so.0' and config string

+  'tcp://127.0.0.1:5555':

+  .B tpm2-abrmd --tcti=mssim:tcp://127.0.0.1:5555"

+  .br

+ -.B tpm2-abrmd --tcti="libtss2-tcti-mssim.so:tcp://127.0.0.1:5555"

+ +.B tpm2-abrmd --tcti="libtss2-tcti-mssim.so.0:tcp://127.0.0.1:5555"

+  .SH AUTHOR

+  Philip Tricca <philip.b.tricca@intel.com>

+  .SH "SEE ALSO"

+ diff --git a/src/tabrmd.h b/src/tabrmd.h

+ index 7e0eb02b4ef..ed9d7dd063b 100644

+ --- a/src/tabrmd.h

+ +++ b/src/tabrmd.h

+ @@ -43,7 +43,7 @@

+  #define TABRMD_ENTROPY_SRC_DEFAULT "/dev/urandom"

+  #define TABRMD_SESSIONS_MAX_DEFAULT 4

+  #define TABRMD_SESSIONS_MAX 64

+ -#define TABRMD_TCTI_FILENAME_DEFAULT "libtss2-tcti-device.so"

+ +#define TABRMD_TCTI_FILENAME_DEFAULT "libtss2-tcti-device.so.0"

+  #define TABRMD_TCTI_CONF_DEFAULT NULL

+  #define TABRMD_TRANSIENT_MAX_DEFAULT 27

+  #define TABRMD_TRANSIENT_MAX 100

+ diff --git a/src/tcti-dynamic.c b/src/tcti-dynamic.c

+ index f3e0b6db694..852eb70b2ea 100644

+ --- a/src/tcti-dynamic.c

+ +++ b/src/tcti-dynamic.c

+ @@ -139,7 +139,7 @@ tcti_dynamic_class_init (TctiDynamicClass *klass)

+          g_param_spec_string ("file-name",

+                               "TCTI library file",

+                               "Library file containing TCTI implementation.",

+ -                             "libtss2-tcti-device.so",

+ +                             "libtss2-tcti-device.so.0",

+                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);

+      obj_properties[PROP_CONF_STR] =

+          g_param_spec_string ("conf-str",

+ diff --git a/src/tcti-dynamic.h b/src/tcti-dynamic.h

+ index 08691a66d58..2ed0eaea640 100644

+ --- a/src/tcti-dynamic.h

+ +++ b/src/tcti-dynamic.h

+ @@ -34,7 +34,7 @@

+  

+  G_BEGIN_DECLS

+  

+ -#define TCTI_DYNAMIC_DEFAULT_FILE_NAME "libtss2-tcti-device.so"

+ +#define TCTI_DYNAMIC_DEFAULT_FILE_NAME "libtss2-tcti-device.so.0"

+  #define TCTI_DYNAMIC_DEFAULT_CONF_STR  "/dev/tpm0"

+  

+  typedef struct _TctiDynamicClass {

+ -- 

+ 2.17.1

+ 

file modified
+29 -23
@@ -1,13 +1,13 @@ 

  Name: tpm2-abrmd

- Version: 1.1.0

- Release: 12%{?dist}

+ Version: 2.0.0

+ Release: 1%{?dist}

  Summary: A system daemon implementing TPM2 Access Broker and Resource Manager

  

  License: BSD

- URL:     https://github.com/01org/tpm2-abrmd

- Source0: https://github.com/01org/tpm2-abrmd/archive/%{version}/%{name}-%{version}.tar.gz

- # upstream commit 418d49669a33f9e6b029787e3869b3a534bb7de8

- Patch0: 0001-tcti-tabrmd-Fix-NULL-deref-bug-by-moving-debug-outpu.patch

+ URL:     https://github.com/tpm2-software/tpm2-abrmd

+ Source0: https://github.com/tpm2-software/tpm2-abrmd/releases/download/%{version}/%{name}-%{version}.tar.gz

+ 

+ Patch0: tcti-dynamic-Make-the-tss2-device-TCTI-library-SONAM.patch

  

  %{?systemd_requires}

  BuildRequires: systemd
@@ -16,11 +16,13 @@ 

  BuildRequires: pkgconfig(cmocka)

  BuildRequires: pkgconfig(dbus-1)

  BuildRequires: pkgconfig(gio-unix-2.0)

- BuildRequires: pkgconfig(sapi)

- BuildRequires: pkgconfig(tcti-device)

- BuildRequires: pkgconfig(tcti-socket)

- # tpm2-abrmd depends on tpm2-tss-devel for sapi/tcti-device/tcti-socket libs

- BuildRequires: tpm2-tss-devel >= 1.1.0-1%{?dist}

+ BuildRequires: pkgconfig(tss2-mu)

+ BuildRequires: pkgconfig(tss2-sys)

+ # tpm2-abrmd depends on tpm2-tss-devel for tss2-mu/sys libs

+ BuildRequires: tpm2-tss-devel >= 2.0.0-2%{?dist}

+ 

+ # tpm2-abrmd depends on the package that contains its SELinux policy module

+ Requires: %{name}-selinux >= %{version}-1%{?dist}

  

  %description

  tpm2-abrmd is a system daemon implementing the TPM2 access broker (TAB) and
@@ -28,17 +30,15 @@ 

  

  %prep

  %autosetup -p1 -n %{name}-%{version}

- autoreconf -vif

  

  %build

  %configure --disable-static --disable-silent-rules \

             --with-systemdsystemunitdir=%{_unitdir} \

-            --with-udevrulesdir=%{_udevrulesdir}

+            --with-systemdpresetdir=%{_presetdir}

  %make_build

  

  %install

  %make_install

- rm -f %{buildroot}/%{_udevrulesdir}/tpm-udev.rules

  find %{buildroot}%{_libdir} -type f -name \*.la -delete

  

  %pre
@@ -51,30 +51,31 @@ 

  %files

  %doc README.md CHANGELOG.md

  %license LICENSE

- %{_libdir}/libtcti-tabrmd.so.*

+ %{_libdir}/libtss2-tcti-tabrmd.so.*

  %{_sbindir}/tpm2-abrmd

  %config(noreplace) %{_sysconfdir}/dbus-1/system.d/tpm2-abrmd.conf

+ %{_datarootdir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service

  %{_unitdir}/tpm2-abrmd.service

- %{_mandir}/man3/tss2_tcti_tabrmd_init.3.gz

- %{_mandir}/man3/tss2_tcti_tabrmd_init_full.3.gz

- %{_mandir}/man7/tcti-tabrmd.7.gz

+ %{_presetdir}/tpm2-abrmd.preset

+ %{_mandir}/man3/Tss2_Tcti_Tabrmd_Init.3.gz

+ %{_mandir}/man7/tss2-tcti-tabrmd.7.gz

  %{_mandir}/man8/tpm2-abrmd.8.gz

  

  

  %package devel

  Summary: Headers, static libraries and package config files of tpm2-abrmd

  Requires: %{name}%{_isa} = %{version}-%{release}

- # tpm2-abrmd-devel depends on tpm2-tss-devel for sapi/tcti-device/tcti-socket libs

- Requires: tpm2-tss-devel%{?_isa} >= 1.1.0-1%{?dist}

+ # tpm2-abrmd-devel depends on tpm2-tss-devel for tss2-mu/sys libs

+ Requires: tpm2-tss-devel%{?_isa} >= 2.0.0-1%{?dist}

  

  %description devel

  This package contains headers, static libraries and package config files

  required to build applications that use tpm2-abrmd.

  

  %files devel

- %{_includedir}/tcti/tcti-tabrmd.h

- %{_libdir}/libtcti-tabrmd.so

- %{_libdir}/pkgconfig/tcti-tabrmd.pc

+ %{_includedir}/tss2/tss2-tcti-tabrmd.h

+ %{_libdir}/libtss2-tcti-tabrmd.so

+ %{_libdir}/pkgconfig/tss2-tcti-tabrmd.pc

  

  # on package installation

  %post
@@ -89,6 +90,11 @@ 

  %systemd_postun tpm2-abrmd.service

  

  %changelog

+ * Wed Jul 04 2018 Javier Martinez Canillas <javierm@redhat.com> - 2.0.0-1

+ - Download the distributed tarball instead of the source code tarball

+ - Update URLs to point to the new project location

+ - Update to 2.0.0 release

+ 

  * Fri Feb 23 2018 Javier Martinez Canillas <javierm@redhat.com> - 1.1.0-12

  - Don't install udev rule for TPM character devices

  

Signed-off-by: Javier Martinez Canillas javierm@redhat.com

Looks good to me. One minor thing about tpm2-tss version dependency:
BuildRequires: tpm2-tss-devel >= 2.0.0-1%{?dist}

tpm2-tss package version has been bumped to 2.0.0-2, due to re-enabling ESAPI. Suppose here should be updated to 2.0.0-2 too?

@yunyings the tpm2-abrmd doesn't use any symbols for ESAPI, only SAPI. But on the other hand it doesn't hurt to bump the dependency so I'll do it.

@yunyings I just updated the BuildRequires.

rebased onto b55c3c1

5 years ago

Pull-Request has been merged by yunyings

5 years ago