Add keymat_t constructor registration function
Using the register_constructor function enables custom keymat_t implementations per IKE version. If no constructor is registered the default behavior is preserved.
This commit is contained in:
committed by
Tobias Brunner
parent
0810286269
commit
acf27437cd
@@ -31,6 +31,14 @@ typedef struct keymat_t keymat_t;
|
||||
#include <config/peer_cfg.h>
|
||||
#include <sa/ike_sa_id.h>
|
||||
|
||||
/**
|
||||
* Constructor function for custom keymat implementations
|
||||
*
|
||||
* @param initiator TRUE if the keymat is used as initiator
|
||||
* @return keymat_t implementation
|
||||
*/
|
||||
typedef keymat_t* (*keymat_constructor_t)(bool initiator);
|
||||
|
||||
/**
|
||||
* Derivation an management of sensitive keying material.
|
||||
*/
|
||||
@@ -110,4 +118,13 @@ int keymat_get_keylen_encr(encryption_algorithm_t alg);
|
||||
*/
|
||||
int keymat_get_keylen_integ(integrity_algorithm_t alg);
|
||||
|
||||
/**
|
||||
* Register keymat_t constructor for given IKE version.
|
||||
*
|
||||
* @param version IKE version of given keymat constructor
|
||||
* @param create keymat constructor function, NULL to unregister
|
||||
*/
|
||||
void keymat_register_constructor(ike_version_t version,
|
||||
keymat_constructor_t create);
|
||||
|
||||
#endif /** KEYMAT_H_ @}*/
|
||||
|
||||
Reference in New Issue
Block a user