[openssl-dev] Improving OpenSSL default RNG

Kurt Roeckx kurt at roeckx.be
Sat Oct 24 15:35:22 UTC 2015


On Sat, Oct 24, 2015 at 04:22:38PM +0200, Alessandro Ghedini wrote:
> 
> So at some point I'd like to
> try and make OPENSSL_malloc & co. aliases for malloc(), realloc() and free()
> and remove (or deprecate) the custom memory functions... but that's probably a
> whole different discussion.

Please note that at least on Windows you need to have a way that
malloc() and free() are called from the same dll.

> > > Additionally,
> > > this API provides thread-local storage support and "once" objects (to
> > > execute functions only once, for example for initialization).
> > 
> > I'd probably leave thread-local storage up to the application.
> 
> FWIW the ASYNC pull request [0] already uses thread-local storage, but instead
> of using the pthread API (which is probably more portable) it uses the __thread
> syntax.

__thread isn't exactly portable, the "__" should make that clear.
C11 does add support for threads, but we're still stuck at C89
with some minor extentions.

But threading libraries always have to provide a way for thread
local storage, and so pthreads provides pthread_key_create(),
Windows has TlsAlloc().


Kurt



More information about the openssl-dev mailing list