]> git.pld-linux.org Git - packages/tpm_emulator.git/commitdiff
- fix building with gcc 8.x master auto/th/tpm_emulator-0.7.4-16
authorJan Rękorajski <baggins@pld-linux.org>
Sat, 28 Jul 2018 19:28:24 +0000 (21:28 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Sat, 28 Jul 2018 19:28:24 +0000 (21:28 +0200)
- rel 16

gcc8.patch [new file with mode: 0644]
tpm_emulator.spec

diff --git a/gcc8.patch b/gcc8.patch
new file mode 100644 (file)
index 0000000..24be0c5
--- /dev/null
@@ -0,0 +1,46 @@
+diff -ur tpm_emulator-0.7.4/mtm/CMakeLists.txt tpm_emulator-0.7.4-gcc8/mtm/CMakeLists.txt
+--- tpm_emulator-0.7.4/mtm/CMakeLists.txt      2011-12-20 19:30:06.000000000 +0100
++++ tpm_emulator-0.7.4-gcc8/mtm/CMakeLists.txt 2018-07-28 21:23:13.044547064 +0200
+@@ -3,6 +3,7 @@
+ #
+ # $Id: CMakeLists.txt 376 2010-02-16 14:51:42Z mast $
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-fallthrough")
+ add_definitions(-DMTM_EMULATOR)
+ file(GLOB tpm_SRCS ../tpm/tpm_cmd_handler.c ../tpm/tpm_data.c)
+ file(GLOB mtm_SRCS "*.[h|c]")
+diff -ur tpm_emulator-0.7.4/tpm/tpm_cmd_handler.c tpm_emulator-0.7.4-gcc8/tpm/tpm_cmd_handler.c
+--- tpm_emulator-0.7.4/tpm/tpm_cmd_handler.c   2011-12-20 19:30:06.000000000 +0100
++++ tpm_emulator-0.7.4-gcc8/tpm/tpm_cmd_handler.c      2018-07-28 21:17:04.576693746 +0200
+@@ -3330,6 +3330,7 @@
+                   sizeof(rsp->auth2->nonceOdd.nonce));
+       tpm_hmac_update(&hmac, (BYTE*)&rsp->auth2->continueAuthSession, 1);
+       tpm_hmac_final(&hmac, rsp->auth2->auth);
++      break;
+     case TPM_TAG_RSP_AUTH1_COMMAND:
+       tpm_hmac_init(&hmac, rsp->auth1->secret, sizeof(rsp->auth1->secret));
+       tpm_hmac_update(&hmac, rsp->auth1->digest, sizeof(rsp->auth1->digest));
+diff -ur tpm_emulator-0.7.4/tpm/tpm_deprecated.c tpm_emulator-0.7.4-gcc8/tpm/tpm_deprecated.c
+--- tpm_emulator-0.7.4/tpm/tpm_deprecated.c    2011-12-20 19:30:06.000000000 +0100
++++ tpm_emulator-0.7.4-gcc8/tpm/tpm_deprecated.c       2018-07-28 21:14:33.244844366 +0200
+@@ -434,7 +434,7 @@
+   tpm_hmac_final(&hmac_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(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
++  if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) {
+     debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
+     return TPM_FAIL;
+   }
+diff -ur tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c tpm_emulator-0.7.4-gcc8/tpmd_dev/linux/tpmd_dev.c
+--- tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c       2018-07-28 21:27:33.331082169 +0200
++++ tpm_emulator-0.7.4-gcc8/tpmd_dev/linux/tpmd_dev.c  2018-07-28 21:26:55.750619594 +0200
+@@ -82,7 +82,7 @@
+     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*)&addr, sizeof(struct sockaddr_un), 0);
+   if (res != 0) {
index 0e18a4257a69367769ab0b391cc78c51cc8633fa..1159cc64c30d0ea527e1a2da7b7aa1d7f03f1c97 100644 (file)
@@ -21,7 +21,7 @@ exit 1
 %define                _duplicate_files_terminate_build        0
 
 %define        pname   tpm_emulator
-%define        rel     15
+%define        rel     16
 Summary:       Software-based TPM and MTM Emulator
 Summary(pl.UTF-8):     Programowy emulator TPM i MTM
 Name:          %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
@@ -35,6 +35,7 @@ Patch0:               %{pname}-libdir.patch
 Patch1:                linux-3.19.patch
 Patch2:                linux-4.1.patch
 Patch3:                linux-4.7.patch
+Patch4:                gcc8.patch
 URL:           http://tpm-emulator.berlios.de/
 BuildRequires: cmake >= 2.4
 BuildRequires: gmp-devel
@@ -128,6 +129,7 @@ przekazujący odebrane polecenia do tpmd.\
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 # separate kernel module from userspace build
 echo > tpmd_dev/CMakeLists.txt
This page took 0.035074 seconds and 4 git commands to generate.