aboutsummaryrefslogtreecommitdiff
path: root/emulators/tpm-emulator/files
diff options
context:
space:
mode:
authorNorikatsu Shigemura <nork@FreeBSD.org>2010-11-07 12:08:52 +0000
committerNorikatsu Shigemura <nork@FreeBSD.org>2010-11-07 12:08:52 +0000
commit1cf92127b214d45040e6429373dbe4caa266c68a (patch)
tree8ebda50beeb8a641516bc71fbcf900e9a31f86f7 /emulators/tpm-emulator/files
parentc38e52a3c0b061b44ebb589d362563613f2edab8 (diff)
downloadports-1cf92127b214d45040e6429373dbe4caa266c68a.tar.gz
ports-1cf92127b214d45040e6429373dbe4caa266c68a.zip
Notes
Diffstat (limited to 'emulators/tpm-emulator/files')
-rw-r--r--emulators/tpm-emulator/files/patch-CMakeLists.txt44
-rw-r--r--emulators/tpm-emulator/files/patch-mtm-mtm_structures.h11
-rw-r--r--emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt26
-rw-r--r--emulators/tpm-emulator/files/patch-tpm-tpm_ticks.c40
-rw-r--r--emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt9
-rw-r--r--emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt13
-rw-r--r--emulators/tpm-emulator/files/patch-tpmd_dev-CMakeLists.txt29
-rw-r--r--emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-Makefile28
-rw-r--r--emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.c29
-rw-r--r--emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.h11
10 files changed, 240 insertions, 0 deletions
diff --git a/emulators/tpm-emulator/files/patch-CMakeLists.txt b/emulators/tpm-emulator/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..76de9a3fa2f7
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-CMakeLists.txt
@@ -0,0 +1,44 @@
+--- CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
++++ CMakeLists.txt 2010-10-25 02:56:43.617558705 +0900
+@@ -5,13 +5,13 @@
+
+ project(TPM_Emulator C)
+
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 2.4)
+
+ # enforce out of source build
+ string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" IS_INSOURCE)
+ if(IS_INSOURCE)
+ message(FATAL_ERROR "${PROJECT_NAME} requires an out of source build.")
+-endif()
++endif(IS_INSOURCE)
+
+ # set project and build version
+ set(${PROJECT_NAME}_VERSION_MAJOR 0)
+@@ -29,14 +29,14 @@
+ set(TPM_SOCKET_NAME "/private/var/run/tpm/tpmd_socket:0")
+ set(TPM_STORAGE_NAME "/private/var/lib/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
+ set(TPM_DEVICE_NAME "/dev/tpm")
+-else()
++else(WIN32)
+ set(TPM_LOG_FILE "/var/log/tpmd.log")
+ set(TPM_SOCKET_NAME "/var/run/tpm/tpmd_socket:0")
+ set(TPM_STORAGE_NAME "/var/lib/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
+ set(TPM_DEVICE_NAME "/dev/tpm")
+-endif()
++endif(WIN32)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+-add_definitions(-Wall -Werror -Wextra -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
++add_definitions(-Wall -Werror -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
+
+ # configure CPack
+ set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
+@@ -51,6 +51,7 @@
+ # include root directories
+ include_directories(${CMAKE_SOURCE_DIR})
+ include_directories(${CMAKE_BINARY_DIR})
++include_directories("/usr/local/include")
+
+ # add internal libraries
+ add_subdirectory(tpm)
diff --git a/emulators/tpm-emulator/files/patch-mtm-mtm_structures.h b/emulators/tpm-emulator/files/patch-mtm-mtm_structures.h
new file mode 100644
index 000000000000..6f9055193e67
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-mtm-mtm_structures.h
@@ -0,0 +1,11 @@
+--- mtm/mtm_structures.h.orig 2010-07-06 06:21:20.000000000 +0900
++++ mtm/mtm_structures.h 2010-10-25 02:56:43.619561686 +0900
+@@ -228,8 +228,6 @@
+ MTM_PERMANENT_DATA data;
+ } permanent;
+ struct {
+- } stclear;
+- struct {
+ MTM_STANY_FLAGS flags;
+ } stany;
+ } MTM_DATA;
diff --git a/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt b/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt
new file mode 100644
index 000000000000..f264de37e902
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt
@@ -0,0 +1,26 @@
+--- tddl/CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
++++ tddl/CMakeLists.txt 2010-10-25 02:56:43.620555878 +0900
+@@ -5,18 +5,21 @@
+
+ set(tddl_SRCS "tddl.c" "tddl.h")
+ add_library(tddl SHARED ${tddl_SRCS})
++add_library(tddlStatic STATIC ${tddl_SRCS})
+ if(UNIX)
+ set_target_properties(tddl PROPERTIES SOVERSION "1.2"
+ VERSION "1.2.${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}")
++ set_target_properties(tddlStatic PROPERTIES OUTPUT_NAME tddl)
+ elseif(WIN32)
+ set_target_properties(tddl PROPERTIES OUTPUT_NAME ifxtpm)
+ set_target_properties(tddl PROPERTIES PREFIX "")
+-endif()
++endif(UNIX)
+
+ install(TARGETS tddl DESTINATION lib)
++install(TARGETS tddlStatic DESTINATION lib)
+ install(FILES "tddl.h" DESTINATION include)
+
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ add_executable(test_tddl test_tddl.c)
+-target_link_libraries(test_tddl tddl)
++target_link_libraries(test_tddl tddlStatic)
+
diff --git a/emulators/tpm-emulator/files/patch-tpm-tpm_ticks.c b/emulators/tpm-emulator/files/patch-tpm-tpm_ticks.c
new file mode 100644
index 000000000000..00b1daaeb1f3
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpm-tpm_ticks.c
@@ -0,0 +1,40 @@
+--- tpm/tpm_ticks.c.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpm/tpm_ticks.c 2010-10-25 02:56:43.622559766 +0900
+@@ -42,7 +42,7 @@
+ {
+ TPM_RESULT res;
+ TPM_KEY_DATA *key;
+- BYTE *info, *ptr;
++ BYTE *info_buffer, *ptr;
+ UINT32 info_length, len;
+ info("TPM_TickStampBlob()");
+ /* get key */
+@@ -66,21 +66,21 @@
+ if (*sig == NULL) return TPM_FAIL;
+ /* setup TPM_SIGN_INFO structure */
+ info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
+- info = tpm_malloc(info_length);
+- if (info == NULL) {
++ info_buffer = tpm_malloc(info_length);
++ if (info_buffer == NULL) {
+ tpm_free(*sig);
+ return TPM_FAIL;
+ }
+- memcpy(&info[0], "\x00\x05TSTP", 6);
+- memcpy(&info[6], antiReplay->nonce, 20);
+- ptr = &info[26]; len = info_length - 26;
++ memcpy(&info_buffer[0], "\x00\x05TSTP", 6);
++ memcpy(&info_buffer[6], antiReplay->nonce, 20);
++ ptr = &info_buffer[26]; len = info_length - 26;
+ tpm_marshal_UINT32(&ptr, &len, info_length - 30);
+ memcpy(ptr, digestToStamp->digest, sizeof(TPM_DIGEST));
+ ptr += sizeof(TPM_DIGEST); len -= sizeof(TPM_DIGEST);
+ if (tpm_marshal_TPM_CURRENT_TICKS(&ptr, &len, currentTicks)
+- || tpm_rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
++ || tpm_rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info_buffer, info_length, *sig)) {
+ tpm_free(*sig);
+- tpm_free(info);
++ tpm_free(info_buffer);
+ return TPM_FAIL;
+ }
+ return TPM_SUCCESS;
diff --git a/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt b/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt
new file mode 100644
index 000000000000..8c1f00c2c879
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt
@@ -0,0 +1,9 @@
+--- tpmd/CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpmd/CMakeLists.txt 2010-10-25 02:56:43.624559116 +0900
+@@ -11,5 +11,5 @@
+
+ add_subdirectory(windows)
+
+-endif()
++endif(UNIX)
+
diff --git a/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt b/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt
new file mode 100644
index 000000000000..b97fb103c0c2
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt
@@ -0,0 +1,13 @@
+--- tpmd/unix/CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpmd/unix/CMakeLists.txt 2010-10-25 02:56:43.633558246 +0900
+@@ -10,8 +10,8 @@
+ if(MTM_EMULATOR)
+ add_definitions(-DMTM_EMULATOR)
+ target_link_libraries(tpmd mtm tpm crypto)
+-else()
++else(MTM_EMULATOR)
+ target_link_libraries(tpmd tpm crypto)
+-endif()
++endif(MTM_EMULATOR)
+ install(TARGETS tpmd RUNTIME DESTINATION bin)
+
diff --git a/emulators/tpm-emulator/files/patch-tpmd_dev-CMakeLists.txt b/emulators/tpm-emulator/files/patch-tpmd_dev-CMakeLists.txt
new file mode 100644
index 000000000000..e16dec4e6fa2
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpmd_dev-CMakeLists.txt
@@ -0,0 +1,29 @@
+--- tpmd_dev/CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpmd_dev/CMakeLists.txt 2010-10-25 02:56:43.626557976 +0900
+@@ -17,8 +17,8 @@
+ set(tpmd_dev_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/openbsd")
+ set(tpmd_dev_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/openbsd")
+ set(tpmd_dev_OBJ "${tpmd_dev_BINARY_DIR}/tpmd_dev.o")
+-set(tpmd_dev_BUILD_CMD make -C ${tpmd_dev_BINARY_DIR})
+-set(tpmd_dev_INSTALL_CMD make -C ${tpmd_dev_BINARY_DIR} install)
++set(tpmd_dev_BUILD_CMD gmake -C ${tpmd_dev_BINARY_DIR})
++set(tpmd_dev_INSTALL_CMD gmake -C ${tpmd_dev_BINARY_DIR} install)
+
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+
+@@ -28,7 +28,7 @@
+ set(tpmd_dev_BUILD_CMD make -C ${tpmd_dev_BINARY_DIR})
+ set(tpmd_dev_INSTALL_CMD make -C ${tpmd_dev_BINARY_DIR} install)
+
+-endif()
++endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+
+ # compile module
+ if(tpmd_dev_OBJ)
+@@ -45,5 +45,5 @@
+
+ install(CODE "EXECUTE_PROCESS(COMMAND ${tpmd_dev_INSTALL_CMD})")
+
+-endif()
++endif(tpmd_dev_OBJ)
+
diff --git a/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-Makefile b/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-Makefile
new file mode 100644
index 000000000000..b081bb6b9e78
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-Makefile
@@ -0,0 +1,28 @@
+--- tpmd_dev/openbsd/Makefile.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpmd_dev/openbsd/Makefile 2010-10-25 02:56:43.628559140 +0900
+@@ -6,14 +6,15 @@
+
+ CFLAGS= -D_KERNEL -I/usr/src/sys
+ SRC= tpmd_dev.c
++OBJ= tpmd_dev.obj
+ MODULE= tpmd_dev.o
+
+ all:
+- cc -c $(SRC) $(CFLAGS)
+- ld -r -o $(MODULE) $(SRC:.c=.o)
++ cc -o $(OBJ) -c $(SRC) $(CFLAGS)
++ ld -r -o $(MODULE) $(OBJ)
+
+ clean:
+- rm -rf $(SRC:.c=.o)
++ rm -rf $(OBJ)
+ rm -f $(MODULE)
+
+ load: all mknod
+@@ -27,3 +28,6 @@
+
+ rmnod:
+ rm /dev/tpm
++
++install:
++
diff --git a/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.c b/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.c
new file mode 100644
index 000000000000..26b71e5b7ffe
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.c
@@ -0,0 +1,29 @@
+--- tpmd_dev/openbsd/tpmd_dev.c.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpmd_dev/openbsd/tpmd_dev.c 2010-10-25 02:56:43.630557372 +0900
+@@ -32,7 +32,7 @@
+ #include <sys/proc.h>
+ #include <machine/intr.h>
+
+-#include "tpm_dev.h"
++#include "tpmd_dev.h"
+
+
+ int tpmopen __P((dev_t dev, int oflags, int devtype, struct proc *p));
+@@ -57,7 +57,7 @@
+ cdev_decl(tpm);
+
+ /* define our cdev struct containing the functions */
+-static struct cdevsw cdev_tpm = cdev_tpm_init(1,tpm);
++static struct cdevsw cdev_tpm = cdev_tpmd_init(1,tpm);
+
+ /* fill in the lkm_dev structure */
+ MOD_DEV("tpm",LM_DT_CHAR,-1,&cdev_tpm);
+@@ -213,7 +213,7 @@
+ * sometime returns EINTR
+ */
+ tpmd_sock->so_rcv.sb_flags |= SB_NOINTR;
+- error = soreceive(tpmd_sock,NULL,uio,NULL,NULL,NULL);
++ error = soreceive(tpmd_sock,NULL,uio,NULL,NULL,NULL,0);
+
+ if (error) {
+ debug("soreceive() failed %i",error);
diff --git a/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.h b/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.h
new file mode 100644
index 000000000000..77b57d3188e9
--- /dev/null
+++ b/emulators/tpm-emulator/files/patch-tpmd_dev-openbsd-tpmd_dev.h
@@ -0,0 +1,11 @@
+--- tpmd_dev/openbsd/tpmd_dev.h.orig 2010-07-06 06:21:20.000000000 +0900
++++ tpmd_dev/openbsd/tpmd_dev.h 2010-10-25 02:56:43.632557559 +0900
+@@ -20,7 +20,7 @@
+
+ #include "config.h"
+
+-#define cdev_tpm_init(c,n) { \
++#define cdev_tpmd_init(c,n) { \
+ dev_init(c,n,open),dev_init(c,n,close),dev_init(c,n,read), \
+ dev_init(c,n,write), dev_init(c,n,ioctl),(dev_type_stop((*))) lkmenodev, \
+ 0,(dev_type_poll((*))) lkmenodev,(dev_type_mmap((*))) lkmenodev }