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
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