- Update to version 0.7.4
- Trim header PR: 172716 Submitted by: Ports Fury
This commit is contained in:
parent
2ef635dae3
commit
4084389efb
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=311846
@ -1,61 +1,36 @@
|
||||
# New ports collection makefile for: tpm-emulator
|
||||
# Date created: 18 Sep 2007
|
||||
# Whom: Sebastian Schuetz <sschuetz@fhm.edu>
|
||||
#
|
||||
# Created by: Sebastian Schuetz <sschuetz@fhm.edu>
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= tpm-emulator
|
||||
PORTVERSION= 0.7.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= emulators security
|
||||
MASTER_SITES= BERLIOS/${PORTNAME}
|
||||
DISTNAME= ${PORTNAME:S/-/_/}-${PORTVERSION}
|
||||
PORTNAME= tpm-emulator
|
||||
PORTVERSION= 0.7.4
|
||||
CATEGORIES= emulators security
|
||||
#MASTER_SITES= BERLIOS
|
||||
MASTER_SITES= SF/${PORTNAME}.berlios
|
||||
DISTNAME= ${PORTNAME:S,-,_,}-${PORTVERSION}
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
COMMENT= Trusted Platform Module (TPM) emulator
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
COMMENT= Trusted Platform Module (TPM) emulator
|
||||
|
||||
LIB_DEPENDS= gmp.10:${PORTSDIR}/math/gmp
|
||||
LICENSE= GPLv2
|
||||
|
||||
USE_CMAKE= YES
|
||||
USE_RC_SUBR= tpmd
|
||||
USE_LDCONFIG= YES
|
||||
MAKE_JOBS_SAFE= YES
|
||||
LIB_DEPENDS= gmp:${PORTSDIR}/math/gmp
|
||||
|
||||
CONFLICTS= trousers-tddl-[0-9d]*
|
||||
CONFLICTS= trousers-tddl-[0-9d]*
|
||||
|
||||
WANTLIB= c
|
||||
CMAKE_VERBOSE= YES
|
||||
CMAKE_SOURCE_PATH= ${WRKSRC}
|
||||
BUILD_WRKSRC= ${CONFIGURE_WRKSRC}
|
||||
INSTALL_WRKSRC= ${CONFIGURE_WRKSRC}
|
||||
CONFIGURE_WRKSRC= ${CMAKE_SOURCE_PATH}/build
|
||||
USE_RC_SUBR= tpmd
|
||||
|
||||
CMAKE_ENV= PREFIX=${PREFIX} ${CONFIGURE_ENV}
|
||||
CMAKE_ARGS= -DCMAKE_INCLUDE_PATH="${LOCALBASE}/include"
|
||||
LDFLAGS+= -L${LOCALBASE}/lib
|
||||
USE_CMAKE= yes
|
||||
CMAKE_OUTSOURCE=yes
|
||||
CMAKE_ENV= PREFIX="${PREFIX}"
|
||||
CMAKE_ARGS= -DTPM_INCLUDE_DIRS:STRING="${LOCALBASE}/include" \
|
||||
-DTPM_LIBRARY_DIRS:STRING="${LOCALBASE}/lib"
|
||||
USE_LDCONFIG= yes
|
||||
MAKE_JOBS_SAFE= yes
|
||||
|
||||
SUB_LIST= USERS=${USERS} GROUPS=${GROUPS}
|
||||
USERS= _tss
|
||||
GROUPS= _tss
|
||||
|
||||
USERS= _tss
|
||||
GROUPS= _tss
|
||||
|
||||
LICENSE= GPLv2
|
||||
LICENSE_FILE= ${WRKSRC}/README
|
||||
|
||||
WRKSRC= ${WRKDIR}/${DISTNAME}
|
||||
|
||||
post-extract:
|
||||
@${MKDIR} ${WRKSRC}/build
|
||||
|
||||
post-install:
|
||||
@${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 ${PREFIX}/var/lib/tpm
|
||||
@${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 /var/run/tpm
|
||||
|
||||
add-plist-post:
|
||||
@${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
|
||||
@${ECHO_CMD} "@unexec ${RMDIR} var/run/tpm 2>/dev/null || true" >> ${TMPPLIST}
|
||||
@${ECHO_CMD} "@exec ${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 var/run/tpm" >> ${TMPPLIST}
|
||||
SUB_LIST= USERS="${USERS}" GROUPS="${GROUPS}"
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
@ -63,4 +38,13 @@ add-plist-post:
|
||||
BROKEN= Does not compile on powerpc
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
@${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 ${PREFIX}/var/db/tpm
|
||||
@${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 /var/run/tpm
|
||||
|
||||
add-plist-post:
|
||||
@${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
|
||||
@${ECHO_CMD} "@unexec ${RMDIR} var/run/tpm 2>/dev/null || true" >> ${TMPPLIST}
|
||||
@${ECHO_CMD} "@exec ${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 var/run/tpm" >> ${TMPPLIST}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (tpm_emulator-0.7.1.tar.gz) = 7c10a753206bf0f32a767dc69039a866bd8d3eb8a4834f5e722c7510a9f54c24
|
||||
SIZE (tpm_emulator-0.7.1.tar.gz) = 207497
|
||||
SHA256 (tpm_emulator-0.7.4.tar.gz) = 4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459
|
||||
SIZE (tpm_emulator-0.7.4.tar.gz) = 214145
|
||||
|
@ -1,24 +1,26 @@
|
||||
--- CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
|
||||
+++ CMakeLists.txt 2010-12-15 07:33:54.234887143 +0900
|
||||
@@ -32,11 +32,11 @@
|
||||
@@ -36,19 +36,19 @@
|
||||
else()
|
||||
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_STORAGE_NAME "$ENV{PREFIX}/var/lib/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
|
||||
+set(TPM_STORAGE_NAME "$ENV{PREFIX}/var/db/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
|
||||
set(TPM_DEVICE_NAME "/dev/tpm")
|
||||
endif()
|
||||
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)
|
||||
-add_definitions(-Wall -Werror -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
|
||||
+add_definitions(-Wall -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
|
||||
if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
add_definitions(-Wextra)
|
||||
endif()
|
||||
if(USE_OPENSSL)
|
||||
add_definitions(-DUSE_OPENSSL)
|
||||
endif()
|
||||
-include_directories("/opt/local/include")
|
||||
-link_directories("/opt/local/lib")
|
||||
+include_directories(${TPM_INCLUDE_DIRS})
|
||||
+link_directories(${TPM_LIBRARY_DIRS})
|
||||
|
||||
# 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(${CMAKE_INCLUDE_PATH})
|
||||
|
||||
# add internal libraries
|
||||
add_subdirectory(tpm)
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- 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;
|
@ -1,15 +1,13 @@
|
||||
--- tddl/CMakeLists.txt.orig 2010-07-06 06:21:20.000000000 +0900
|
||||
+++ tddl/CMakeLists.txt 2010-12-11 04:00:11.868033375 +0900
|
||||
@@ -5,18 +5,21 @@
|
||||
|
||||
set(tddl_SRCS "tddl.c" "tddl.h")
|
||||
--- tddl/CMakeLists.txt.orig 2011-12-21 03:30:06.000000000 +0900
|
||||
+++ tddl/CMakeLists.txt 2012-10-10 01:01:00.000000000 +0900
|
||||
@@ -7,13 +7,13 @@
|
||||
add_library(tddl SHARED ${tddl_SRCS})
|
||||
+add_library(tddlStatic STATIC ${tddl_SRCS})
|
||||
add_library(tddl_static STATIC ${tddl_SRCS})
|
||||
if(UNIX)
|
||||
- set_target_properties(tddl PROPERTIES SOVERSION "1.2"
|
||||
+ set_target_properties(tddl PROPERTIES SOVERSION "1"
|
||||
VERSION "1.2.${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}")
|
||||
+ set_target_properties(tddlStatic PROPERTIES OUTPUT_NAME tddl)
|
||||
set_target_properties(tddl_static PROPERTIES OUTPUT_NAME tddl)
|
||||
elseif(WIN32)
|
||||
set_target_properties(tddl PROPERTIES OUTPUT_NAME ifxtpm)
|
||||
set_target_properties(tddl PROPERTIES PREFIX "")
|
||||
@ -17,11 +15,4 @@
|
||||
+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)
|
||||
|
||||
install(TARGETS tddl_static DESTINATION lib)
|
||||
|
@ -1,40 +0,0 @@
|
||||
--- 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;
|
@ -1,12 +1,12 @@
|
||||
--- 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
|
||||
--- tpmd/unix/CMakeLists.txt.orig 2011-12-21 03:30:06.000000000 +0900
|
||||
+++ tpmd/unix/CMakeLists.txt 2012-10-10 01:03:34.000000000 +0900
|
||||
@@ -10,8 +10,8 @@
|
||||
if(MTM_EMULATOR)
|
||||
add_definitions(-DMTM_EMULATOR)
|
||||
target_link_libraries(tpmd mtm tpm crypto)
|
||||
target_link_libraries(tpmd mtm tpm tpm_crypto)
|
||||
-else()
|
||||
+else(MTM_EMULATOR)
|
||||
target_link_libraries(tpmd tpm crypto)
|
||||
target_link_libraries(tpmd tpm tpm_crypto)
|
||||
-endif()
|
||||
+endif(MTM_EMULATOR)
|
||||
install(TARGETS tpmd RUNTIME DESTINATION bin)
|
||||
|
@ -1,29 +0,0 @@
|
||||
--- 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)
|
||||
|
@ -1,28 +0,0 @@
|
||||
--- 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:
|
||||
+
|
@ -1,29 +0,0 @@
|
||||
--- 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);
|
@ -1,11 +0,0 @@
|
||||
--- 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 }
|
@ -1,4 +1,6 @@
|
||||
The project aims to create a fully working Trusted Platform Module (TPM)
|
||||
emulator follwing the specifications of the Trusted Computing Group.
|
||||
The port provides a driver library libtddl which can be linked against programs
|
||||
emulator follwing the specifications of the Trusted Computing Group. The
|
||||
port provides a driver library libtddl which can be linked against programs
|
||||
providing a Trusted Software Stack to redirect TPM calls to the emulator.
|
||||
|
||||
WWW: http://tpm-emulator.berlios.de/
|
||||
|
@ -4,4 +4,5 @@ lib/libtddl.a
|
||||
lib/libtddl.so
|
||||
lib/libtddl.so.1
|
||||
lib/libtddl.so.1.2.0.7
|
||||
@dirrmtry var/lib/tpm
|
||||
@dirrmtry var/db/tpm
|
||||
@dirrmtry var/db
|
||||
|
Loading…
Reference in New Issue
Block a user