[openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2014-06-28 Thread Rich Salz via RT
I think the thing to do is pthread_once (and its equivalent on Windows) for
these global init functions.
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


Re: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2014-06-28 Thread Erik Forsberg
What would be the best equivalent yo pthread_once on Windows ?
I was once looking for one, and back then, years ago, I didnt like the choices.

-- Original Message --

I think the thing to do is pthread_once (and its equivalent on Windows) for
these global init functions.
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


RE: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2014-06-28 Thread Salz, Rich
 From: owner-openssl-...@openssl.org [mailto:owner-openssl-...@openssl.org] On 
 Behalf Of Erik Forsberg

 What would be the best equivalent yo pthread_once on Windows ?
 I was once looking for one, and back then, years ago, I didnt like the 
 choices.

Perhaps http://msdn.microsoft.com/en-us/library/aa363808%28v=VS.85%29.aspx ?

--  
Principal Security Engineer
Akamai Technologies, Cambridge, MA
IM: rs...@jabber.me; Twitter: RichSalz


__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


RE: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2014-06-28 Thread Salz, Rich via RT
 From: owner-openssl-...@openssl.org [mailto:owner-openssl-...@openssl.org] On 
 Behalf Of Erik Forsberg

 What would be the best equivalent yo pthread_once on Windows ?
 I was once looking for one, and back then, years ago, I didnt like the 
 choices.

Perhaps http://msdn.microsoft.com/en-us/library/aa363808%28v=VS.85%29.aspx ?

--  
Principal Security Engineer
Akamai Technologies, Cambridge, MA
IM: rs...@jabber.me; Twitter: RichSalz



__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


RE: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2014-06-28 Thread Erik Forsberg
yes, today I would use that one. Back then, XP was required, an this function
was only in Vista and Server 2008.
Thanks for reminding me -:)

-- Original Message --

 From: owner-openssl-...@openssl.org [mailto:owner-openssl-...@openssl.org] 
 On Behalf Of Erik Forsberg

 What would be the best equivalent yo pthread_once on Windows ?
 I was once looking for one, and back then, years ago, I didnt like the 
 choices.

Perhaps http://msdn.microsoft.com/en-us/library/aa363808%28v=VS.85%29.aspx ?

--  
Principal Security Engineer
Akamai Technologies, Cambridge, MA
IM: rs...@jabber.me; Twitter: RichSalz



__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


[openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2002-05-17 Thread


Hi:

I´m having ugly crashes in Win32 when I call several times 
OpenSSL_add_all_algoritms(), mainly when I use my C code from Visual Basic but also if 
I use several DLLs.
The problem comes up if I call that funcion from several C DLLs to initialize library.
I think that it would be useful to have an static variable inside   
OpenSSL_add_all_algoritms(), in such a way initialized that only one time the 
initialize is made.This way , no matter how many times from no matter which other DLLs 
I call the function it only gets initialized one time.
In short way, to use a singleton.

I have debugged my code a lot, used purify...etc and I think the problem is not in 
OpenSSL or my C code (is working under heavy pressure in other programs),but in the 
extrange things with COM apartments and threads, and I suppose this change in library 
would not break compatibility much.

It would be possible such a change or similar?.If you know another solution I would 
like to hear...

Thank you

Pablo J. Royo


__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2002-05-17 Thread Jeffrey Altman

Are you sure your problem is in OpenSSL_add_all_algorithms() and not a
call to RAND_poll()?  Many of the methods used in RAND_poll() to
collect random data are incompatible with COM when called from within
DLL initializers.

 
 Hi:
 
 I´m having ugly crashes in Win32 when I call several times 
OpenSSL_add_all_algoritms(), mainly when I use my C code from Visual Basic but also 
if I use several DLLs.
 The problem comes up if I call that funcion from several C DLLs to initialize 
library.
 I think that it would be useful to have an static variable inside   
OpenSSL_add_all_algoritms(), in such a way initialized that only one time the 
initialize is made.This way , no matter how many times from no matter which other 
DLLs I call the function it only gets initialized one time.
 In short way, to use a singleton.
 
 I have debugged my code a lot, used purify...etc and I think the problem is not in 
OpenSSL or my C code (is working under heavy pressure in other programs),but in the 
extrange things with COM apartments and threads, and I suppose this change in library 
would not break compatibility much.
 
 It would be possible such a change or similar?.If you know another solution I would 
like to hear...
 
 Thank you
 
 Pablo J. Royo
 
 
 __
 OpenSSL Project http://www.openssl.org
 Development Mailing List   [EMAIL PROTECTED]
 Automated List Manager   [EMAIL PROTECTED]
 



 Jeffrey Altman * Sr.Software Designer  Kermit 95 1.1.21  available now!!!
 The Kermit Project @ Columbia University   SSH plus Telnet, FTP and HTTP
 http://www.kermit-project.org/ secured with Kerberos, SRP, and 
 [EMAIL PROTECTED]OpenSSL.
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2002-05-17 Thread ZAZ - Pablo Royo Moreno


Hi Jeffrey:

Are you sure your problem is in OpenSSL_add_all_algorithms() and not a
call to RAND_poll()?  Many of the methods used in RAND_poll() to
collect random data are incompatible with COM when called from within
DLL initializers.

Yes, I have seen it to happen several times in my debugger.I have the problematic code 
inside a try-catch and I see clearly an exception delivered when execution reaches 
OpenSSL_add_all_algoritms().
And it isn't the first time this happens to me.Other program I made had a very similar 
problem (also using COM ) but that time I fixed moving my calls to OpenSSL_add... to 
be called only one time.
 
I would like to give you a piece of this code, but the calls are so nested and in so 
many places that it woldn't be useful.

I wonder it there would be a method to select only desired ciphers and digests 
(OpenSLL_add_all_algoritms() would be excessive) in DLLEntryPoint(), called at loading 
program only one time.
 
Thank you
 
 Pablo J. Royo
 
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2002-05-17 Thread Jeffrey Altman

Take a look at the source code for OpenSSL_add_all_algorithms().  For
each cipher there is a block of code to initialize it.  Simply
initialize the ones you want in your code.  There is no requirement
that OpenSSL_add_all_algorithms() be called.

Although, I would be interested in where the exception is being
generated.  Since you are in a debugger, can you present the stack
trace for libeay32.dll when built with debug info?




 Hi Jeffrey:
 
 Are you sure your problem is in OpenSSL_add_all_algorithms() and not a
 call to RAND_poll()?  Many of the methods used in RAND_poll() to
 collect random data are incompatible with COM when called from within
 DLL initializers.
 
 Yes, I have seen it to happen several times in my debugger.I have the problematic 
code inside a try-catch and I see clearly an exception delivered when execution 
reaches OpenSSL_add_all_algoritms().
 And it isn't the first time this happens to me.Other program I made had a very 
similar problem (also using COM ) but that time I fixed moving my calls to 
OpenSSL_add... to be called only one time.
  
 I would like to give you a piece of this code, but the calls are so nested and in so 
many places that it woldn't be useful.
 
 I wonder it there would be a method to select only desired ciphers and digests 
(OpenSLL_add_all_algoritms() would be excessive) in DLLEntryPoint(), called at 
loading program only one time.
  
 Thank you
  
  Pablo J. Royo
  
 __
 OpenSSL Project http://www.openssl.org
 Development Mailing List   [EMAIL PROTECTED]
 Automated List Manager   [EMAIL PROTECTED]
 



 Jeffrey Altman * Sr.Software Designer  Kermit 95 1.1.21  available now!!!
 The Kermit Project @ Columbia University   SSH plus Telnet, FTP and HTTP
 http://www.kermit-project.org/ secured with Kerberos, SRP, and 
 [EMAIL PROTECTED]OpenSSL.
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: [openssl.org #44] OpenSSL_add_all_algorithms problems in Win32

2002-05-17 Thread ZAZ - Pablo Royo Moreno


Hi:

Take a look at the source code for OpenSSL_add_all_algorithms().  For
each cipher there is a block of code to initialize it.  Simply
initialize the ones you want in your code.  There is no requirement
that OpenSSL_add_all_algorithms() be called.

The problem is that as this are COMponents I can't to know from where they will be 
called, so althought I put a single cipher initialization in one place of my code, 
some other component can also to initialize the same cipher in other place and then 
the problem remains.For example, I have a component to do signing and other to do 
SSL.And both must do some kind of algorithm initialization, because they can also be 
called separatedly (sorry for my english,I mean they can be called alone).
So its very difficult to know if you have put too much initializations or not.  

Although, I would be interested in where the exception is being
generated.  Since you are in a debugger, can you present the stack
trace for libeay32.dll when built with debug info?

I will try it on Monday again.But what I see is only a lot of hex addresses and no 
back trace.It is as if crash had corrupted also the stack.I don't know...The variables 
and all seems OK just one step before the OpenSSL_add_all_algoritms().

thanks again

Pablo J. Royo
 

__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]