[Net-ssleay-devel] Testers for svn trunk, please.

On Tue, Aug 01, 2006 at 08:56:50AM +1000, Mike McCauley wrote:
> Hello Florian,
>> On Tuesday 01 August 2006 07:29, Florian Ragwitz wrote:
> > On Fri, Jul 28, 2006 at 12:13:13PM +1000, Mike McCauley wrote:
> > > Hello Florian,
> > >
> > > Found a fix for this problem on Windows by using OPENSSL_free() instead
> > > of free() to free the memory allocated by openssl in X509_NAME_oneline.
> > >
> > > During the process I have also fixed a number of cases in SSLeay.xs where
> > > malloc/free was used instead of New/Safefree
> > >
> > > I have committed these changes to svn
> >
> > Thanksgreat work.The only thing I don't like is the fact that you
> > reverted some of my changes to the testsuite which check if set_{r,w,}fd
> > works on filehandles as well as on filenos. How about implementing the
> > same thing I did on unix on windows? Probably everything that needs to
> > be done is to change the signature of the XSUBs to use perl_filehandle_t
> > instead of int.
>> OK, I didnt realise your intentions there. Now fixed, so it works with
> filehandles and filenos on Windows too. Committed.
You++!
I'd also like to see those get_fd methods fixed on windows. I read some
comments that they can't be implemented properly on win32, but I really
doubt that's true. Could you please take a look?
> > > There is one malloc() left in ssleay_ctx_passwd_cb_new, but there does
> > > not seem to be a matching free(). Is that your intention?
> >
> > The free is in SSL_CTX_set_default_passwd_cb. Unfortunately it only
> > works properly if one sets a callback function to undef or something
> > false first and then re-sets it again to the new callback. I hope to be
> > able to fix that tomorrow.
I now properly decrement the reference counts of the default_passwd cb
and userdata when setting a new one and another cb/userdata was given
previously. Also I stoped freeing the userdata when a false or undefined
callback function has been set. Now it behaves more like older releases
of Net::SSLeay. Instead I split up ssleay_ctx_default_passwd_cb_free
function into _free_func and _free_data which are called when a false,
undefined or no callback function is given to
SSL_CTX_set_default_passwd_cb or when no userdata is given to
SSL_CTX_set_default_passwd_cb_userdata, respectively.
I think this still isn't enough to free all memory which can be freed
under all circumstances. I think we will also need to hook into SSL_free
and SSL_CTX_free to clean up the static HV pointers which store the
association between the callbacks and the ssl_ctx/ssl pointers.
What do you think?
-Flo
--
BOFH excuse #189:
SCSI's too wide.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/net-ssleay-devel/attachments/20060801/b9206fbb/attachment.pgp