New upstream bug fix release
This commit is contained in:
parent
554d8fb3a4
commit
1136867bbb
@ -1,80 +0,0 @@
|
||||
--- trousers-0.3.1/src/tddl/tddl.c~ 2006-06-08 20:23:34.000000000 +0100
|
||||
+++ trousers-0.3.1/src/tddl/tddl.c 2008-09-27 10:12:27.000000000 +0100
|
||||
@@ -15,6 +15,8 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <sys/un.h>
|
||||
|
||||
#include "trousers/tss.h"
|
||||
#include "trousers_types.h"
|
||||
@@ -22,14 +24,16 @@
|
||||
#include "tcslog.h"
|
||||
#include "tddl.h"
|
||||
|
||||
-struct tpm_device_node tpm_device_nodes[] = {
|
||||
- {"/dev/tpm0", TDDL_UNDEF, TDDL_UNDEF},
|
||||
- {"/udev/tpm0", TDDL_UNDEF, TDDL_UNDEF},
|
||||
- {"/dev/tpm", TDDL_UNDEF, TDDL_UNDEF},
|
||||
- {NULL, 0, 0}
|
||||
+static struct tpm_device_node tpm_device_nodes[] = {
|
||||
+ {"/dev/tpm0", TDDL_TYPE_FILE, TDDL_UNDEF, TDDL_UNDEF},
|
||||
+ {"/udev/tpm0", TDDL_TYPE_FILE, TDDL_UNDEF, TDDL_UNDEF},
|
||||
+ {"/dev/tpm", TDDL_TYPE_FILE, TDDL_UNDEF, TDDL_UNDEF},
|
||||
+ {"/var/run/tpm/tpmd_socket:0", TDDL_TYPE_SOCKET, TDDL_TRANSMIT_RW,
|
||||
+ TDDL_UNDEF},
|
||||
+ {NULL, 0, 0, 0}
|
||||
};
|
||||
|
||||
-struct tpm_device_node *opened_device = NULL;
|
||||
+static struct tpm_device_node *opened_device = NULL;
|
||||
|
||||
BYTE txBuffer[TDDL_TXBUF_SIZE];
|
||||
|
||||
@@ -40,12 +44,30 @@ open_device(void)
|
||||
|
||||
/* tpm_device_paths is filled out in tddl.h */
|
||||
for (i = 0; tpm_device_nodes[i].path != NULL; i++) {
|
||||
+ int fd = -1;
|
||||
errno = 0;
|
||||
- if ((tpm_device_nodes[i].fd = open(tpm_device_nodes[i].path, O_RDWR)) < 0)
|
||||
+
|
||||
+ if (tpm_device_nodes[i].type == TDDL_TYPE_FILE)
|
||||
+ fd = open(tpm_device_nodes[i].path, O_RDWR);
|
||||
+ else if (tpm_device_nodes[i].type == TDDL_TYPE_SOCKET) {
|
||||
+ struct sockaddr_un addr;
|
||||
+
|
||||
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
+ if (fd >= 0) {
|
||||
+ addr.sun_family = AF_UNIX;
|
||||
+ strncpy(addr.sun_path, tpm_device_nodes[i].path,
|
||||
+ sizeof(addr.sun_path));
|
||||
+ if (connect(fd, (void *)&addr, sizeof(addr)) < 0) {
|
||||
+ close(fd);
|
||||
+ fd = -1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (fd < 0)
|
||||
continue;
|
||||
-
|
||||
+ tpm_device_nodes[i].fd = fd;
|
||||
opened_device = &(tpm_device_nodes[i]);
|
||||
- return opened_device->fd;
|
||||
+ return fd;
|
||||
}
|
||||
|
||||
return -1;
|
||||
--- trousers-0.3.1/src/include/tddl.h~ 2005-10-25 04:01:07.000000000 +0100
|
||||
+++ trousers-0.3.1/src/include/tddl.h 2008-09-27 10:00:20.000000000 +0100
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
struct tpm_device_node {
|
||||
char *path;
|
||||
+#define TDDL_TYPE_FILE 1
|
||||
+#define TDDL_TYPE_SOCKET 2
|
||||
+ int type;
|
||||
#define TDDL_TRANSMIT_IOCTL 1
|
||||
#define TDDL_TRANSMIT_RW 2
|
||||
int transmit;
|
@ -1,66 +0,0 @@
|
||||
diff -urp trousers-0.3.4.orig/src/tspi/tspi_seal.c trousers-0.3.4/src/tspi/tspi_seal.c
|
||||
--- trousers-0.3.4.orig/src/tspi/tspi_seal.c 2010-02-08 09:34:52.000000000 -0500
|
||||
+++ trousers-0.3.4/src/tspi/tspi_seal.c 2010-02-08 09:35:25.000000000 -0500
|
||||
@@ -42,7 +42,7 @@ Tspi_Data_Seal(TSS_HENCDATA hEncData, /*
|
||||
TCS_KEY_HANDLE tcsKeyHandle;
|
||||
TSS_HCONTEXT tspContext;
|
||||
Trspi_HashCtx hashCtx;
|
||||
- BYTE *sealData;
|
||||
+ BYTE *sealData = NULL;
|
||||
struct authsess *xsap = NULL;
|
||||
#ifdef TSS_BUILD_SEALX
|
||||
UINT32 protectMode;
|
||||
@@ -91,13 +91,12 @@ Tspi_Data_Seal(TSS_HENCDATA hEncData, /*
|
||||
|
||||
if ((result = authsess_xsap_init(tspContext, hEncKey, hEncData, TSS_AUTH_POLICY_REQUIRED,
|
||||
sealOrdinal, TPM_ET_KEYHANDLE, &xsap)))
|
||||
- return result;
|
||||
+ goto error;
|
||||
|
||||
#ifdef TSS_BUILD_SEALX
|
||||
if (sealOrdinal == TPM_ORD_Seal)
|
||||
sealData = rgbDataToSeal;
|
||||
else {
|
||||
- sealData = NULL;
|
||||
if ((sealData = (BYTE *)calloc(1, ulDataLength)) == NULL) {
|
||||
LogError("malloc of %u bytes failed", ulDataLength);
|
||||
result = TSPERR(TSS_E_OUTOFMEMORY);
|
||||
@@ -128,8 +127,6 @@ Tspi_Data_Seal(TSS_HENCDATA hEncData, /*
|
||||
result |= Trspi_Hash_UINT32(&hashCtx, ulDataLength);
|
||||
result |= Trspi_HashUpdate(&hashCtx, ulDataLength, sealData);
|
||||
if ((result |= Trspi_HashFinal(&hashCtx, digest.digest))) {
|
||||
- if (sealData != rgbDataToSeal)
|
||||
- free(sealData);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -142,15 +139,14 @@ Tspi_Data_Seal(TSS_HENCDATA hEncData, /*
|
||||
pcrDataSize, pcrData, ulDataLength,
|
||||
sealData, xsap->pAuth, &encDataSize,
|
||||
&encData))) {
|
||||
- free(sealData);
|
||||
- return result;
|
||||
+ goto error;
|
||||
}
|
||||
} else if (sealOrdinal == TPM_ORD_Sealx) {
|
||||
- result = TCS_API(tspContext)->Sealx(tspContext, tcsKeyHandle, &xsap->encAuthUse,
|
||||
+ if ((result = TCS_API(tspContext)->Sealx(tspContext, tcsKeyHandle, &xsap->encAuthUse,
|
||||
pcrDataSize, pcrData, ulDataLength, sealData,
|
||||
- xsap->pAuth, &encDataSize, &encData);
|
||||
- if (result != TSS_SUCCESS)
|
||||
+ xsap->pAuth, &encDataSize, &encData))) {
|
||||
goto error;
|
||||
+ }
|
||||
} else {
|
||||
result = TSPERR(TSS_E_INTERNAL_ERROR);
|
||||
goto error;
|
||||
@@ -183,7 +179,8 @@ error:
|
||||
authsess_free(xsap);
|
||||
free(encData);
|
||||
free(pcrData);
|
||||
- free(sealData);
|
||||
+ if (sealData != rgbDataToSeal)
|
||||
+ free(sealData);
|
||||
return result;
|
||||
}
|
||||
|
12
trousers-no-werror.patch
Normal file
12
trousers-no-werror.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -ur trousers-0.3.6.orig/configure trousers-0.3.6/configure
|
||||
--- trousers-0.3.6.orig/configure 2011-04-08 09:09:38.000000000 -0400
|
||||
+++ trousers-0.3.6/configure 2011-04-08 09:41:49.000000000 -0400
|
||||
@@ -14379,7 +14379,7 @@
|
||||
|
||||
|
||||
if test "x${GCC}" = "xyes"; then
|
||||
- CFLAGS="$CFLAGS -W -Wall -Werror -Wno-unused-parameter -Wsign-compare"
|
||||
+ CFLAGS="$CFLAGS -W -Wall -Wno-unused-parameter -Wsign-compare"
|
||||
fi
|
||||
|
||||
CFLAGS="$CFLAGS -I../include \
|
@ -8,8 +8,11 @@ Url: http://trousers.sourceforge.net
|
||||
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
|
||||
# Patch init script to conform to our guidelines
|
||||
Patch1: trousers-init.patch
|
||||
# We have newer compiler which has new warnings
|
||||
Patch2: trousers-no-werror.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: libtool, openssl-devel
|
||||
BuildRequires: autoconf
|
||||
Requires(pre): shadow-utils
|
||||
Requires(post): chkconfig
|
||||
Requires(preun): chkconfig
|
||||
@ -46,10 +49,13 @@ applications.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p0
|
||||
%patch2 -p1
|
||||
|
||||
sed -i -e 's|/var/tpm|/var/lib/tpm|g' -e 's|/usr/local/var|/var|g' man/man5/tcsd.conf.5.in man/man8/tcsd.8.in
|
||||
autoconf
|
||||
|
||||
%build
|
||||
# fix man page paths
|
||||
sed -i -e 's|/var/tpm|/var/lib/tpm|g' -e 's|/usr/local/var|/var|g' man/man5/tcsd.conf.5.in man/man8/tcsd.8.in
|
||||
%configure --with-gui=openssl
|
||||
make -k %{?_smp_mflags}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user