open ssl memory leak?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

open ssl memory leak?

Chong Peng
dear all:

i have a ssl server running in an embedded system on top of vxworks operating system. the ssl server is based on teamf1's ssecure lib (this lib, of course, is based on openssl, i believe is 0.9.7). i was using a linux machine as ssl client to connect to my ssl server and close the connection right away. after each connect/close, i then use vxworks command "memPartShow" to check the mem partition "cryptoMemPartId", it appears that i lost exactly 400bytes per connection/close (because the alloced mem from this cmd increase exactly 400 bytes every connect/close). eventually, the system will give me "memPartAlloc: block too big" error. after the error, i cannot setup an ssl connection with the server anymore.
in my code, to close a ssl connection, i made three calls (in this sequence):
        SSL_shutdown(ssl);
        SSL_free(ssl);
        close(socket);
i used to think this may related to the session cache, but after i read the document and check my code carefully, i do not enable session cache specifically (i believe it should be disabled by default). even if i use "SSL_CTX_set_timeout(ctx, 1);" to set the ctx timeout to 1 sec right after the ctx is created, i still have this problem.
do i miss anything here? does anybody here have anu idea what is going on? thanks in advance.
chong peng

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: open ssl memory leak?

Marek.Marcola
Hello,

If Your application is multithreaded you should free
the error queue. For current thread just add line:
        ERR_remove_state(0);
More information:
        http://www.openssl.org/docs/crypto/ERR_remove_state.html#

Best regards,
--
Marek Marcola <[hidden email]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

BIO Vs non-BIO

vipin rathor

hi people,
  can someone tell me that what is the difference between using BIO and non-BIO calls??? and also, what r the situations that justifies the usage of these calls???
 
Thanks in advance,

 


"Most people are only alive because it is illegal to
shoot them."

- rathor vipin


New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
Reply | Threaded
Open this post in threaded view
|

Re: BIO Vs non-BIO

Manuel Arguelles
It's all about what you want to do, for example I use libssl to read and write
data from encrypted files... for that case BIO is excellent because it let me
write and read from the encrypted file getting plain text from each read, and
encrypted text for each write

this can also be used with sockets... so it's all about what you are trying to
do...

good luck
 
On Mon 27 Mar 2006 07:20, vipin rathor wrote:

> hi people,
>     can someone tell me that what is the difference between using BIO and
> non-BIO calls??? and also, what r the situations that justifies the usage
> of these calls???
>
>   Thanks in advance,
>
>
>
>
> "Most people are only alive because it is illegal to
> shoot them."
>
>   - rathor vipin
>
>
> ---------------------------------
> New Yahoo! Messenger with Voice. Call regular phones from your PC and save
> big.

--
Manuel Arg├╝elles
Software Engineer
Wireless ZT
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]