diffie-hellman: Explicitly initialize DH exponent sizes during initialization
To avoid any race conditions when multiple threads call and initialize diffie_hellman_get_params(), explicitly examine the optimum DH exponent size during library initialization. Fixes #655.
This commit is contained in:
@@ -148,9 +148,17 @@ struct diffie_hellman_params_t {
|
||||
const chunk_t subgroup;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize diffie hellman parameters during startup.
|
||||
*/
|
||||
void diffie_hellman_init();
|
||||
|
||||
/**
|
||||
* Get the parameters associated with the specified diffie hellman group.
|
||||
*
|
||||
* Before calling this method, use diffie_hellman_init() to initialize the
|
||||
* DH group table. This is usually done by library_init().
|
||||
*
|
||||
* @param group DH group
|
||||
* @return The parameters or NULL, if the group is not supported
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user