[strongSwan-dev] aikgen idreq patch

Avesh Agarwal avesh.ncsu at gmail.com
Tue May 27 16:40:26 CEST 2014


Hello Andreas,

Thanks for your response. Please see my response inline.

On Sat, May 24, 2014 at 2:29 PM, Andreas Steffen <
andreas.steffen at strongswan.org> wrote:

> Hi Avesh,
>
> the chunk_create() function does not allocate any dynamic memory.
> It just wraps a pointer and a length into a static chunk_t object.
>
>
Then its fine.


>  identity_req = chunk_create(IdentityReq, IdentityReqLen);
>

In any case as per my understanding, the above statement should be called
inside the "if (idreq_filename)" block.


>
> THE IdentityReq structure is made available by the Trousers command
>
> result = Tspi_TPM_CollateIdentityRequest(hTPM, hSRK, hPCAKey, 0, NULL,
>                                         hIdentKey, TSS_ALG_AES,
> &IdentityReqLen, &IdentityReq);
>
> At the end of aikgen I'm freeing the complete TSS content and any
> internal memory storing IdentityReq will be released.


If I understand you correctly, then it means that the call to
Tspi_Context_FreeMemory in exit_aikgen is freeing IdentityReq. Then it
seems fine to me.

Thanks and Regards
Avesh



> Using our
> leak_detective I noticed only one small memory leak in the libtspi
> library. If I find the time I'm going to locate the leak and post a
> patch to the Trousers project.
>



>
> Best regards
>
> Andreas
>
> On 05/23/2014 09:34 PM, Avesh Agarwal wrote:
> > Hi,
> >
> > I was looking at aikgen.c implementation, and I found that that idreq
> > buffer is being created even without idreq option, it seems to be
> > leading to memory leaks. I have created a patch to address it.
> >
> > Thanks and Regards
> > Avesh
>
> ======================================================================
> Andreas Steffen                         andreas.steffen at strongswan.org
> strongSwan - the Open Source VPN Solution!          www.strongswan.org
> Institute for Internet Technologies and Applications
> University of Applied Sciences Rapperswil
> CH-8640 Rapperswil (Switzerland)
> ===========================================================[ITA-HSR]==
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/dev/attachments/20140527/70d1a32b/attachment.html>


More information about the Dev mailing list