I've written some ATL COM classes using OpenSSL (not a complete COM wrapper for 
OpenSSL!) and want to share the following recomendations:
1) Use ATL if possible. MFC COM objects require a lot of tweaking for working 
correctly with ASP. If you want to use ATL, choose the Simple Object, not the ASP 
Object in the wizard.
2) Memory leaks - please check them carefully (using some tool like NuMega DevPartner 
Studio). Some huge memory leaks will be left if your program creates a PKCS#7 object, 
for instance, and forgets to destroy it. So design a wrapper that destroy all these 
structures automatically if possible. Remember, COM wrappers are for VB/ASP (maybe 
Delphi) programmers, and must be easy to use.
3) Please don't forget to call CRYPTO_set_locking_callback
(an example is given in crypto\threads\th-lock.c). It helps to alleviate threading 
issues.
4) Put some code in DllMain /DLL_PROCESS_ATTACH, DLL_PROCESS_DETACH, DLL_THREAD_ATTACH 
and DLL_THREAD_DETACH that handles the correct initialization/finalization of OpenSSL 
for processes and threads. Remove the DisableThreadLibraryCalls that is generated by 
the ATL COM Wizard.
5) From the ATL 101 classes: ASP is VBScript/JScript (maybe PerlScript ;-) and ByRef 
parameters for your parameters must be Variant. Binary data is better handled as a 
Byte Array, not a String (Unicode issues etc.). 

----- Original Message ----- 
From: Colin Chalmers 
To: [EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2000 4:56 AM
Subject: Re: thread safety


jinwon,

I too was considering making a COM wrapper for openssl but have not got round to 
starting it yet (and I believe I'm not the only one).
Would you be willing to share your code when finished or that we perhaps share some 
tasks/work to even the load?

/colin chalmers 
----- Original Message ----- 
From: jinwon jang 
To: [EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2000 1:20 AM
Subject: thread safety


Hello,

I'm planning to use openssl as a library that will be used with other application such 
as COM object on windows NT4.0 and windows 2000 platforms. And the COM object is 
called from ASP(Active Server Page) pages. 
 
I'd like to confirm whether openssl is thread safe with MS windows NT and windows2000. 
Since ASP is multi-threaded environment, it is not good enough to use thread-safe COM 
object without thread safety of openssl.

Thanks,

jinwon jang


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to