This is a multipart message in MIME format.

------=_NextPart_000_006D_01C88DD5.D985BC70
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,



I have an application that creates a bunch of SSL connections during its
life. For each of these connections, I have to store "application data" in
an SSL object (in my case this is SSL_client object). The trouble is that
the memory allocated in the SSL_get_ex_new_index is never freed until the
end of the application. I am tracking this through valgrind and can create a
simple test case if that would help, but I think my problem is simply
misusing the API.



My question is how can I use SSL_get_ex_new_index such that I can free
memory once the SSL connection closes? Should I be re-using the index
returned instead of calling the function multiple times - after all I have a
new SSL_client object each time?



I have tried setting the function pointers in the SSL_get_ex_new_index, but
for some reason the callbacks are never called. Moreover the memory leaked
is not an allocation that I have made and thus am unable to free it even if
they were called. I have made sure that I am calling all the SSL freeing
routines .. SSL_close, SSL_free etc.



Any help will be greatly appreciated. I have read the following man pages to
no avail:



http://www.openssl.org/docs/ssl/SSL_...new_index.html

http://www.openssl.org/docs/crypto/R...new_index.html

http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html



The example in the man page SSL_CTX_set_verify is more or less what I am
trying to do.



Thanks for taking the time to read through and looking forward for some
tips.



Regards,

Amit Sharma






------=_NextPart_000_006D_01C88DD5.D985BC70
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

xmlns=3D"urn:schemas-microsoft-comfficeffice" =
xmlns:w=3D"urn:schemas-microsoft-comffice:word" =
xmlns:x=3D"urn:schemas-microsoft-comffice:excel" =
xmlns=3D"urn:schemas-microsoft-comfficeowerpoint" =
xmlns:a=3D"urn:schemas-microsoft-comffice:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-comfficeublisher" =
xmlns:ss=3D"urn:schemas-microsoft-comffice:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-comffice:component:spreadsheet" =
xmlnsa=3D"urn:schemas-microsoft-comffice:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" xmlns=3D"DAV:" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/xml" =
xmlnsis=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/directory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/"=
xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/workflow/" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compatibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/2006/relationshi=
ps" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/services/2006/types"=
=
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/services/2006/messag=
es" xmlns=3D"http://www.w3.org/TR/REC-html40">


charset=3Dus-ascii">









Hi,>>



>



I have an application that creates a bunch of SSL
connections during its life. For each of these connections, I have to =
store “application
data” in an SSL object (in my case this is SSL_client object). =
 The
trouble is that the memory allocated in the SSL_get_ex_new_index is =
never freed
until the end of the application. I am tracking this through valgrind =
and can
create a simple test case if that would help, but I think my problem is =
simply
misusing the API.>>



>



My question is how can I use SSL_get_ex_new_index =
such that
I can free memory once the SSL connection closes? Should I be re-using =
the
index returned instead of calling the function multiple times – =
after all
I have a new SSL_client object each time? >>



>



I have tried setting the function pointers in the =
SSL_get_ex_new_index,
but for some reason the callbacks are never called. Moreover the memory =
leaked
is not an allocation that I have made and thus am unable to free it even =
if
they were called. I have made sure that I am calling all the SSL freeing
routines .. SSL_close, SSL_free etc.>>



>



Any help will be greatly appreciated. I have read =
the following
man pages to no avail:>>



>



href=3D"http://www.openssl.org/docs/ssl/SSL_get_ex_new_index.html">http:/=
/www.openssl.org/docs/ssl/SSL_get_ex_new_index.html>>



href=3D"http://www.openssl.org/docs/crypto/RSA_get_ex_new_index.html">htt=
p://www.openssl.org/docs/crypto/RSA_get_ex_new_index.html>><=
/p>

href=3D"http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html">http://w=
ww.openssl.org/docs/ssl/SSL_CTX_set_verify.html>>



>



The example in the man page SSL_CTX_set_verify is =
more or
less what I am trying to do.>>



>



Thanks for taking the time to read through and =
looking
forward for some tips.>>



>



Regards,>>



Amit Sharma>>



>



>









------=_NextPart_000_006D_01C88DD5.D985BC70--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org