gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: seg fault in crypto.h code


From: Simon Josefsson
Subject: Re: seg fault in crypto.h code
Date: Mon, 28 Apr 2008 18:33:41 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

Nikos Mavrogiannopoulos <address@hidden> writes:

> Simon Josefsson wrote:
>
>> The problem I see is that libgnutls could be used by libraries, and they
>> may not be aware of each other.  Consider:
>> 
>> threaded application
>> ---> library 1
>>        -> register a crypto.h handler
>>        -> gnutls_global_init
>> ---> library 2
>>        -> register a crypto.h handler
>>        -> gnutls_global_init
>> 
>> I'm not sure what the expected behaviour should be in this situation.
>> Any crashes should be avoidable, of course, but it may be (too?)
>> surprising for library 1 to not use the crypto.h functions it
>> registered.
>
> Each one registering a handler, associates with a priority number. On
> execution time the one with lowest priority is run. In case of a
> conflict (priority number reuse or registering with higher priority than
> an existing handler) the registration will fail.

Ok.  In any case, since these interfaces are optional, as long as we
document the caveats properly, people could decide for themselves if
they are safe to use for what they are using it for.

I'm not sure many applications need to replace the crypto functions
during run-time, but I could be wrong.

>> This was my reason for doing a compile-time (rather than run-time)
>> decision via the gnulib gc-* stuff, but alas that was never finished for
>> pk/mpi.
>
> The approach I followed in pk/mpi will allow for both compile time and
> runtime decision. Once finished I'll rewrite the logic in
> hash/cipher/rnd to be similar in mind.

Great!

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]