[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/files/, app-crypt/tpm-emulator/

2023-07-18 Thread Mike Pagano
commit: f803931e1ee3b76d3234f3704f9b660eeb0339b5
Author: Mike Pagano  gentoo  org>
AuthorDate: Tue Jul 18 16:50:10 2023 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Tue Jul 18 16:51:25 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f803931e

app-crypt/tpm-emulator: Remove last rited packaged

Closes: https://bugs.gentoo.org/768960
Closes: https://bugs.gentoo.org/794547

Signed-off-by: Mike Pagano  gentoo.org>

 app-crypt/tpm-emulator/Manifest|  1 -
 .../files/tpm-emulator-0.7.5-build.patch   | 33 -
 .../files/tpm-emulator-0.7.5-fno-common.patch  | 48 -
 .../files/tpm-emulator-0.7.5-static-libs.patch | 26 ---
 app-crypt/tpm-emulator/files/tpm-emulator.confd|  1 -
 app-crypt/tpm-emulator/files/tpm-emulator.initd| 46 
 app-crypt/tpm-emulator/metadata.xml| 12 
 .../tpm-emulator/tpm-emulator-0.7.5-r3.ebuild  | 83 --
 8 files changed, 250 deletions(-)

diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest
deleted file mode 100644
index 695694052456..
--- a/app-crypt/tpm-emulator/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST tpm-emulator-0.7.5.tar.gz 222341 BLAKE2B 
c6dc7494800f4c6d1f5e622c6a47fdd5487e0f2cbc34173d9039d6eb5fd7541dd2c1f514efbf220c605424059844e18650b31ee9934eda6626427b915fd6bc53
 SHA512 
24c16ec36ca92c484d6e8dfa53c8ca00dbc5b58d78d7166041db1e9ae277d763f0fc0a6b0cbd7e62fcf4671f6ad2d8df1213256be0a4200b79b6ee61ab73b2ef

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch
deleted file mode 100644
index 3f96bdd3e68f..
--- a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 78f018a79243b8aa3c2a8e8aa87245c58c731278 Mon Sep 17 00:00:00 2001
-From: Alon Bar-Lev 
-Date: Sun, 16 Sep 2018 13:29:59 +0300
-Subject: [PATCH] tpmd_dev: fix strncpy bound
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-tpmd_dev/linux/tpmd_dev.c:88:3: error: ‘strncpy’ specified bound 108 equals 
destination size [-Werror=stringop-truncation]
-
-Bug: https://github.com/PeterHuewe/tpm-emulator/pull/43
-
-Signed-off-by: Alon Bar-Lev 

- tpmd_dev/linux/tpmd_dev.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tpmd_dev/linux/tpmd_dev.c b/tpmd_dev/linux/tpmd_dev.c
-index 2b24bd7..72583f4 100644
 a/tpmd_dev/linux/tpmd_dev.c
-+++ b/tpmd_dev/linux/tpmd_dev.c
-@@ -85,7 +85,7 @@ static int tpmd_connect(char *socket_name)
- return res;
-   }
-   addr.sun_family = AF_UNIX;
--  strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path));
-+  strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path)-1);
-   res = tpmd_sock->ops->connect(tpmd_sock,
- (struct sockaddr*), sizeof(struct sockaddr_un), 0);
-   if (res != 0) {
--- 
-2.16.4
-

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch
deleted file mode 100644
index 88bfb33433c1..
--- a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-https://bugs.gentoo.org/707256
 a/tpm/tpm_emulator_extern.h
-+++ b/tpm/tpm_emulator_extern.h
-@@ -29,7 +29,7 @@ enum {
-   TPM_LOG_ERROR
- };
- 
--void (*tpm_log)(int priority, const char *fmt, ...);
-+extern void (*tpm_log)(int priority, const char *fmt, ...);
- 
- #if defined(_WIN32) || defined(_WIN64)
- #define __BFILE__ ((strrchr(__FILE__, '\\') ? : __FILE__ - 1) + 1)
-@@ -44,27 +44,27 @@ void (*tpm_log)(int priority, const char *fmt, ...);
- #define error(fmt, ...) tpm_log(TPM_LOG_ERROR, "%s:%d: Error: " fmt "\n", \
- __BFILE__, __LINE__, ## __VA_ARGS__)
- /* initialization */
--int (*tpm_extern_init)(void);
--void (*tpm_extern_release)(void);
-+extern int (*tpm_extern_init)(void);
-+extern void (*tpm_extern_release)(void);
- 
- /* memory allocation */
- 
--void* (*tpm_malloc)(size_t size);
-+extern void* (*tpm_malloc)(size_t size);
- 
--void (*tpm_free)(/*const*/ void *ptr);
-+extern void (*tpm_free)(/*const*/ void *ptr);
- 
- /* random numbers */
- 
--void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
-+extern void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
- 
- /* usec since last call */
- 
--uint64_t (*tpm_get_ticks)(void);
-+extern uint64_t (*tpm_get_ticks)(void);
- 
- /* file handling */
- 
--int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
--int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
-+extern int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
-+extern int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
- 
- #endif /* _TPM_EMULATOR_EXTERN_H_ */
- 

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch 

[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2022-12-23 Thread Sam James
commit: bcb9b9efae6bf6af2d948a24701b7b190fc24c33
Author: Sam James  gentoo  org>
AuthorDate: Sat Dec 24 02:55:31 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Dec 24 02:59:22 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcb9b9ef

app-crypt/tpm-emulator: add github upstream metadata

Signed-off-by: Sam James  gentoo.org>

 app-crypt/tpm-emulator/metadata.xml | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/app-crypt/tpm-emulator/metadata.xml 
b/app-crypt/tpm-emulator/metadata.xml
index 51fbbfdd110b..fdd2723e0b5e 100644
--- a/app-crypt/tpm-emulator/metadata.xml
+++ b/app-crypt/tpm-emulator/metadata.xml
@@ -2,10 +2,11 @@
 https://www.gentoo.org/dtd/metadata.dtd;>
 

-   
-   tpm-emulator
-   

Build the MTM emulator

+   
+   tpm-emulator
+   PeterHuewe/tpm-emulator
+   
 



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/files/, app-crypt/tpm-emulator/

2021-01-20 Thread David Seifert
commit: f216135855afdeff7e1f106470b846e253936573
Author: Jakov Smolic  sartura  hr>
AuthorDate: Wed Jan 20 10:12:45 2021 +
Commit: David Seifert  gentoo  org>
CommitDate: Wed Jan 20 10:12:45 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2161358

app-crypt/tpm-emulator: Port to EAPI 7 and GLEP 81

* Fix build with gcc-10
* Disable static-libs

Closes: https://github.com/gentoo/gentoo/pull/19113
Closes: https://bugs.gentoo.org/726492
Closes: https://bugs.gentoo.org/707256
Signed-off-by: Jakov Smolic  sartura.hr>
Signed-off-by: David Seifert  gentoo.org>

 .../files/tpm-emulator-0.7.5-fno-common.patch  | 48 ++
 .../files/tpm-emulator-0.7.5-static-libs.patch | 26 
 7.5-r2.ebuild => tpm-emulator-0.7.5-r3.ebuild} | 32 +--
 3 files changed, 93 insertions(+), 13 deletions(-)

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch
new file mode 100644
index 000..88bfb33433c
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch
@@ -0,0 +1,48 @@
+https://bugs.gentoo.org/707256
+--- a/tpm/tpm_emulator_extern.h
 b/tpm/tpm_emulator_extern.h
+@@ -29,7 +29,7 @@ enum {
+   TPM_LOG_ERROR
+ };
+ 
+-void (*tpm_log)(int priority, const char *fmt, ...);
++extern void (*tpm_log)(int priority, const char *fmt, ...);
+ 
+ #if defined(_WIN32) || defined(_WIN64)
+ #define __BFILE__ ((strrchr(__FILE__, '\\') ? : __FILE__ - 1) + 1)
+@@ -44,27 +44,27 @@ void (*tpm_log)(int priority, const char *fmt, ...);
+ #define error(fmt, ...) tpm_log(TPM_LOG_ERROR, "%s:%d: Error: " fmt "\n", \
+ __BFILE__, __LINE__, ## __VA_ARGS__)
+ /* initialization */
+-int (*tpm_extern_init)(void);
+-void (*tpm_extern_release)(void);
++extern int (*tpm_extern_init)(void);
++extern void (*tpm_extern_release)(void);
+ 
+ /* memory allocation */
+ 
+-void* (*tpm_malloc)(size_t size);
++extern void* (*tpm_malloc)(size_t size);
+ 
+-void (*tpm_free)(/*const*/ void *ptr);
++extern void (*tpm_free)(/*const*/ void *ptr);
+ 
+ /* random numbers */
+ 
+-void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
++extern void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
+ 
+ /* usec since last call */
+ 
+-uint64_t (*tpm_get_ticks)(void);
++extern uint64_t (*tpm_get_ticks)(void);
+ 
+ /* file handling */
+ 
+-int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
+-int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
++extern int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
++extern int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
+ 
+ #endif /* _TPM_EMULATOR_EXTERN_H_ */
+ 

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch
new file mode 100644
index 000..845229bd767
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/726492
+--- a/tddl/CMakeLists.txt
 b/tddl/CMakeLists.txt
+@@ -5,21 +5,18 @@
+ 
+ set(tddl-tpm-emulator_SRCS "tddl.c" "tddl-tpm-emulator.h")
+ add_library(tddl-tpm-emulator SHARED ${tddl-tpm-emulator_SRCS})
+-add_library(tddl-tpm-emulator_static STATIC ${tddl-tpm-emulator_SRCS})
+ if(UNIX)
+   set_target_properties(tddl-tpm-emulator PROPERTIES SOVERSION "1.2"
+ VERSION 
"1.2.${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}")
+-  set_target_properties(tddl-tpm-emulator_static PROPERTIES OUTPUT_NAME 
tddl-tpm-emulator)
+ elseif(WIN32)
+   set_target_properties(tddl-tpm-emulator PROPERTIES OUTPUT_NAME ifxtpm)
+   set_target_properties(tddl-tpm-emulator PROPERTIES PREFIX "")
+ endif()
+ 
+ install(TARGETS tddl-tpm-emulator DESTINATION ${CMAKE_INSTALL_LIBDIR})
+-install(TARGETS tddl-tpm-emulator_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES "tddl-tpm-emulator.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ add_executable(test_tddl test_tddl.c)
+-target_link_libraries(test_tddl tddl-tpm-emulator_static)
++target_link_libraries(test_tddl tddl-tpm-emulator)
+ 

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r2.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r3.ebuild
similarity index 78%
rename from app-crypt/tpm-emulator/tpm-emulator-0.7.5-r2.ebuild
rename to app-crypt/tpm-emulator/tpm-emulator-0.7.5-r3.ebuild
index 9323c1f7edc..38a0d018270 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r2.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r3.ebuild
@@ -1,30 +1,34 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
+
 MODULES_OPTIONAL_USE="modules"
-inherit user linux-mod cmake-utils udev
+inherit cmake linux-mod udev
 
 

[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2019-03-20 Thread Alon Bar-Lev
commit: 2523251b4d2988fd461a3e4dd44bc8d5242adf68
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Wed Mar 20 21:13:19 2019 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Wed Mar 20 22:00:23 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2523251b

app-crypt/tpm-emulator: cleanup old

Signed-off-by: Alon Bar-Lev  gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

 app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild | 82 
 1 file changed, 82 deletions(-)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
deleted file mode 100644
index 97b70a4785f..000
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-MODULES_OPTIONAL_USE="modules"
-inherit user linux-mod cmake-utils udev
-
-MY_P=${P/-/_}
-DESCRIPTION="Emulator driver for tpm"
-HOMEPAGE="https://github.com/PeterHuewe/tpm-emulator;
-SRC_URI="https://github.com/PeterHuewe/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
-LICENSE="GPL-2"
-
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-
-IUSE="libressl mtm-emulator ssl"
-RDEPEND="ssl? (
-   !libressl? ( dev-libs/openssl:0= )
-   libressl? ( dev-libs/libressl:0= )
-   )"
-DEPEND="${RDEPEND}
-   !ssl? ( dev-libs/gmp )"
-
-PATCHES=(
-   "${FILESDIR}/${P}-build.patch"
-)
-
-pkg_setup() {
-   enewgroup tss
-   enewuser tss -1 -1 /var/lib/tpm tss
-   if use modules; then
-   CONFIG_CHECK="MODULES"
-   MODULE_NAMES="tpmd_dev(extra:tpmd_dev/linux:)"
-   BUILD_TARGETS="all tpmd_dev.rules"
-   BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
-   linux-mod_pkg_setup
-   fi
-}
-
-src_configure() {
-   local mycmakeargs=(
-   -DUSE_OPENSSL=$(usex ssl ON OFF)
-   -DMTM_EMULATOR=$(usex mtm-emulator ON OFF)
-   -DBUILD_DEV=OFF
-   )
-   cmake-utils_src_configure
-
-   use modules && ln -s "${BUILD_DIR}/config.h" tpmd_dev/linux
-}
-
-src_compile() {
-   cmake-utils_src_compile
-   use modules && linux-mod_src_compile
-}
-
-src_install() {
-   cmake-utils_src_install
-   if use modules; then
-   linux-mod_src_install
-   udev_newrules "tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules
-   fi
-
-   newinitd "${FILESDIR}/${PN}.initd" "${PN}"
-   newconfd "${FILESDIR}/${PN}.confd" "${PN}"
-
-   keepdir /var/log/tpm
-   fowners tss:tss /var/log/tpm
-}
-
-pkg_postinst() {
-   if use modules; then
-   linux-mod_pkg_postinst
-
-   ewarn ""
-   ewarn "The new init.d script does not load the tpmd_dev any 
more as it is optional."
-   ewarn "If you use the tpmd_dev, please load it explicitly in 
/etc/conf.d/modules"
-   ewarn ""
-   fi
-
-   einfo "tpmd socket is located at /var/run/tpm/tpmd_socket:0"
-}



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2019-01-26 Thread Alon Bar-Lev
commit: 16d1495e82d4bb5402116c693a67cade5acb0c40
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sat Jan 26 21:05:26 2019 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Jan 26 21:09:09 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16d1495e

app-crypt/tpm-emulator: drop openssl support

Incompatible with openssl-1.1, too much effort to modify.
The gmp support is sufficient.

Closes: https://bugs.gentoo.org/show_bug.cgi?id=674180
Signed-off-by: Alon Bar-Lev  gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../tpm-emulator/tpm-emulator-0.7.5-r1.ebuild  | 77 ++
 1 file changed, 77 insertions(+)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r1.ebuild
new file mode 100644
index 000..c4ca2397fd2
--- /dev/null
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MODULES_OPTIONAL_USE="modules"
+inherit user linux-mod cmake-utils udev
+
+MY_P=${P/-/_}
+DESCRIPTION="Emulator driver for tpm"
+HOMEPAGE="https://github.com/PeterHuewe/tpm-emulator;
+SRC_URI="https://github.com/PeterHuewe/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="mtm-emulator"
+RDEPEND="dev-libs/gmp:="
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+   "${FILESDIR}/${P}-build.patch"
+)
+
+pkg_setup() {
+   enewgroup tss
+   enewuser tss -1 -1 /var/lib/tpm tss
+   if use modules; then
+   CONFIG_CHECK="MODULES"
+   MODULE_NAMES="tpmd_dev(extra:tpmd_dev/linux:)"
+   BUILD_TARGETS="all tpmd_dev.rules"
+   BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
+   linux-mod_pkg_setup
+   fi
+}
+
+src_configure() {
+   local mycmakeargs=(
+   -DMTM_EMULATOR=$(usex mtm-emulator ON OFF)
+   -DBUILD_DEV=OFF
+   )
+   cmake-utils_src_configure
+
+   use modules && ln -s "${BUILD_DIR}/config.h" tpmd_dev/linux
+}
+
+src_compile() {
+   cmake-utils_src_compile
+   use modules && linux-mod_src_compile
+}
+
+src_install() {
+   cmake-utils_src_install
+   if use modules; then
+   linux-mod_src_install
+   udev_newrules "tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules
+   fi
+
+   newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+   newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+
+   keepdir /var/log/tpm
+   fowners tss:tss /var/log/tpm
+}
+
+pkg_postinst() {
+   if use modules; then
+   linux-mod_pkg_postinst
+
+   ewarn ""
+   ewarn "The new init.d script does not load the tpmd_dev any 
more as it is optional."
+   ewarn "If you use the tpmd_dev, please load it explicitly in 
/etc/conf.d/modules"
+   ewarn ""
+   fi
+
+   einfo "tpmd socket is located at /var/run/tpm/tpmd_socket:0"
+}



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/, app-crypt/tpm-emulator/files/

2018-09-16 Thread Alon Bar-Lev
commit: 96278bd867bd974b6200863215ec5aec3d31503a
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sun Sep 16 10:35:46 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sun Sep 16 10:38:13 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96278bd8

app-crypt/tpm-emulator: fix strncpy build

Closes: https://bugs.gentoo.org/show_bug.cgi?id=666326
Thanks: Toralf Förster

 .../files/tpm-emulator-0.7.5-build.patch   | 33 ++
 app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild   |  4 +++
 2 files changed, 37 insertions(+)

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch
new file mode 100644
index 000..3f96bdd3e68
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch
@@ -0,0 +1,33 @@
+From 78f018a79243b8aa3c2a8e8aa87245c58c731278 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev 
+Date: Sun, 16 Sep 2018 13:29:59 +0300
+Subject: [PATCH] tpmd_dev: fix strncpy bound
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+tpmd_dev/linux/tpmd_dev.c:88:3: error: ‘strncpy’ specified bound 108 equals 
destination size [-Werror=stringop-truncation]
+
+Bug: https://github.com/PeterHuewe/tpm-emulator/pull/43
+
+Signed-off-by: Alon Bar-Lev 
+---
+ tpmd_dev/linux/tpmd_dev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tpmd_dev/linux/tpmd_dev.c b/tpmd_dev/linux/tpmd_dev.c
+index 2b24bd7..72583f4 100644
+--- a/tpmd_dev/linux/tpmd_dev.c
 b/tpmd_dev/linux/tpmd_dev.c
+@@ -85,7 +85,7 @@ static int tpmd_connect(char *socket_name)
+ return res;
+   }
+   addr.sun_family = AF_UNIX;
+-  strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path));
++  strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path)-1);
+   res = tpmd_sock->ops->connect(tpmd_sock,
+ (struct sockaddr*), sizeof(struct sockaddr_un), 0);
+   if (res != 0) {
+-- 
+2.16.4
+

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
index 70301caebee..97b70a4785f 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
@@ -22,6 +22,10 @@ RDEPEND="ssl? (
 DEPEND="${RDEPEND}
!ssl? ( dev-libs/gmp )"
 
+PATCHES=(
+   "${FILESDIR}/${P}-build.patch"
+)
+
 pkg_setup() {
enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/, app-crypt/tpm-emulator/files/

2018-09-15 Thread Alon Bar-Lev
commit: 098588af315d901e7d6ff530fb17efad6acc1904
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sat Sep 15 22:20:28 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Sep 15 22:21:01 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=098588af

app-crypt/tpm-emulator: drop -r2 from conf.d/init.d

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 .../tpm-emulator/files/{tpm-emulator.confd-r2 => tpm-emulator.confd}  | 0
 .../tpm-emulator/files/{tpm-emulator.initd-r2 => tpm-emulator.initd}  | 0
 app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild  | 4 ++--
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.confd-r2 
b/app-crypt/tpm-emulator/files/tpm-emulator.confd
similarity index 100%
rename from app-crypt/tpm-emulator/files/tpm-emulator.confd-r2
rename to app-crypt/tpm-emulator/files/tpm-emulator.confd

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.initd-r2 
b/app-crypt/tpm-emulator/files/tpm-emulator.initd
similarity index 100%
rename from app-crypt/tpm-emulator/files/tpm-emulator.initd-r2
rename to app-crypt/tpm-emulator/files/tpm-emulator.initd

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
index 38f20de07c7..70301caebee 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild
@@ -57,8 +57,8 @@ src_install() {
udev_newrules "tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules
fi
 
-   newinitd "${FILESDIR}/${PN}.initd-r2" "${PN}"
-   newconfd "${FILESDIR}/${PN}.confd-r2" "${PN}"
+   newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+   newconfd "${FILESDIR}/${PN}.confd" "${PN}"
 
keepdir /var/log/tpm
fowners tss:tss /var/log/tpm



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/, app-crypt/tpm-emulator/files/

2018-09-15 Thread Alon Bar-Lev
commit: ed3f7accadd7fbd5c529ea68793fad723eccc31f
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sat Sep 15 22:16:20 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Sep 15 22:21:01 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed3f7acc

app-crypt/tpm-emulator: version bump

Closes: https://bugs.gentoo.org/show_bug.cgi?id=537544
Closes: https://bugs.gentoo.org/show_bug.cgi?id=540384
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 app-crypt/tpm-emulator/Manifest|   1 +
 .../files/tpm-emulator-0.7.4-cmake.patch   | 120 -
 ...r-0.7.4-r2.ebuild => tpm-emulator-0.7.5.ebuild} |  13 +--
 3 files changed, 4 insertions(+), 130 deletions(-)

diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest
index 555e9753a5a..ee01c035b31 100644
--- a/app-crypt/tpm-emulator/Manifest
+++ b/app-crypt/tpm-emulator/Manifest
@@ -1 +1,2 @@
+DIST tpm-emulator-0.7.5.tar.gz 222341 BLAKE2B 
c6dc7494800f4c6d1f5e622c6a47fdd5487e0f2cbc34173d9039d6eb5fd7541dd2c1f514efbf220c605424059844e18650b31ee9934eda6626427b915fd6bc53
 SHA512 
24c16ec36ca92c484d6e8dfa53c8ca00dbc5b58d78d7166041db1e9ae277d763f0fc0a6b0cbd7e62fcf4671f6ad2d8df1213256be0a4200b79b6ee61ab73b2ef
 DIST tpm_emulator-0.7.4.tar.gz 214145 BLAKE2B 
b8bbd53ecfb90e87f1306c03d2c65a472819d23d10bd63fa966bfadef4776c3876c2f6fc03cc878ece670bdfcd22c9f403ef4bc7f4593a0a6c7f8d17051ac3ba
 SHA512 
4928b5b82f57645be9408362706ff2c4d9baa635b21b0d41b1c82930e8c60a759b1ea4fa74d7e6c7cae1b7692d006aa5cb72df0c3b88bf049779aa2b566f9d35

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch
deleted file mode 100644
index 7fd775139b2..000
--- a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-
-Pull request:
-https://github.com/PeterHuewe/tpm-emulator/pull/37
-
-
-From 694b7c24ac09e0ec1e54ab71eb9c82a8d4f41d33 Mon Sep 17 00:00:00 2001
-From: Alon Bar-Lev 
-Date: Tue, 11 Sep 2018 14:08:49 +0300
-Subject: [PATCH 1/3] build: use GNUInstallDirs to allow override install
- directories
-
-Signed-off-by: Alon Bar-Lev 

- CMakeLists.txt   | 1 +
- tddl/CMakeLists.txt  | 6 +++---
- tpmd/unix/CMakeLists.txt | 2 +-
- 3 files changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f362298..d047ce3 100644
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -6,6 +6,7 @@
- project(TPM_Emulator C)
- 
- cmake_minimum_required(VERSION 2.4)
-+include(GNUInstallDirs)
- set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
- if(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-diff --git a/tddl/CMakeLists.txt b/tddl/CMakeLists.txt
-index 0be3281..6cc63b3 100644
 a/tddl/CMakeLists.txt
-+++ b/tddl/CMakeLists.txt
-@@ -15,9 +15,9 @@ elseif(WIN32)
-   set_target_properties(tddl PROPERTIES PREFIX "")
- endif()
- 
--install(TARGETS tddl DESTINATION lib)
--install(TARGETS tddl_static DESTINATION lib)
--install(FILES "tddl.h" DESTINATION include)
-+install(TARGETS tddl DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+install(TARGETS tddl_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+install(FILES "tddl.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
- 
- include_directories(${CMAKE_CURRENT_SOURCE_DIR})
- add_executable(test_tddl test_tddl.c)
-diff --git a/tpmd/unix/CMakeLists.txt b/tpmd/unix/CMakeLists.txt
-index 40c436b..c5c394a 100644
 a/tpmd/unix/CMakeLists.txt
-+++ b/tpmd/unix/CMakeLists.txt
-@@ -13,5 +13,5 @@ target_link_libraries(tpmd mtm tpm tpm_crypto)
- else()
- target_link_libraries(tpmd tpm tpm_crypto)
- endif()
--install(TARGETS tpmd RUNTIME DESTINATION bin)
-+install(TARGETS tpmd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- 
--- 
-2.16.4
-
-From 89bf733368dda265040cf44ff8be69a15ab66712 Mon Sep 17 00:00:00 2001
-From: Alon Bar-Lev 
-Date: Tue, 11 Sep 2018 16:36:12 +0300
-Subject: [PATCH 2/3] build: do not build mtm unless enabled
-
-Signed-off-by: Alon Bar-Lev 

- CMakeLists.txt | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index d047ce3..b8b68a3 100644
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -67,7 +67,9 @@ include_directories(${CMAKE_BINARY_DIR})
- 
- # add internal libraries
- add_subdirectory(tpm)
--add_subdirectory(mtm)
-+if(MTM_EMULATOR)
-+add_subdirectory(mtm)
-+endif()
- add_subdirectory(crypto)
- 
- # add TDDL
--- 
-2.16.4
-
-From 24bbf683de0b0b24f0ec81d093c03e1f6a9570f2 Mon Sep 17 00:00:00 2001
-From: Alon Bar-Lev 
-Date: Tue, 11 Sep 2018 14:20:19 +0300
-Subject: [PATCH 3/3] build: support BUILD_DEV to disable device build
-
-Signed-off-by: Alon Bar-Lev 

- CMakeLists.txt | 7 ++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index b8b68a3..9ae6562 100644
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -76,7 +76,12 @@ add_subdirectory(crypto)
- add_subdirectory(tddl)
- 
- # add kernel modules

[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/, app-crypt/tpm-emulator/files/

2018-09-15 Thread Alon Bar-Lev
commit: 885121cfa0e1704416f3a6490b47a372bb7f2dd0
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sat Sep 15 22:18:02 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Sep 15 22:21:01 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=885121cf

app-crypt/tpm-emulator: cleanup old

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 app-crypt/tpm-emulator/Manifest|   1 -
 .../files/tpm-emulator-0.7.4-build.patch   | 100 -
 .../tpm-emulator/files/tpm-emulator.confd-0.7.4|   2 -
 .../tpm-emulator/files/tpm-emulator.initd-0.7.4|  59 
 .../tpm-emulator/tpm-emulator-0.7.4-r1.ebuild  |  80 -
 5 files changed, 242 deletions(-)

diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest
index ee01c035b31..69569405245 100644
--- a/app-crypt/tpm-emulator/Manifest
+++ b/app-crypt/tpm-emulator/Manifest
@@ -1,2 +1 @@
 DIST tpm-emulator-0.7.5.tar.gz 222341 BLAKE2B 
c6dc7494800f4c6d1f5e622c6a47fdd5487e0f2cbc34173d9039d6eb5fd7541dd2c1f514efbf220c605424059844e18650b31ee9934eda6626427b915fd6bc53
 SHA512 
24c16ec36ca92c484d6e8dfa53c8ca00dbc5b58d78d7166041db1e9ae277d763f0fc0a6b0cbd7e62fcf4671f6ad2d8df1213256be0a4200b79b6ee61ab73b2ef
-DIST tpm_emulator-0.7.4.tar.gz 214145 BLAKE2B 
b8bbd53ecfb90e87f1306c03d2c65a472819d23d10bd63fa966bfadef4776c3876c2f6fc03cc878ece670bdfcd22c9f403ef4bc7f4593a0a6c7f8d17051ac3ba
 SHA512 
4928b5b82f57645be9408362706ff2c4d9baa635b21b0d41b1c82930e8c60a759b1ea4fa74d7e6c7cae1b7692d006aa5cb72df0c3b88bf049779aa2b566f9d35

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
deleted file mode 100644
index ada748f7129..000
--- a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From ca99fe81c8aee204c1a8b7f3ca264130e54d9418 Mon Sep 17 00:00:00 2001
-From: Alon Bar-Lev 
-Date: Sat, 1 Sep 2018 21:32:07 +0300
-Subject: [PATCH] tpm: tpm_deprecated.c fix compare
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-tpm/tpm_deprecated.c:437:7: error: ‘__builtin_memcmp_eq’ reading 20 bytes from 
a region of size 8 [-Werror=stringop-overflow=]
-   if (memcmp(, , sizeof(TPM_HMAC))) {
-   ^~~
-cc1: all warnings being treated as errors
-
-Bug: https://bugs.gentoo.org/show_bug.cgi?id=664198

- tpm/tpm_deprecated.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c
-index c362b56..4c49f54 100644
 a/tpm/tpm_deprecated.c
-+++ b/tpm/tpm_deprecated.c
-@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE 
parentHandle,
-   tpm_hmac_final(_ctx, b1.digest);
-   /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
- indicate a failure if the values do not match. */
--  if (memcmp(, , sizeof(TPM_HMAC))) {
-+  if (memcmp(, newAuthLink, sizeof(TPM_HMAC))) {
- debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
- return TPM_FAIL;
-   }
-From 035af1df2b18afd695150c6f9e426133b775c0a1 Mon Sep 17 00:00:00 2001
-From: Florian Larysch 
-Date: Tue, 24 Oct 2017 19:33:00 +0200
-Subject: [PATCH] tpm_command_handler: fix switch fallthrough
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Compiling with a recent GCC fails as follows:
-
-  tpm-emulator/tpm/tpm_cmd_handler.c: In function ‘tpm_setup_rsp_auth’:
-  tpm-emulator/tpm/tpm_cmd_handler.c:3332:7: error: this statement may fall 
through [-Werror=implicit-fallthrough=]
- tpm_hmac_final(, rsp->auth2->auth);
- ^~~
-  tpm-emulator/tpm/tpm_cmd_handler.c::5: note: here
-   case TPM_TAG_RSP_AUTH1_COMMAND:
-
-Looking at the code, this does indeed seem unintentional. Add a break
-state in the appropriate place.

- tpm/tpm_cmd_handler.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
-index 288d1ce..5aea4e7 100644
 a/tpm/tpm_cmd_handler.c
-+++ b/tpm/tpm_cmd_handler.c
-@@ -3330,6 +3330,7 @@ static void tpm_setup_rsp_auth(TPM_COMMAND_CODE ordinal, 
TPM_RESPONSE *rsp)
-   sizeof(rsp->auth2->nonceOdd.nonce));
-   tpm_hmac_update(, (BYTE*)>auth2->continueAuthSession, 1);
-   tpm_hmac_final(, rsp->auth2->auth);
-+  break;
- case TPM_TAG_RSP_AUTH1_COMMAND:
-   tpm_hmac_init(, rsp->auth1->secret, sizeof(rsp->auth1->secret));
-   tpm_hmac_update(, rsp->auth1->digest, sizeof(rsp->auth1->digest));
--- 
-2.16.4
-
-From 0f4579e913aeb3a893631a3caee420a0e9803683 Mon Sep 17 00:00:00 2001
-From: Peter Huewe 
-Date: Mon, 26 Jun 2017 00:25:43 +0200
-Subject: [PATCH] Workaround wrong fallthrough case by returning TPM_FAIL
-
-The spec says that the number of verified PCRs should be returned - which it 
currently does 

[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/files/, app-crypt/tpm-emulator/

2018-09-11 Thread Alon Bar-Lev
commit: 18779e114fbfcb80dc83b228b0581dd75f855a7f
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Tue Sep 11 14:02:39 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Tue Sep 11 15:03:35 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18779e11

app-crypt/tpm-emulator: massive cleanup

Kernel module is optional now, no need to enforce it.

Fix libdir issue.

Support MTM emulator.

Properly enable/disable openssl.

Properly build kernel module.

Rewrite of init.d scripts.

Probably more.

Closes: https://bugs.gentoo.org/show_bug.cgi?id=640734
Bug: https://bugs.gentoo.org/show_bug.cgi?id=540384
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 .../files/tpm-emulator-0.7.4-build.patch   |  69 
 .../files/tpm-emulator-0.7.4-cmake.patch   | 120 +
 app-crypt/tpm-emulator/files/tpm-emulator.confd-r2 |   1 +
 app-crypt/tpm-emulator/files/tpm-emulator.initd-r2 |  46 
 app-crypt/tpm-emulator/metadata.xml|   3 +
 .../tpm-emulator/tpm-emulator-0.7.4-r2.ebuild  |  85 +++
 6 files changed, 324 insertions(+)

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
index 7a299a15fbf..ada748f7129 100644
--- a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
@@ -29,3 +29,72 @@ index c362b56..4c49f54 100644
  debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
  return TPM_FAIL;
}
+From 035af1df2b18afd695150c6f9e426133b775c0a1 Mon Sep 17 00:00:00 2001
+From: Florian Larysch 
+Date: Tue, 24 Oct 2017 19:33:00 +0200
+Subject: [PATCH] tpm_command_handler: fix switch fallthrough
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compiling with a recent GCC fails as follows:
+
+  tpm-emulator/tpm/tpm_cmd_handler.c: In function ‘tpm_setup_rsp_auth’:
+  tpm-emulator/tpm/tpm_cmd_handler.c:3332:7: error: this statement may fall 
through [-Werror=implicit-fallthrough=]
+ tpm_hmac_final(, rsp->auth2->auth);
+ ^~~
+  tpm-emulator/tpm/tpm_cmd_handler.c::5: note: here
+   case TPM_TAG_RSP_AUTH1_COMMAND:
+
+Looking at the code, this does indeed seem unintentional. Add a break
+state in the appropriate place.
+---
+ tpm/tpm_cmd_handler.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..5aea4e7 100644
+--- a/tpm/tpm_cmd_handler.c
 b/tpm/tpm_cmd_handler.c
+@@ -3330,6 +3330,7 @@ static void tpm_setup_rsp_auth(TPM_COMMAND_CODE ordinal, 
TPM_RESPONSE *rsp)
+   sizeof(rsp->auth2->nonceOdd.nonce));
+   tpm_hmac_update(, (BYTE*)>auth2->continueAuthSession, 1);
+   tpm_hmac_final(, rsp->auth2->auth);
++  break;
+ case TPM_TAG_RSP_AUTH1_COMMAND:
+   tpm_hmac_init(, rsp->auth1->secret, sizeof(rsp->auth1->secret));
+   tpm_hmac_update(, rsp->auth1->digest, sizeof(rsp->auth1->digest));
+-- 
+2.16.4
+
+From 0f4579e913aeb3a893631a3caee420a0e9803683 Mon Sep 17 00:00:00 2001
+From: Peter Huewe 
+Date: Mon, 26 Jun 2017 00:25:43 +0200
+Subject: [PATCH] Workaround wrong fallthrough case by returning TPM_FAIL
+
+The spec says that the number of verified PCRs should be returned - which it 
currently does not and breaks compilation with gcc7
+See #26
+Since this code is probably unused anyway, we now simply return TPM_FAIL until 
someone comes up with a solution.
+
+Spec:
+https://www.trustedcomputinggroup.org/wp-content/uploads/Revision_7.02-_29April2010-tcg-mobile-trusted-module-1.0.pdf
+---
+ mtm/mtm_capability.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mtm/mtm_capability.c b/mtm/mtm_capability.c
+index a09b116..4046de5 100644
+--- a/mtm/mtm_capability.c
 b/mtm/mtm_capability.c
+@@ -87,6 +87,8 @@ static TPM_RESULT cap_mtm_permanent_data(UINT32 subCapSize, 
BYTE *subCap,
+ tpm_free(*resp);
+ return TPM_FAIL;
+   }
++  error("[TPM_CAP_MTM_PERMANENT_DATA] SubCap 2 not Implemented");
++  return TPM_FAIL; // TODO not implemented.
+ 
+ case 3:
+   return return_UINT32(respSize, resp,
+-- 
+2.16.4
+

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch
new file mode 100644
index 000..7fd775139b2
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-cmake.patch
@@ -0,0 +1,120 @@
+
+Pull request:
+https://github.com/PeterHuewe/tpm-emulator/pull/37
+
+
+From 694b7c24ac09e0ec1e54ab71eb9c82a8d4f41d33 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev 
+Date: Tue, 11 Sep 2018 14:08:49 +0300
+Subject: [PATCH 1/3] build: use GNUInstallDirs to allow override install
+ directories
+
+Signed-off-by: Alon Bar-Lev 
+---
+ CMakeLists.txt   | 1 +
+ tddl/CMakeLists.txt  | 6 +++---
+ 

[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/, app-crypt/tpm-emulator/files/

2018-09-09 Thread Alon Bar-Lev
commit: b220ce5e246cfee6691af027c86045a9d1fffe21
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sun Sep  9 08:14:32 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sun Sep  9 08:15:58 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b220ce5e

app-crypt/tpm-emulator: fix incorrect memcpy

Closes: https://bugs.gentoo.org/show_bug.cgi?id=664198
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 .../files/tpm-emulator-0.7.4-build.patch   | 31 ++
 .../tpm-emulator/tpm-emulator-0.7.4-r1.ebuild  |  4 +++
 2 files changed, 35 insertions(+)

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch 
b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
new file mode 100644
index 000..7a299a15fbf
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
@@ -0,0 +1,31 @@
+From ca99fe81c8aee204c1a8b7f3ca264130e54d9418 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev 
+Date: Sat, 1 Sep 2018 21:32:07 +0300
+Subject: [PATCH] tpm: tpm_deprecated.c fix compare
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+tpm/tpm_deprecated.c:437:7: error: ‘__builtin_memcmp_eq’ reading 20 bytes from 
a region of size 8 [-Werror=stringop-overflow=]
+   if (memcmp(, , sizeof(TPM_HMAC))) {
+   ^~~
+cc1: all warnings being treated as errors
+
+Bug: https://bugs.gentoo.org/show_bug.cgi?id=664198
+---
+ tpm/tpm_deprecated.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c
+index c362b56..4c49f54 100644
+--- a/tpm/tpm_deprecated.c
 b/tpm/tpm_deprecated.c
+@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE 
parentHandle,
+   tpm_hmac_final(_ctx, b1.digest);
+   /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
+ indicate a failure if the values do not match. */
+-  if (memcmp(, , sizeof(TPM_HMAC))) {
++  if (memcmp(, newAuthLink, sizeof(TPM_HMAC))) {
+ debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
+ return TPM_FAIL;
+   }

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
index 0192de92e2f..6fc770390fc 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -24,6 +24,10 @@ DEPEND="${RDEPEND}
 
 S=${WORKDIR}/${P/-/_}
 
+PATCHES=(
+   "${FILESDIR}/${P}-build.patch"
+)
+
 pkg_setup() {
enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2018-09-01 Thread Alon Bar-Lev
commit: 9b16d98eafda73bb2bf03bbf080b114dce1f17ca
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sat Sep  1 18:18:30 2018 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Sep  1 19:01:31 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b16d98e

app-crypt/tpm-emulator: create the tss group

Closes: https://bugs.gentoo.org/show_bug.cgi?id=657086
Thanks:  Toralf Förster
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
index 3bd4cc56bd5..0192de92e2f 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -25,6 +25,7 @@ DEPEND="${RDEPEND}
 S=${WORKDIR}/${P/-/_}
 
 pkg_setup() {
+   enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss
if use modules; then
CONFIG_CHECK="MODULES"



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2017-12-11 Thread Alon Bar-Lev
commit: 52c44e18ccdc716c5ef2d8bd969bafc43f6fbca8
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Thu Dec  7 18:27:42 2017 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Mon Dec 11 16:35:37 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52c44e18

app-crypt/tpm-emulator: allow fallthrough

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=640200
Package-Manager: Portage-2.3.13, Repoman-2.3.3

 app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
index 8f55dd6e71a..3bd4cc56bd5 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=6
 MODULES_OPTIONAL_USE="modules"
-inherit user linux-mod cmake-utils udev
+inherit flag-o-matic user linux-mod cmake-utils udev
 
 MY_P=${P/-/_}
 DESCRIPTION="Emulator driver for tpm"
@@ -46,6 +46,7 @@ src_configure() {
local mycmakeargs=(
-DUSE_OPENSSL=$(usex ssl)
)
+   append-cflags -Wno-implicit-fallthrough
cmake-utils_src_configure
 
# only here we have BUILD_DIR



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2017-10-28 Thread Alon Bar-Lev
commit: 2cb7f50653967716c97060643a8f9de44bf62579
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Sat Oct 28 17:33:05 2017 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Oct 28 18:57:31 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cb7f506

app-crypt/tpm-emulator: move module USE to MODULES_OPTIONAL_USE

Gentoo-Bug: https://bugs.gentoo.org/635720
Package-Manager: Portage-2.3.8, Repoman-2.3.3

 app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
index 2e719e5b28b..8f55dd6e71a 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -2,6 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
+MODULES_OPTIONAL_USE="modules"
 inherit user linux-mod cmake-utils udev
 
 MY_P=${P/-/_}
@@ -13,7 +14,7 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-IUSE="libressl ssl modules"
+IUSE="libressl ssl"
 RDEPEND="ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2017-02-03 Thread Alon Bar-Lev
commit: f613e8b169d9142a7dada3807f84885fe2f9aff6
Author: Alon Bar-Lev  gentoo  org>
AuthorDate: Fri Feb  3 23:12:40 2017 +
Commit: Alon Bar-Lev  gentoo  org>
CommitDate: Sat Feb  4 01:30:47 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f613e8b1

app-crypt/tpm-emulator: eapi bump

Package-Manager: portage-2.3.3

 app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
index e113fbb..fdb8156 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 inherit user linux-mod cmake-utils udev
 
 MY_P=${P/-/_}
@@ -35,6 +35,7 @@ pkg_setup() {
 }
 
 src_prepare() {
+   default
# do not build and install the kernel module
sed -i 's/COMMAND ${tpmd_dev_BUILD_CMD}//' tpmd_dev/CMakeLists.txt || 
die
sed -i 's/install(CODE.*//' tpmd_dev/CMakeLists.txt || die
@@ -42,7 +43,7 @@ src_prepare() {
 
 src_configure() {
mycmakeargs=(
-   $(cmake-utils_use_use ssl OPENSSL)
+   -DUSE_OPENSSL=$(usex ssl)
)
cmake-utils_src_configure
 



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/files/

2016-07-07 Thread Patrice Clement
commit: 4f7b2b7290b8275eec8e84bf9b50a122c5169e9a
Author: Michael Mair-Keimberger (asterix)  gmail 
 com>
AuthorDate: Sun Jul  3 17:22:59 2016 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Thu Jul  7 07:18:50 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f7b2b72

app-crypt/tpm-emulator: remove unused patches

Closes: https://github.com/gentoo/gentoo/pull/1826

Signed-off-by: Patrice Clement  gentoo.org>

 app-crypt/tpm-emulator/files/tpm-emulator.initd | 54 -
 app-crypt/tpm-emulator/files/tpm-emulator.udev  |  1 -
 2 files changed, 55 deletions(-)

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.initd 
b/app-crypt/tpm-emulator/files/tpm-emulator.initd
deleted file mode 100644
index 6b2a648..000
--- a/app-crypt/tpm-emulator/files/tpm-emulator.initd
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-opts="save clear deactivated"
-
-STARTUP_MODE='save';
-
-
-depend() {
-   use logger
-   after coldplug
-}
-
-checkconfig() {
-   lsmod | grep -q "^tpmd_dev\b" \
-   || modprobe tpmd_dev &>/dev/null \
-   || eerror "Failed to load module tpmd_dev";
-
-   if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
-   eerror "No TPM device found!"
-   return 1
-   fi
-   return 0
-}
-
-start() {
-   ebegin "Starting tpm-emulator daemon with mode '$STARTUP_MODE' (tpmd)"
-   checkconfig || eend $?
-   start-stop-daemon --start --chuid tss --exec /usr/sbin/tpmd 
$STARTUP_MODE > /dev/null
-   eend $?
-}
-
-save() {
-   STARTUP_MODE='save';
-   svc_restart 
-}
-
-clear() {
-   STARTUP_MODE='clear';
-   svc_restart 
-}
-
-deactivated() {
-   STARTUP_MODE='deactivated';
-   svc_restart 
-}
-
-stop() {
-   ebegin "Stopping tpm-emulator daemon (tpmd)"
-   start-stop-daemon --stop --exec /usr/sbin/tpmd --user tss > /dev/null
-   eend $?
-}

diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.udev 
b/app-crypt/tpm-emulator/files/tpm-emulator.udev
deleted file mode 100644
index ca053b9..000
--- a/app-crypt/tpm-emulator/files/tpm-emulator.udev
+++ /dev/null
@@ -1 +0,0 @@
-KERNEL=="tpm", NAME="%k", SYMLINK+="tpm0", GROUP="tss", MODE="0660"



[gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/

2016-06-03 Thread Anthony G. Basile
commit: 0e9417f4c8e15de78c8156d7d223260492d8b768
Author: Anthony G. Basile  gentoo  org>
AuthorDate: Fri Jun  3 14:48:28 2016 +
Commit: Anthony G. Basile  gentoo  org>
CommitDate: Fri Jun  3 14:48:28 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e9417f4

app-crypt/tpm-emulator: add libressl support

Package-Manager: portage-2.2.28

 app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild 
b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
index 3b6d47b..e489b6b 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -14,8 +14,11 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-IUSE="ssl modules"
-RDEPEND="ssl? ( dev-libs/openssl )"
+IUSE="libressl ssl modules"
+RDEPEND="ssl? (
+   !libressl? ( dev-libs/openssl:0= )
+   libressl? ( dev-libs/libressl:0= )
+   )"
 DEPEND="${RDEPEND}
!ssl? ( dev-libs/gmp )"