Patch: remove REGISTER_DEFAULT_PUBKEYS in pubkey.c

haypo at inl.fr haypo at inl.fr
Thu Jul 6 14:06:09 CEST 2006


Hi again,

A new patch which looks my first one (about md.c): remove use of
"REGISTER_DEFAULT_PUBKEYS" macro (in cipher/pubkey.c).

global_init() calls _gcry_pk_init(), so I do init  pubkeys_registered_lock
and pubkeys_registered variables there. I also removed, now useless,
variable default_pubkeys_registered.

I noticed that pubkeys_registered_lock wasn't right initialized:
   static ath_mutex_t pubkeys_registered_lock;
becomes
   static ath_mutex_t pubkeys_registered_lock = ATH_MUTEX_INITIALIZER;

I don't understand how it did work before :-)

Hum, something else: this patch and my other one also add error control.
Before my patch, if _gcry_module_add() fails, BUG() was called. Now error
code is returned by _gcry_pk_init(), and so global_init() fails.

(Same) Warning: Now you have to call global_init() before calling any
function of pubkey.c ... but this was already true, isn't it?

Victor Stinner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcrypt_pubkey_register.patch
Type: text/x-diff
Size: 8009 bytes
Desc: not available
Url : /pipermail/attachments/20060706/5c0e3000/gcrypt_pubkey_register.bin


More information about the Gcrypt-devel mailing list