- Fix issue freeing a data structure
This commit is contained in:
parent
c585cabe48
commit
3615e1faa8
66
trousers-0.3.4-free.patch
Normal file
66
trousers-0.3.4-free.patch
Normal file
@ -0,0 +1,66 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
%global name trousers
|
||||
%global version 0.3.4
|
||||
%global tarballrev -1
|
||||
%global release 1
|
||||
%global release 2
|
||||
|
||||
Name: %{name}
|
||||
Summary: TCG's Software Stack v1.2
|
||||
@ -11,6 +11,7 @@ License: CPL
|
||||
Group: System Environment/Libraries
|
||||
Url: http://trousers.sourceforge.net
|
||||
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
|
||||
Patch1: trousers-0.3.4-free.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: libtool, openssl-devel
|
||||
Requires(pre): shadow-utils
|
||||
@ -48,6 +49,7 @@ applications.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
%configure --with-gui=openssl
|
||||
@ -113,6 +115,9 @@ fi
|
||||
%{_libdir}/libtddl.a
|
||||
|
||||
%changelog
|
||||
* Mon Feb 08 2010 Steve Grubb <sgrubb@redhat.com> 0.3.4-2
|
||||
- Fix issue freeing a data structure
|
||||
|
||||
* Fri Jan 29 2010 Steve Grubb <sgrubb@redhat.com> 0.3.4-1
|
||||
- New upstream bug fix release
|
||||
- Upstream requested the tpm-emulator patch be dropped
|
||||
|
||||
Loading…
Reference in New Issue
Block a user