Skip to contentSkip to conversation

tpm2.0-tss: Add new package

PATCH In review Armin Kuster 4 participants 31 messages Oct 18, 2016 – Oct 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/17 tpm2.0-tss: Add new package

---
 recipes-tpm/tpm2.0-tss/tpm2.0-tss/ax_pthread.m4 | 332 ++++++++++++++++++++++++
 recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb        |  66 +++++
 2 files changed, 398 insertions(+)
 create mode 100644 recipes-tpm/tpm2.0-tss/tpm2.0-tss/ax_pthread.m4
 create mode 100644 recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb
recipes-tpm/tpm2.0-tss/tpm2.0-tss/ax_pthread.m4 new file +332 -0
new file mode 100644
index 0000000..d383ad5
@@ -0,0 +1,332 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads. It
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+#   flags that are needed. (The user can also force certain compiler
+#   flags/libs to be tested by setting these environment variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
+#   is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these flags,
+#   but also link it with them as well. e.g. you should link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threads programs, you may wish to use these
+#   variables in your default LIBS, CFLAGS, and CC:
+#
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+#   PTHREAD_CFLAGS.
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
+#   will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or if
+#   you have any other suggestions or comments. This macro was based on work
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
+#   grateful for the helpful feedback of numerous users.
+#
+#   Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <[email protected]>
+#   Copyright (c) 2011 Daniel Richard G. <[email protected]>
+#
+#   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 3 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 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, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 21
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
+        AC_MSG_RESULT([$ax_pthread_ok])
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case ${host_os} in
+        solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+        darwin*)
+        ax_pthread_flags="-pthread $ax_pthread_flags"
+        ;;
+esac
+
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+                  [AC_MSG_RESULT([yes])],
+                  [ax_pthread_extra_flags=
+                   AC_MSG_RESULT([no])])
+CFLAGS="$save_CFLAGS"
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+                pthread-config)
+                AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
+                if test x"$ax_pthread_config" = xno; then continue; fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }],
+                       [pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */])],
+                [ax_pthread_ok=yes],
+                [])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT([$ax_pthread_ok])
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        AC_MSG_CHECKING([for joinable pthread attribute])
+        attr_name=unknown
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
+                           [int attr = $attr; return attr /* ; */])],
+                [attr_name=$attr; break],
+                [])
+        done
+        AC_MSG_RESULT([$attr_name])
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case ${host_os} in
+            aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+            osf* | hpux*) flag="-D_REENTRANT";;
+            solaris*)
+            if test "$GCC" = "yes"; then
+                flag="-D_REENTRANT"
+            else
+                # TODO: What about Clang on Solaris?
+                flag="-mt -D_REENTRANT"
+            fi
+            ;;
+        esac
+        AC_MSG_RESULT([$flag])
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+            [ax_cv_PTHREAD_PRIO_INHERIT], [
+                AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+                                                [[int i = PTHREAD_PRIO_INHERIT;]])],
+                    [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+                    [ax_cv_PTHREAD_PRIO_INHERIT=no])
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
+            [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != xyes; then
+            case $host_os in
+                aix*)
+                AS_CASE(["x/$CC"],
+                  [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+                  [#handle absolute path differently from PATH based program lookup
+                   AS_CASE(["x$CC"],
+                     [x/*],
+                     [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+                     [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
+                ;;
+            esac
+        fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+        ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
+        :
+else
+        ax_pthread_ok=no
+        $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/17 tpm-tools: add native support

---
 recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb     |  3 +++
 recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | 23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +3 -0
index 5645976..99ea8ee 100644
@@ -9,6 +9,7 @@ SECTION = "tpm"
 LICENSE = "CPL-1.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9"
 DEPENDS = "libtspi openssl"
+DEPENDS_class-native = "trousers-native"
 
 SRC_URI += " \
     http://downloads.sourceforge.net/project/trousers/${BPN}/${PV}/${BP}.tar.gz \
@@ -20,3 +21,5 @@ SRC_URI[md5sum] = "85a978c4e03fefd4b73cbeadde7c4d0b"
 SRC_URI[sha256sum] = "66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83"
 
 inherit autotools gettext
+
+BBCLASSEXTEND = "native"
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +23 -0
new file mode 100644
index 0000000..be49dd9
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for TPM2."
+DESCRIPTION = "tpm2.0-tools"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=91b7c548d73ea16537799e8060cea819"
+SECTION = "tpm"
+
+DEPENDS = "tpm2.0-tss openssl curl"
+
+SRCREV = "c924cc8ca752e5af6a829f893c6be4b185d56e99"
+
+SRC_URI = "git://github.com/01org/tpm2.0-tools.git;protocol=git;branch=master;name=tpm2.0-tools;destsuffix=tpm2.0-tools"
+
+S = "${WORKDIR}/tpm2.0-tools"
+
+PV = "1.0+git${SRCPV}"
+
+inherit autotools-brokensep pkgconfig
+
+do_configure () {
+	cd ${S}
+	./bootstrap  --force
+	./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
Signature · 1 line
2.7.4
#2 lore raw

Re: [meta-security][PATCH 02/17] tpm-tools: add native support

Quoted 39 lines · Armin Kuster

---
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb | 3 +++
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | 23 +++++++++++++++++++++++

2 files changed, 26 insertions(+)

create mode 100644 recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb

recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +0 -0
index 5645976..99ea8ee 100644
@@ -9,6 +9,7 @@ SECTION = "tpm"

LICENSE = "CPL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9" DEPENDS = "libtspi openssl"
+DEPENDS_class-native = "trousers-native"

SRC_URI += " \
    http://downloads.sourceforge.net/project/trousers/${BPN}/${PV}/${BP}.tar.gz \
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +0 -0
@@ -20,3 +21,5 @@ SRC_URI[md5sum] = "85a978c4e03fefd4b73cbeadde7c4d0b"

SRC_URI[sha256sum] = "66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83"

inherit autotools gettext

recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +2 -0
+
+BBCLASSEXTEND = "native"
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +5 -0
new file mode 100644
index 0000000..be49dd9
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for TPM2."
+DESCRIPTION = "tpm2.0-tools"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=91b7c548d73ea16537799e8060cea819"
+SECTION = "tpm"

recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb line 15

Quoted 10 lines
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +10 -0
+
+DEPENDS = "tpm2.0-tss openssl curl"
+
+SRCREV = "c924cc8ca752e5af6a829f893c6be4b185d56e99"
+
+SRC_URI = "git://github.com/01org/tpm2.0-tools.git;protocol=git;branch=master;name=tpm2.0-tools;destsuffix=tpm2.0-tools"
+
+S = "${WORKDIR}/tpm2.0-tools"
+
+PV = "1.0+git${SRCPV}”

it seems to be 2.0 isn’t it ?

Quoted 16 lines
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +8 -1
+
+inherit autotools-brokensep pkgconfig
+
+do_configure () {
+	cd ${S}
+	./bootstrap  --force
+	./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#3 lore raw

Re: [meta-security][PATCH 02/17] tpm-tools: add native support

Quoted 41 lines · Khem Raj
Quoted 41 lines · Armin Kuster

---
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb | 3 +++
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | 23 +++++++++++++++++++++++

2 files changed, 26 insertions(+)

create mode 100644 recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb

recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +0 -0
index 5645976..99ea8ee 100644
@@ -9,6 +9,7 @@ SECTION = "tpm"

LICENSE = "CPL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9" DEPENDS = "libtspi openssl"
+DEPENDS_class-native = "trousers-native"

SRC_URI += " \
     http://downloads.sourceforge.net/project/trousers/${BPN}/${PV}/${BP}.tar.gz \
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +0 -0
@@ -20,3 +21,5 @@ SRC_URI[md5sum] = "85a978c4e03fefd4b73cbeadde7c4d0b"

SRC_URI[sha256sum] = "66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83"

inherit autotools gettext

recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +2 -0
+
+BBCLASSEXTEND = "native"
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +8 -0
new file mode 100644
index 0000000..be49dd9
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for TPM2."
+DESCRIPTION = "tpm2.0-tools"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=91b7c548d73ea16537799e8060cea819"
+SECTION = "tpm"
+
+DEPENDS = "tpm2.0-tss openssl curl"
+
Quoted 8 lines

recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb

Quoted 7 lines
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +7 -0
+SRCREV = "c924cc8ca752e5af6a829f893c6be4b185d56e99"
+
+SRC_URI = "git://github.com/01org/tpm2.0-tools.git;protocol=git;branch=master;name=tpm2.0-tools;destsuffix=tpm2.0-tools"
+
+S = "${WORKDIR}/tpm2.0-tools"
+
+PV = "1.0+git${SRCPV}”

it seems to be 2.0 isn’t it ?

tpm2.0 refers to the TPM standard version 2, not the sources version. There are no versions on the git sources that I could decode. I will drop it all together and use SRCPV.

thanks,
Armin

Quoted 19 lines
Quoted 17 lines
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +8 -1
+
+inherit autotools-brokensep pkgconfig
+
+do_configure () {
+	cd ${S}
+	./bootstrap  --force
+	./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#4 lore raw

Re: [meta-security][PATCH 02/17] tpm-tools: add native support

Quoted 55 lines · On Oct 17, 2016, at 6:29 PM, akuster808 <[email protected]> wrote:
Quoted 41 lines · Khem Raj
Quoted 41 lines · On Oct 17, 2016, at 5:02 PM, Armin Kuster <[email protected]>…

---
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb | 3 +++
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | 23 +++++++++++++++++++++++

2 files changed, 26 insertions(+)

create mode 100644 recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb

recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +0 -0
index 5645976..99ea8ee 100644
@@ -9,6 +9,7 @@ SECTION = "tpm"

LICENSE = "CPL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9" <file://LICENSE;md5=059e8cd6165cb4c31e351f2b69388fd9> DEPENDS = "libtspi openssl"
+DEPENDS_class-native = "trousers-native"

SRC_URI += " \
    http://downloads.sourceforge.net/project/trousers/$ <http://downloads.sourceforge.net/project/trousers/$>{BPN}/${PV}/${BP}.tar.gz \
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +0 -0
@@ -20,3 +21,5 @@ SRC_URI[md5sum] = "85a978c4e03fefd4b73cbeadde7c4d0b"

SRC_URI[sha256sum] = "66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83"

inherit autotools gettext

recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +2 -0
+
+BBCLASSEXTEND = "native"
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +8 -0
new file mode 100644
index 0000000..be49dd9
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for TPM2."
+DESCRIPTION = "tpm2.0-tools"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=91b7c548d73ea16537799e8060cea819" <file://LICENSE;md5=91b7c548d73ea16537799e8060cea819>
+SECTION = "tpm"
+
+DEPENDS = "tpm2.0-tss openssl curl"
+
Quoted 8 lines

recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb

Quoted 7 lines
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +7 -0
+SRCREV = "c924cc8ca752e5af6a829f893c6be4b185d56e99"
+
+SRC_URI = "git://github.com/01org/tpm2.0-tools.git;protocol=git;branch=master;name=tpm2.0-tools;destsuffix=tpm2.0-tools"
+
+S = "${WORKDIR}/tpm2.0-tools"
+
+PV = "1.0+git${SRCPV}”

it seems to be 2.0 isn’t it ?

Quoted 2 lines

tpm2.0 refers to the TPM standard version 2, not the sources version. There are no versions on the git sources that I could decode. I will drop it all together and use SRCPV.

I see ok thanks

Quoted 22 lines

thanks,
Armin

Quoted 19 lines
Quoted 17 lines
recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb new file +8 -1
+
+inherit autotools-brokensep pkgconfig
+
+do_configure () {
+	cd ${S}
+	./bootstrap  --force
+	./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected] <mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/yocto <https://lists.yoctoproject.org/listinfo/yocto>

#5 lore raw

PATCH 3/17 libtpm: add new package

In reply to Armin Kuster
---
 recipes-tpm/libtpm/libtpm_1.0.bb | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 recipes-tpm/libtpm/libtpm_1.0.bb
recipes-tpm/libtpm/libtpm_1.0.bb new file +13 -0
new file mode 100644
index 0000000..61c1d7c
@@ -0,0 +1,13 @@
+SUMMARY = "LIBPM - Software TPM Library"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f"
+SRCREV = "e5dc628043e981c9f8d7711ddfe5812c8f4e38cc"
+SRC_URI = "git://github.com/stefanberger/libtpms.git"
+
+S = "${WORKDIR}/git"
+inherit autotools-brokensep pkgconfig
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.7.4
#6 lore raw

Re: [meta-security][PATCH 03/17] libtpm: add new package

Quoted 15 lines · Armin Kuster

---
recipes-tpm/libtpm/libtpm_1.0.bb | 13 +++++++++++++

1 file changed, 13 insertions(+)

create mode 100644 recipes-tpm/libtpm/libtpm_1.0.bb

recipes-tpm/libtpm/libtpm_1.0.bb new file +0 -0
new file mode 100644
index 0000000..61c1d7c

recipes-tpm/libtpm/libtpm_1.0.bb line 7

Quoted 7 lines
recipes-tpm/libtpm/libtpm_1.0.bb new file +7 -0
@@ -0,0 +1,13 @@
+SUMMARY = "LIBPM - Software TPM Library"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f"
+SRCREV = "e5dc628043e981c9f8d7711ddfe5812c8f4e38cc"
+SRC_URI = "git://github.com/stefanberger/libtpms.git"
+
+S = "${WORKDIR}/git”

how about PV expressed in form of SRCPV

Quoted 14 lines
recipes-tpm/libtpm/libtpm_1.0.bb new file +6 -1
+inherit autotools-brokensep pkgconfig
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+
+BBCLASSEXTEND = "native"
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#7 lore raw

Re: [meta-security][PATCH 03/17] libtpm: add new package

Quoted 8 lines · Khem Raj
Quoted 8 lines · Armin Kuster

---
recipes-tpm/libtpm/libtpm_1.0.bb | 13 +++++++++++++

1 file changed, 13 insertions(+)

create mode 100644 recipes-tpm/libtpm/libtpm_1.0.bb

Quoted 15 lines

recipes-tpm/libtpm/libtpm_1.0.bb line 7

Quoted 13 lines
recipes-tpm/libtpm/libtpm_1.0.bb new file +7 -0
new file mode 100644
index 0000000..61c1d7c
@@ -0,0 +1,13 @@
+SUMMARY = "LIBPM - Software TPM Library"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f"
+SRCREV = "e5dc628043e981c9f8d7711ddfe5812c8f4e38cc"
+SRC_URI = "git://github.com/stefanberger/libtpms.git"
+
+S = "${WORKDIR}/git”

how about PV expressed in form of SRCPV

can do.

-armin

Quoted 17 lines
Quoted 15 lines
recipes-tpm/libtpm/libtpm_1.0.bb new file +6 -1
+inherit autotools-brokensep pkgconfig
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+
+BBCLASSEXTEND = "native"
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#8 lore raw

PATCH 4/17 swtpm: add new package

In reply to Armin Kuster
---
 recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 +++++++++++++++++++++++
 recipes-tpm/swtpm/swtpm_1.0.bb                    | 38 +++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch
 create mode 100644 recipes-tpm/swtpm/swtpm_1.0.bb
recipes-tpm/swtpm/files/fix_lib_search_path.patch new file +41 -0
new file mode 100644
index 0000000..015f418
@@ -0,0 +1,41 @@
+
+Upstream-Status: Inappropriate [OE config]
+
+Signed-off-by: Armin Kuster <[email protected]>
+
+Index: configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi
+ dnl We have to make sure libtpms is using the same crypto library
+ dnl to avoid problems
+ AC_MSG_CHECKING([the crypto library libtpms is using])
+-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
+-       sed -n '/SEARCH_DIR/p' | \
+-       sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
+-for dir in $dirs; do
+-  if test -r $dir/libtpms.so; then
+-    if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+-      libtpms_cryptolib="openssl"
+-      break
+-    fi
+-    if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+-      libtpms_cryptolib="freebl"
+-      break
+-    fi
++dir="$SEARCH_DIR"
++if test -r $dir/libtpms.so; then
++  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
++    libtpms_cryptolib="openssl"
++    break
+   fi
+-done
++  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
++    libtpms_cryptolib="freebl"
++    break
++  fi
++fi
+ 
+ if test -z "$libtpms_cryptolib"; then
+   AC_MSG_ERROR([Could not determine libtpms crypto library.])
recipes-tpm/swtpm/swtpm_1.0.bb new file +38 -0
new file mode 100644
index 0000000..ae16e51
@@ -0,0 +1,38 @@
+SUMMARY = "SWTPM - Software TPM Emulator"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8"
+SECTION = "tpm"
+
+DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm-native"
+
+SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d"
+SRC_URI = "git://github.com/stefanberger/swtpm.git \
+	   file://fix_lib_search_path.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+PARALLEL_MAKE = ""
+
+TSS_USER="tss"
+TSS_GROUP="tss"
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, linselinux"
+
+CACHED_CONFIGUREVARS = "ac_cv_path_EXPECT=${STAGING_LIBDIR} \ 
+ac_cv_path_SOCAT=${STAGING_LIBDIR} "
+
+EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
+
+export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${TSS_USER}"
+USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir  \
+    --no-create-home  --shell /bin/false ${BPN}"
+
+RDEPENDS_${PN} = "libtpm expect socat bash"
Signature · 1 line
2.7.4
#9 lore raw

Re: [meta-security][PATCH 04/17] swtpm: add new package

Quoted 64 lines · Armin Kuster

---
recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 +++++++++++++++++++++++
recipes-tpm/swtpm/swtpm_1.0.bb | 38 +++++++++++++++++++++

2 files changed, 79 insertions(+)

create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch create mode 100644 recipes-tpm/swtpm/swtpm_1.0.bb

recipes-tpm/swtpm/files/fix_lib_search_path.patch new file +41 -0
new file mode 100644
index 0000000..015f418
@@ -0,0 +1,41 @@
+
+Upstream-Status: Inappropriate [OE config]
+
+Signed-off-by: Armin Kuster <[email protected]>
+
+Index: configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi
+ dnl We have to make sure libtpms is using the same crypto library
+ dnl to avoid problems
+ AC_MSG_CHECKING([the crypto library libtpms is using])
+-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
+-       sed -n '/SEARCH_DIR/p' | \
+-       sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
+-for dir in $dirs; do
+-  if test -r $dir/libtpms.so; then
+-    if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+-      libtpms_cryptolib="openssl"
+-      break
+-    fi
+-    if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+-      libtpms_cryptolib="freebl"
+-      break
+-    fi
++dir="$SEARCH_DIR"
++if test -r $dir/libtpms.so; then
++  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
++    libtpms_cryptolib="openssl"
++    break
+   fi
+-done
++  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
++    libtpms_cryptolib="freebl"
++    break
++  fi
++fi
+
+ if test -z "$libtpms_cryptolib"; then
+   AC_MSG_ERROR([Could not determine libtpms crypto library.])
recipes-tpm/swtpm/swtpm_1.0.bb new file +0 -0
new file mode 100644
index 0000000..ae16e51

recipes-tpm/swtpm/swtpm_1.0.bb line 4

Quoted 4 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +4 -0
@@ -0,0 +1,38 @@
+SUMMARY = "SWTPM - Software TPM Emulator"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8"
+SECTION = “tpm"

this should be ‘apps’ perhaps.

Quoted 13 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +13 -0
+
+DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm-native"
+
+SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d"
+SRC_URI = "git://github.com/stefanberger/swtpm.git \
+	   file://fix_lib_search_path.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+PARALLEL_MAKE = ""
+
+TSS_USER="tss"

recipes-tpm/swtpm/swtpm_1.0.bb

Quoted 10 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +10 -0
+TSS_GROUP="tss"
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, linselinux"
+
+CACHED_CONFIGUREVARS = "ac_cv_path_EXPECT=${STAGING_LIBDIR} \
+ac_cv_path_SOCAT=${STAGING_LIBDIR} “

STAGING_LIBDIR seems dubious here. Can you check if it needs it during build then it should point to native versions.if it needs during runtime then it should be ${libdir}

recipes-tpm/swtpm/swtpm_1.0.bb

Quoted 11 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +11 -0
+
+EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
+
+export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${TSS_USER}"
+USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir  \
+    --no-create-home  --shell /bin/false ${BPN}"
+
+RDEPENDS_${PN} = "libtpm expect socat bash”

This probably should be +=

Quoted 8 lines

--
2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#10 lore raw

Re: [meta-security][PATCH 04/17] swtpm: add new package

Quoted 86 lines · Khem Raj
Quoted 63 lines · Armin Kuster

---
recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 +++++++++++++++++++++++
recipes-tpm/swtpm/swtpm_1.0.bb | 38 +++++++++++++++++++++

2 files changed, 79 insertions(+)

create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch create mode 100644 recipes-tpm/swtpm/swtpm_1.0.bb

recipes-tpm/swtpm/files/fix_lib_search_path.patch new file +41 -0
new file mode 100644
index 0000000..015f418
@@ -0,0 +1,41 @@
+
+Upstream-Status: Inappropriate [OE config]
+
+Signed-off-by: Armin Kuster <[email protected]>
+
+Index: configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi
+ dnl We have to make sure libtpms is using the same crypto library
+ dnl to avoid problems
+ AC_MSG_CHECKING([the crypto library libtpms is using])
+-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
+-       sed -n '/SEARCH_DIR/p' | \
+-       sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
+-for dir in $dirs; do
+-  if test -r $dir/libtpms.so; then
+-    if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+-      libtpms_cryptolib="openssl"
+-      break
+-    fi
+-    if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+-      libtpms_cryptolib="freebl"
+-      break
+-    fi
++dir="$SEARCH_DIR"
++if test -r $dir/libtpms.so; then
++  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
++    libtpms_cryptolib="openssl"
++    break
+   fi
+-done
++  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
++    libtpms_cryptolib="freebl"
++    break
++  fi
++fi
+
+ if test -z "$libtpms_cryptolib"; then
+   AC_MSG_ERROR([Could not determine libtpms crypto library.])
recipes-tpm/swtpm/swtpm_1.0.bb new file +0 -0
new file mode 100644
index 0000000..ae16e51

recipes-tpm/swtpm/swtpm_1.0.bb line 4

Quoted 4 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +4 -0
@@ -0,0 +1,38 @@
+SUMMARY = "SWTPM - Software TPM Emulator"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8"
+SECTION = “tpm"

this should be ‘apps’ perhaps.

Quoted 17 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +17 -0
+
+DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm-native"
+
+SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d"
+SRC_URI = "git://github.com/stefanberger/swtpm.git \
+	   file://fix_lib_search_path.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+PARALLEL_MAKE = ""
+
+TSS_USER="tss"
+TSS_GROUP="tss"
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
Quoted 8 lines

recipes-tpm/swtpm/swtpm_1.0.bb

Quoted 6 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +6 -0
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, linselinux"
+
+CACHED_CONFIGUREVARS = "ac_cv_path_EXPECT=${STAGING_LIBDIR} \
+ac_cv_path_SOCAT=${STAGING_LIBDIR} “

STAGING_LIBDIR seems dubious here. Can you check if it needs it during build then it should point to native versions.if it needs during runtime then it should be ${libdir}

K. Found a cleaner solution.

thanks for the feedback.
-Armin

Quoted 22 lines

recipes-tpm/swtpm/swtpm_1.0.bb

Quoted 12 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +11 -0
+
+EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
+
+export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${TSS_USER}"
+USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir  \
+    --no-create-home  --shell /bin/false ${BPN}"
+
+RDEPENDS_${PN} = "libtpm expect socat bash”

This probably should be +=

Quoted 8 lines

--
2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#11 lore raw

Re: [meta-security][PATCH 04/17] swtpm: add new package

In reply to Armin Kuster
Quoted 75 lines · Armin Kuster
---
 recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 +++++++++++++++++++++++
 recipes-tpm/swtpm/swtpm_1.0.bb                    | 38 +++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch
 create mode 100644 recipes-tpm/swtpm/swtpm_1.0.bb
recipes-tpm/swtpm/files/fix_lib_search_path.patch new file +41 -0
new file mode 100644
index 0000000..015f418
@@ -0,0 +1,41 @@
+
+Upstream-Status: Inappropriate [OE config]
+
+Signed-off-by: Armin Kuster <[email protected]>
+
+Index: configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi
+ dnl We have to make sure libtpms is using the same crypto library
+ dnl to avoid problems
+ AC_MSG_CHECKING([the crypto library libtpms is using])
+-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
+-       sed -n '/SEARCH_DIR/p' | \
+-       sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
+-for dir in $dirs; do
+-  if test -r $dir/libtpms.so; then
+-    if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+-      libtpms_cryptolib="openssl"
+-      break
+-    fi
+-    if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+-      libtpms_cryptolib="freebl"
+-      break
+-    fi
++dir="$SEARCH_DIR"
++if test -r $dir/libtpms.so; then
++  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
++    libtpms_cryptolib="openssl"
++    break
+   fi
+-done
++  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
++    libtpms_cryptolib="freebl"
++    break
++  fi
++fi
+
+ if test -z "$libtpms_cryptolib"; then
+   AC_MSG_ERROR([Could not determine libtpms crypto library.])
recipes-tpm/swtpm/swtpm_1.0.bb new file +14 -0
new file mode 100644
index 0000000..ae16e51
@@ -0,0 +1,38 @@
+SUMMARY = "SWTPM - Software TPM Emulator"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8"
+SECTION = "tpm"
+
+DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm-native"
+
+SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d"
+SRC_URI = "git://github.com/stefanberger/swtpm.git \
+          file://fix_lib_search_path.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig

recipes-tpm/swtpm/swtpm_1.0.bb line 24

Quoted 10 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +10 -0
+PARALLEL_MAKE = ""
+
+TSS_USER="tss"
+TSS_GROUP="tss"
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, linselinux"

linselinux -> libselinux

Quoted 22 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +14 -1
+
+CACHED_CONFIGUREVARS = "ac_cv_path_EXPECT=${STAGING_LIBDIR} \
+ac_cv_path_SOCAT=${STAGING_LIBDIR} "
+
+EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
+
+export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${TSS_USER}"
+USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir  \
+    --no-create-home  --shell /bin/false ${BPN}"
+
+RDEPENDS_${PN} = "libtpm expect socat bash"
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#12 lore raw

Re: [meta-security][PATCH 04/17] swtpm: add new package

Quoted 79 lines · Andre McCurdy
Quoted 78 lines · Armin Kuster
---
  recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 +++++++++++++++++++++++
  recipes-tpm/swtpm/swtpm_1.0.bb                    | 38 +++++++++++++++++++++
  2 files changed, 79 insertions(+)

create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch create mode 100644 recipes-tpm/swtpm/swtpm_1.0.bb

recipes-tpm/swtpm/files/fix_lib_search_path.patch new file +41 -0
new file mode 100644
index 0000000..015f418
@@ -0,0 +1,41 @@
+
+Upstream-Status: Inappropriate [OE config]
+
+Signed-off-by: Armin Kuster <[email protected]>
+
+Index: configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi
+ dnl We have to make sure libtpms is using the same crypto library
+ dnl to avoid problems
+ AC_MSG_CHECKING([the crypto library libtpms is using])
+-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
+-       sed -n '/SEARCH_DIR/p' | \
+-       sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
+-for dir in $dirs; do
+-  if test -r $dir/libtpms.so; then
+-    if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+-      libtpms_cryptolib="openssl"
+-      break
+-    fi
+-    if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+-      libtpms_cryptolib="freebl"
+-      break
+-    fi
++dir="$SEARCH_DIR"
++if test -r $dir/libtpms.so; then
++  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
++    libtpms_cryptolib="openssl"
++    break
+   fi
+-done
++  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
++    libtpms_cryptolib="freebl"
++    break
++  fi
++fi
+
+ if test -z "$libtpms_cryptolib"; then
+   AC_MSG_ERROR([Could not determine libtpms crypto library.])
recipes-tpm/swtpm/swtpm_1.0.bb new file +17 -0
new file mode 100644
index 0000000..ae16e51
@@ -0,0 +1,38 @@
+SUMMARY = "SWTPM - Software TPM Emulator"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8"
+SECTION = "tpm"
+
+DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm-native"
+
+SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d"
+SRC_URI = "git://github.com/stefanberger/swtpm.git \
+          file://fix_lib_search_path.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+PARALLEL_MAKE = ""
+
+TSS_USER="tss"
Quoted 8 lines

recipes-tpm/swtpm/swtpm_1.0.bb line 24

Quoted 7 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +7 -0
+TSS_GROUP="tss"
+
+PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, linselinux"

linselinux -> libselinux

ok.

Thanks for the review.

- Armin

Quoted 23 lines
Quoted 23 lines
recipes-tpm/swtpm/swtpm_1.0.bb new file +14 -1
+
+CACHED_CONFIGUREVARS = "ac_cv_path_EXPECT=${STAGING_LIBDIR} \
+ac_cv_path_SOCAT=${STAGING_LIBDIR} "
+
+EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
+
+export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${TSS_USER}"
+USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir  \
+    --no-create-home  --shell /bin/false ${BPN}"
+
+RDEPENDS_${PN} = "libtpm expect socat bash"
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#13 lore raw

PATCH 5/17 tpm2simulator: add package

In reply to Armin Kuster
---
 .../tpm2simulator/tpm2simulator-native_116.bb      | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +25 -0
new file mode 100644
index 0000000..33eaf99
@@ -0,0 +1,25 @@
+SUMMARY = "TPM 2.0 Simulator Extraction Script"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1415f7be284540b81d9d28c67c1a6b8b"
+
+DEPENDS += "python"
+
+SRCREV = "93dc4412432013ed7bcabd42007754c68f6e362e"
+SRC_URI = "git://github.com/stwagnr/tpm2simulator.git"
+
+S = "${WORKDIR}/git/cmake"
+
+PV = "116+git${SRCPV}"
+
+inherit native lib_package cmake
+
+EXTRA_OECMAKE = " \
+	-DCMAKE_BUILD_TYPE=Debug \
+	-DSPEC_VERSION=116 \
+"
+
+do_configure_prepend () {
+	sed -i 's/^SET = False/SET = True/' ${WORKDIR}/git/scripts/settings.py 
+}
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.7.4
#14 lore raw

Re: [meta-security][PATCH 05/17] tpm2simulator: add package

Quoted 27 lines · Armin Kuster

---
.../tpm2simulator/tpm2simulator-native_116.bb | 25 ++++++++++++++++++++++

1 file changed, 25 insertions(+)

create mode 100644 recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +12 -0
new file mode 100644
index 0000000..33eaf99
@@ -0,0 +1,25 @@
+SUMMARY = "TPM 2.0 Simulator Extraction Script"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1415f7be284540b81d9d28c67c1a6b8b"
+
+DEPENDS += "python"
+
+SRCREV = "93dc4412432013ed7bcabd42007754c68f6e362e"
+SRC_URI = "git://github.com/stwagnr/tpm2simulator.git"
+
+S = "${WORKDIR}/git/cmake"
+
+PV = "116+git${SRCPV}"

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb line 22

Quoted 10 lines
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +10 -0
+
+inherit native lib_package cmake
+
+EXTRA_OECMAKE = " \
+	-DCMAKE_BUILD_TYPE=Debug \
+	-DSPEC_VERSION=116 \
+"
+
+do_configure_prepend () {
+	sed -i 's/^SET = False/SET = True/' ${WORKDIR}/git/scripts/settings.py

use S instead of WORKDIR

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb

Quoted 3 lines
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +3 -0
+}
+
+BBCLASSEXTEND = “native"

it is not needed.

Quoted 8 lines

--
2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#15 lore raw

Re: [meta-security][PATCH 05/17] tpm2simulator: add package

Quoted 29 lines · Khem Raj
Quoted 29 lines · Armin Kuster

---
.../tpm2simulator/tpm2simulator-native_116.bb | 25 ++++++++++++++++++++++

1 file changed, 25 insertions(+)

create mode 100644 recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +15 -0
new file mode 100644
index 0000000..33eaf99
@@ -0,0 +1,25 @@
+SUMMARY = "TPM 2.0 Simulator Extraction Script"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1415f7be284540b81d9d28c67c1a6b8b"
+
+DEPENDS += "python"
+
+SRCREV = "93dc4412432013ed7bcabd42007754c68f6e362e"
+SRC_URI = "git://github.com/stwagnr/tpm2simulator.git"
+
+S = "${WORKDIR}/git/cmake"
+
+PV = "116+git${SRCPV}"
+
+inherit native lib_package cmake
+
Quoted 8 lines

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb line 22

Quoted 7 lines
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +7 -0
+EXTRA_OECMAKE = " \
+	-DCMAKE_BUILD_TYPE=Debug \
+	-DSPEC_VERSION=116 \
+"
+
+do_configure_prepend () {
+	sed -i 's/^SET = False/SET = True/' ${WORKDIR}/git/scripts/settings.py

use S instead of WORKDIR

S = "${WORKDIR}/git/cmake"

that file does not reside there.

the build process does a relative ref outside the "cmake" dir to run the scripts.

unless you mean I should do " ${S}/../scripts/settings.py" ?

Quoted 5 lines

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb

Quoted 4 lines
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +3 -0
+}
+
+BBCLASSEXTEND = “native"

it is not needed.

k

thanks for the review.

- armin

Quoted 11 lines
Quoted 9 lines

--
2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#16 lore raw

Re: [meta-security][PATCH 05/17] tpm2simulator: add package

Quoted 43 lines · On Oct 17, 2016, at 6:21 PM, akuster808 <[email protected]> wrote:
Quoted 29 lines · Khem Raj
Quoted 29 lines · On Oct 17, 2016, at 5:02 PM, Armin Kuster <[email protected]>…

---
.../tpm2simulator/tpm2simulator-native_116.bb | 25 ++++++++++++++++++++++

1 file changed, 25 insertions(+)

create mode 100644 recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +15 -0
new file mode 100644
index 0000000..33eaf99
@@ -0,0 +1,25 @@
+SUMMARY = "TPM 2.0 Simulator Extraction Script"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1415f7be284540b81d9d28c67c1a6b8b" <file://../LICENSE;md5=1415f7be284540b81d9d28c67c1a6b8b>
+
+DEPENDS += "python"
+
+SRCREV = "93dc4412432013ed7bcabd42007754c68f6e362e"
+SRC_URI = "git://github.com/stwagnr/tpm2simulator.git"
+
+S = "${WORKDIR}/git/cmake"
+
+PV = "116+git${SRCPV}"
+
+inherit native lib_package cmake
+
Quoted 8 lines

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb line 22

Quoted 7 lines
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +7 -0
+EXTRA_OECMAKE = " \
+	-DCMAKE_BUILD_TYPE=Debug \
+	-DSPEC_VERSION=116 \
+"
+
+do_configure_prepend () {
+	sed -i 's/^SET = False/SET = True/' ${WORKDIR}/git/scripts/settings.py

use S instead of WORKDIR

Quoted 3 lines

S = "${WORKDIR}/git/cmake"

that file does not reside there.

I think it will break devtool and externalsrc builds.

Quoted 26 lines

the build process does a relative ref outside the "cmake" dir to run the scripts.

unless you mean I should do " ${S}/../scripts/settings.py" ?

Quoted 5 lines

recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb

Quoted 4 lines
recipes-tpm/tpm2simulator/tpm2simulator-native_116.bb new file +3 -0
+}
+
+BBCLASSEXTEND = “native"

it is not needed.

k

thanks for the review.

- armin

Quoted 11 lines
Quoted 9 lines

--
2.7.4

--
_______________________________________________
yocto mailing list
[email protected] <mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/yocto <https://lists.yoctoproject.org/listinfo/yocto>

#17 lore raw

PATCH 6/17 qemu: Add tpm flag

In reply to Armin Kuster
---
 recipes-devtools/qemu/qemu_2.7.0.bbappend | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 recipes-devtools/qemu/qemu_2.7.0.bbappend
recipes-devtools/qemu/qemu_2.7.0.bbappend new file +1 -0
new file mode 100644
index 0000000..d4cecb9
@@ -0,0 +1 @@
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'tpm', '--enable-tpm', '', d)}"
Signature · 1 line
2.7.4
#18 lore raw

PATCH 7/17 image: at image to help test builds

In reply to Armin Kuster
---
 recipes-security/images/security-build-image.bb | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 recipes-security/images/security-build-image.bb
recipes-security/images/security-build-image.bb new file +21 -0
new file mode 100644
index 0000000..6745338
@@ -0,0 +1,21 @@
+DESCRIPTION = "A small image for building meta-security packages"
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_INSTALL = "\
+    packagegroup-base \
+    packagegroup-core-boot \
+    packagegroup-core-security \
+    os-release \
+    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "packagegroup-xfce-base", "", d)} \
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_LINGUAS ?= " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+export IMAGE_BASENAME = "security-build-image"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "5242880"
Signature · 1 line
2.7.4
#19 lore raw

PATCH 8/17 layer.conf: Add filesystem depends

In reply to Armin Kuster
---
 conf/layer.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
conf/layer.conf +1 -1
index 650e6ed..3502f0b 100644
@@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "security"
 BBFILE_PATTERN_security = "^${LAYERDIR}/"
 BBFILE_PRIORITY_security = "6"
 
-LAYERDEPENDS_security = "openembedded-layer perl-layer networking-layer"
+LAYERDEPENDS_security = "openembedded-layer perl-layer networking-layer filesystems-layer"
Signature · 1 line
2.7.4
#20 lore raw

PATCH 9/17 package-group: Add tpm packages

In reply to Armin Kuster
---
 recipes-security/packagegroup/packagegroup-core-security.bb | 13 +++++++++++++
 1 file changed, 13 insertions(+)
recipes-security/packagegroup/packagegroup-core-security.bb +13 -0
index 2dae3aa..8639acd 100644
@@ -11,6 +11,7 @@ PACKAGES = "\
     packagegroup-security-scanners \
     packagegroup-security-ids  \
     packagegroup-security-mac  \
+    ${@bb.utils.contains("DISTRO_FEATURES", "tpm", "packagegroup-security-tpm", "",d)} \
     "
 
 RDEPENDS_packagegroup-core-security = "\
@@ -18,6 +19,7 @@ RDEPENDS_packagegroup-core-security = "\
     packagegroup-security-scanners \
     packagegroup-security-ids  \
     packagegroup-security-mac  \
+    ${@bb.utils.contains("DISTRO_FEATURES", "tpm", "packagegroup-security-tpm", "",d)} \
     "
 
 SUMMARY_packagegroup-security-utils = "Security utilities"
@@ -55,3 +57,14 @@ SUMMARY_packagegroup-security-mac = "Security Mandatory Access Control systems"
 RDEPENDS_packagegroup-security-mac = " \
     ${@bb.utils.contains("DISTRO_FEATURES", "tomoyo", "ccs-tools", "",d)} \
     "
+
+SUMMARY_packagegroup-security-tpm = "Security TPM support"
+RDEPENDS_packagegroup-security-tpm = " \
+    tpm-tools \
+    trousers \
+    tpm2.0-tools \
+    tpm2.0-tss \
+    libtpm \
+    swtpm \
+    tpm2simulator-native \
+    "
Signature · 1 line
2.7.4
#21 lore raw

PATCH 10/17 tpm-tools: Fix gcc6 compile issue

In reply to Armin Kuster

.8/src/tpm_mgmt/tpm_present.c

| ../../../tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c: In function 'main':
| ../../../tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c:358:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
|      if (szTpmPasswd && !isWellKnown)
|      ^~
| ../../../tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c:360:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
|   return iRc;
|   ^~~~~~
---
 .../gcc6_missleading_indent_fix.patch              | 24 ++++++++++++++++++++++
 recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb           |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 recipes-tpm/tpm-tools/tpm-tools-1.3.8/gcc6_missleading_indent_fix.patch
recipes-tpm/tpm-tools/tpm-tools-1.3.8/gcc6_missleading_indent_fix.patch new file +24 -0
new file mode 100644
index 0000000..aec5e7a
@@ -0,0 +1,24 @@
+Index: tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c
+===================================================================
+--- tpm-tools-1.3.8.orig/src/tpm_mgmt/tpm_present.c
++++ tpm-tools-1.3.8/src/tpm_mgmt/tpm_present.c
+@@ -349,13 +349,13 @@ int main(int argc, char **argv)
+ 		}
+ 	} while (flags[++i].name);
+ 
+-      out_success:
++out_success:
+ 	logSuccess(argv[0]);
+ 	iRc = 0;
+-      out_close:
++out_close:
+ 	contextClose(hContext);
+-      out:
+-    if (szTpmPasswd && !isWellKnown)
+-	shredPasswd( szTpmPasswd );
+-	return iRc;
++out:
++	if (szTpmPasswd && !isWellKnown)
++		shredPasswd( szTpmPasswd );
++return iRc;
+ }
recipes-tpm/tpm-tools/tpm-tools_1.3.8.bb +1 -0
index 99ea8ee..790894a 100644
@@ -15,6 +15,7 @@ SRC_URI += " \
     http://downloads.sourceforge.net/project/trousers/${BPN}/${PV}/${BP}.tar.gz \
     file://tpm-tools-extendpcr.patch \
     file://03-fix-bool-error-parseStringWithValues.patch \
+    file://gcc6_missleading_indent_fix.patch \
 "
 
 SRC_URI[md5sum] = "85a978c4e03fefd4b73cbeadde7c4d0b"
Signature · 1 line
2.7.4
#22 lore raw

PATCH 11/17 linux-yocto-4.8: add tpm fragments

In reply to Armin Kuster
---
 recipes-kernel/linux/linux-yocto-4.8/tpm.cfg  | 9 +++++++++
 recipes-kernel/linux/linux-yocto-4.8/tpm.scc  | 4 ++++
 recipes-kernel/linux/linux-yocto_4.8.bbappend | 7 +++++++
 3 files changed, 20 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto-4.8/tpm.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto-4.8/tpm.scc
 create mode 100644 recipes-kernel/linux/linux-yocto_4.8.bbappend
recipes-kernel/linux/linux-yocto-4.8/tpm.cfg new file +9 -0
new file mode 100644
index 0000000..fe1bb3f
@@ -0,0 +1,9 @@
+CONFIG_HW_RANDOM_TPM=y
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS_CORE=y
+CONFIG_TCG_TIS=y
+CONFIG_TCG_CRB=y
+CONFIG_TCG_VTPM_PROXY=y
+CONFIG_DEVPORT=y
+CONFIG_FUSE_FS=y
+CONFIG_CUSE=y
recipes-kernel/linux/linux-yocto-4.8/tpm.scc new file +4 -0
new file mode 100644
index 0000000..7c7ec2d
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "TPM Kernel Support"
+define KFEATURE_COMPATIBILITY arch
+
+kconf non-hardware tpm.cfg
recipes-kernel/linux/linux-yocto_4.8.bbappend new file +7 -0
new file mode 100644
index 0000000..0e6960e
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.8:"
+
+# TPM kernel support
+SRC_URI += "\
+        ${@bb.utils.contains('DISTRO_FEATURES', 'tpm', ' file://tpm.cfg', '', d)} \
+        ${@bb.utils.contains('DISTRO_FEATURES', 'tpm', ' file://tpm.scc', '', d)} \
+"
Signature · 1 line
2.7.4
#23 lore raw

PATCH 12/17 images: add a client and server image

In reply to Armin Kuster
---
 recipes-security/images/security-client-image.bb | 17 +++++++++++++++++
 recipes-security/images/security-server-image.bb | 20 ++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 recipes-security/images/security-client-image.bb
 create mode 100644 recipes-security/images/security-server-image.bb
recipes-security/images/security-client-image.bb new file +17 -0
new file mode 100644
index 0000000..1a92479
@@ -0,0 +1,17 @@
+DESCRIPTION = "A Client side Security example"
+
+IMAGE_INSTALL = "\
+    packagegroup-base \
+    packagegroup-core-boot \
+    os-release \
+    samhain-client \
+    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "packagegroup-xfce-base", "", d)} \
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_LINGUAS ?= " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+export IMAGE_BASENAME = "security-client-image"
recipes-security/images/security-server-image.bb new file +20 -0
new file mode 100644
index 0000000..502b5c1
@@ -0,0 +1,20 @@
+DESCRIPTION = "A Serve side image for Security example "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_INSTALL = "\
+    packagegroup-base \
+    packagegroup-core-boot \
+    samhain-server \
+    os-release \
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_LINGUAS ?= " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+export IMAGE_BASENAME = "security-server-image"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "5242880"
Signature · 1 line
2.7.4
#24 lore raw

PATCH 13/17 package-group: fix tpm package list

In reply to Armin Kuster
---
 recipes-security/packagegroup/packagegroup-core-security.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
recipes-security/packagegroup/packagegroup-core-security.bb +5 -2
index 8639acd..ae856c7 100644
@@ -63,8 +63,11 @@ RDEPENDS_packagegroup-security-tpm = " \
     tpm-tools \
     trousers \
     tpm2.0-tools \
-    tpm2.0-tss \
+    libtss2 \
+    resourcemgr \
+    libtctidevice \
+    libtctisocket \
+    resourcemgr \
     libtpm \
     swtpm \
-    tpm2simulator-native \
     "
Signature · 1 line
2.7.4
#25 lore raw

Re: [meta-security][PATCH 13/17] package-group: fix tpm package list

Hello,

Would it not be more interesting to do two packages, one for the TPMV1.2 support and a second for the TPMV2.0 support?

Best regards,
Thomas P.

Quoted 33 lines · Armin Kuster
---
 recipes-security/packagegroup/packagegroup-core-security.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
recipes-security/packagegroup/packagegroup-core-security.bb +5 -3
index 8639acd..ae856c7 100644
@@ -63,8 +63,11 @@ RDEPENDS_packagegroup-security-tpm = " \
     tpm-tools \
     trousers \
     tpm2.0-tools \
-    tpm2.0-tss \
+    libtss2 \
+    resourcemgr \
+    libtctidevice \
+    libtctisocket \
+    resourcemgr \
     libtpm \
     swtpm \
-    tpm2simulator-native \
     "
--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#26 lore raw

Re: [meta-security][PATCH 13/17] package-group: fix tpm package list

Quoted 3 lines · Thomas PERROT

Hello,

Would it not be more interestingto do two packages, one for the TPMV1.2 support and a second for the TPMV2.0 support?

yes. thanks for the input.

Regards,
Armin

Quoted 54 lines

Best regards,
Thomas P.

On Tue, Oct 18, 2016 at 2:02 AM, Armin Kuster <[email protected] <mailto:[email protected]>> wrote:

    Signed-off-by: Armin Kuster <[email protected]
    <mailto:[email protected]>>
    ---
     recipes-security/packagegroup/packagegroup-core-security.bb
    <http://packagegroup-core-security.bb> | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)

    diff --git
    a/recipes-security/packagegroup/packagegroup-core-security.bb
    <http://packagegroup-core-security.bb>
    b/recipes-security/packagegroup/packagegroup-core-security.bb
    <http://packagegroup-core-security.bb>
    index 8639acd..ae856c7 100644
    --- a/recipes-security/packagegroup/packagegroup-core-security.bb
    <http://packagegroup-core-security.bb>
    +++ b/recipes-security/packagegroup/packagegroup-core-security.bb
    <http://packagegroup-core-security.bb>
    @@ -63,8 +63,11 @@ RDEPENDS_packagegroup-security-tpm = " \
         tpm-tools \
         trousers \
         tpm2.0-tools \
    -    tpm2.0-tss \
    +    libtss2 \
    +    resourcemgr \
    +    libtctidevice \
    +    libtctisocket \
    +    resourcemgr \
         libtpm \
         swtpm \
    -    tpm2simulator-native \
         "
    --
    2.7.4

    --
    _______________________________________________
    yocto mailing list
    [email protected] <mailto:[email protected]>
    https://lists.yoctoproject.org/listinfo/yocto
    <https://lists.yoctoproject.org/listinfo/yocto>
#27 lore raw

PATCH 14/17 suricata: update package to 3.1.2

In reply to Armin Kuster
---
 recipes-security/suricata/suricata.inc                            | 8 ++++----
 .../suricata/{suricata_3.0.2.bb => suricata_3.1.2.bb}             | 0
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename recipes-security/suricata/{suricata_3.0.2.bb => suricata_3.1.2.bb} (100%)
recipes-security/suricata/suricata.inc +4 -4
index 9ddb405..6e14c6d 100644
@@ -2,8 +2,8 @@ HOMEPAGE = "http://suricata-ids.org/"
 SECTION = "security Monitor/Admin"
 LICENSE = "GPLv2"
 
-VER = "3.0.2"
-SRC_URI = "http://www.openinfosecfoundation.org/download/suricata-${VER}.tar.gz"
+VER = "3.1.2"
 
-SRC_URI[md5sum] = "ff231c3d7af32cb1c767fded2a13c391"
-SRC_URI[sha256sum] = "264cbdc380717590a9c33d3b3dc92fc488f376873e869bf71601b1d4a9a8e601"
+SRC_URI = "http://www.openinfosecfoundation.org/download/suricata-${VER}.tar.gz"
+SRC_URI[md5sum] = "c58e8ef56918c83ecf292d73f4b0c051"
+SRC_URI[sha256sum] = "f9e7742580849f202254e75d9fc245ba53f4d7490f47a6d30f02a7b10aacc512"
recipes-security/suricata/suricata_3.1.2.bb renamed from recipes-security/suricata/suricata_3.0.2.bb +0 -0
similarity index 100%
rename from recipes-security/suricata/suricata_3.0.2.bb
rename to recipes-security/suricata/suricata_3.1.2.bb
Signature · 1 line
2.7.4
#28 lore raw

PATCH 15/17 samhain: recipe cleanup

In reply to Armin Kuster

add a few distro feature checks.

---
 recipes-security/samhain/samhain-client_4.1.5.bb |  7 ----
 recipes-security/samhain/samhain-server_4.1.5.bb | 16 ++++----
 recipes-security/samhain/samhain.inc             | 52 ++++++++++++++----------
 3 files changed, 38 insertions(+), 37 deletions(-)
recipes-security/samhain/samhain-client_4.1.5.bb +0 -7
index bb47449..4b04326 100644
@@ -12,11 +12,4 @@ EXTRA_OECONF += " \
         --with-pid-file=/var/samhain/samhain.pid \
         "
 
-
-INSANE_SKIP_${PN} = "already-stripped"
-
-FILES_${PN} += "\
-    /run \
-    "
-
 RDEPENDS_${PN} = "acl zlib attr bash"
recipes-security/samhain/samhain-server_4.1.5.bb +8 -8
index 0d76b9a..35f8775 100644
@@ -3,13 +3,17 @@ INITSCRIPT_PARAMS = "defaults 14 86"
 
 require samhain.inc
 
-DEPENDS = "gmp"
+DEPENDS = "gmp samhain-server-native"
 
 EXTRA_OECONF += "--enable-network=${SAMHAIN_MODE} "
 
 # supports mysql|postgresql|oracle|odbc but postgresql is the only one available
 
-PACKAGECONFG ??= "postgresql"
+PACKAGECONFIG ??= "postgresql"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+
 PACKAGECONFIG[postgres]  = "--with-database=postgresql --enable-xml-log, "", postgresql"
 PACKAGECONFIG[suidcheck]  = "--enable-suidcheck","" , "
 PACKAGECONFIG[logwatch]  = "--enable-login-watch,"" , "
@@ -38,17 +42,13 @@ do_install_append() {
         init/samhain.startLSB ${D}/var/lib/samhain
 }
 
-INSANE_SKIP_${PN} = "already-stripped"
-
 PACKAGES = "${PN} ${PN}-doc ${PN}-dbg"
 
-FILES_${PN} += " \
-    ${sbindir}/* \
-    /run \
-    "
+FILES_${PN} += "${sbindir}/*"
 
 FILES_${PN}-dbg += " \
     ${sbindir}/.debug/* \
     "
 
 RDEPENDS_${PN} += "gmp bash perl"
+BBCLASSEXTEND = "native"
recipes-security/samhain/samhain.inc +30 -22

72 lines not on this page · raw message

Signature · 1 line
2.7.4
#29 lore raw

PATCH 16/17 libnetaddr-ip-perl: remove package. not used by anyone in this layer

In reply to Armin Kuster

latest version does not build either

---
 recipes-perl/perl/libnetaddr-ip-perl_4.069.bb | 26 --------------------------
 1 file changed, 26 deletions(-)
 delete mode 100644 recipes-perl/perl/libnetaddr-ip-perl_4.069.bb
recipes-perl/perl/libnetaddr-ip-perl_4.069.bb deleted +0 -26
deleted file mode 100644
index 69c2d83..0000000
@@ -1,26 +0,0 @@
-DESCRIPTION = "This package contains the IP.pm module with friends."
-
-SECTION = "libs"
-LICENSE = "Artistic-1.0 | GPL-1.0+"
-
-LIC_FILES_CHKSUM = "file://Copying;md5=cde580764a0fbc0f02fafde4c65d6227"
-
-DEPENDS += "perl"
-
-SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MI/MIKER/NetAddr-IP-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "7721135fcea390327f75421a6b701144"
-SRC_URI[sha256sum] = "96739afc484eca1597c4f4b520864b342169c8fdeef486778511e5a1527ba4e7"
-
-S = "${WORKDIR}/NetAddr-IP-${PV}"
-
-EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
-
-inherit cpan
-
-do_compile() {
-	cpan_do_compile
-}
-BBCLASSEXTEND = "native"
-
-PNBLACKLIST[libnetaddr-ip-perl] = "BROKEN: doesn't build | make[2]: *** No rule to make target `config.h', needed by `Util.c'.  Stop."
Signature · 1 line
2.7.4
#30 lore raw

PATCH 17/17 python-pycrypto: simplify to use pypi class

In reply to Armin Kuster
---
 recipes-devtools/python/python-pycrypto_2.6.1.bb | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)
recipes-devtools/python/python-pycrypto_2.6.1.bb +6 -16
index 8036158..51f9272 100644
@@ -1,29 +1,18 @@
 DESCRIPTION = "Cryptographic modules for Python."
 HOMEPAGE = "http://www.pycrypto.org/"
-SECTION = "devel/python"
 LICENSE = "PSFv2"
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=35f354d199e8cb7667b059a23578e63d"
 
-SRCNAME = "pycrypto"
+DEPENDS += " gmp"
 
-SRC_URI = "https://pypi.python.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
-           file://cross-compiling.patch"
+SRC_URI = "file://cross-compiling.patch"
 
 SRC_URI[md5sum] = "55a61a054aa66812daf5161a0d5d7eda"
 SRC_URI[sha256sum] = "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
 
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
-
-export STAGING_INCDIR
-export STAGING_LIBDIR
-export BUILD_SYS
-export HOST_SYS
+PYPI_PACKAGE = "pycrypto"
 
-inherit autotools autotools-brokensep distutils
-
-DEPENDS += " gmp"
+inherit pypi autotools-brokensep distutils
 
 do_compile[noexec] = "1"
 
@@ -31,5 +20,6 @@ do_compile[noexec] = "1"
 # *don't* want the autotools install to run, since this package doesn't
 # provide a "make install" target.
 do_install() {
-	distutils_do_install
+       distutils_do_install
 }
+
Signature · 1 line
2.7.4