Hi, thanks for developing openssl. It's realy a lifesaver! But sometimes it gets difficult for me to understand it. I have made my own realisation of SIGN by using functions from smime.c and encountered a big problem while testing it for memory leaks. My realisation works correctly, but when I called it for 10,000 times in one cycle I got such a run-time error: Error opening signer certificate user.cert 3075159688:error:02001018:system library:fopen:Too many open files:bss_file.c:355:fopen('user.cert','r') 3075159688:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:357: unable to load certificate
I'm using linux Ubuntu distribution and openssl-1.0.0-beta5 version. Error occured on 1020 iteration, and each iteration number of opened file descriptors and iteration number were equal. It seems to me that file descriptor that load_cert() function opens for reading certificate from file stays unclosed. I checked a link of function calls by debugging "smime sign" called from openssl command line. I use same functions in same order. And I clean everything in the end. I call "X509_free(cert);" for certificate. I load certificate like that: cert = load_cert(bio_err, signerfile, FORMAT_PEM, NULL, e, "signer certificate"); Thanks in advance for your help. I wait for reply very much, because I've already broken my brains trying to solve it.