Add create_nonce_gen function to keymat interface

This function returns a nonce generator object.
This commit is contained in:
Adrian-Ken Rueegsegger
2012-05-18 08:15:41 +02:00
committed by Tobias Brunner
parent 04024b5de8
commit 5338fe5e79
3 changed files with 24 additions and 0 deletions
+7
View File
@@ -985,6 +985,12 @@ METHOD(keymat_t, create_dh, diffie_hellman_t*,
return lib->crypto->create_dh(lib->crypto, group);
}
METHOD(keymat_t, create_nonce_gen, nonce_gen_t*,
private_keymat_v1_t *this)
{
return lib->crypto->create_nonce_gen(lib->crypto);
}
METHOD(keymat_t, get_aead, aead_t*,
private_keymat_v1_t *this, bool in)
{
@@ -1019,6 +1025,7 @@ keymat_v1_t *keymat_v1_create(bool initiator)
.keymat = {
.get_version = _get_version,
.create_dh = _create_dh,
.create_nonce_gen = _create_nonce_gen,
.get_aead = _get_aead,
.destroy = _destroy,
},
+7
View File
@@ -83,6 +83,12 @@ METHOD(keymat_t, create_dh, diffie_hellman_t*,
return lib->crypto->create_dh(lib->crypto, group);
}
METHOD(keymat_t, create_nonce_gen, nonce_gen_t*,
private_keymat_v2_t *this)
{
return lib->crypto->create_nonce_gen(lib->crypto);
}
/**
* Derive IKE keys for a combined AEAD algorithm
*/
@@ -571,6 +577,7 @@ keymat_v2_t *keymat_v2_create(bool initiator)
.keymat = {
.get_version = _get_version,
.create_dh = _create_dh,
.create_nonce_gen = _create_nonce_gen,
.get_aead = _get_aead,
.destroy = _destroy,
},
+10
View File
@@ -61,6 +61,16 @@ struct keymat_t {
diffie_hellman_t* (*create_dh)(keymat_t *this,
diffie_hellman_group_t group);
/**
* Create a nonce generator object.
*
* The nonce generator can be used to create nonces needed during IKE/CHILD
* SA establishment or rekeying.
*
* @return nonce generator object
*/
nonce_gen_t* (*create_nonce_gen)(keymat_t *this);
/*
* Get a AEAD transform to en-/decrypt and sign/verify IKE messages.
*