Add create_nonce_gen function to keymat interface
This function returns a nonce generator object.
This commit is contained in:
committed by
Tobias Brunner
parent
04024b5de8
commit
5338fe5e79
@@ -985,6 +985,12 @@ METHOD(keymat_t, create_dh, diffie_hellman_t*,
|
|||||||
return lib->crypto->create_dh(lib->crypto, group);
|
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*,
|
METHOD(keymat_t, get_aead, aead_t*,
|
||||||
private_keymat_v1_t *this, bool in)
|
private_keymat_v1_t *this, bool in)
|
||||||
{
|
{
|
||||||
@@ -1019,6 +1025,7 @@ keymat_v1_t *keymat_v1_create(bool initiator)
|
|||||||
.keymat = {
|
.keymat = {
|
||||||
.get_version = _get_version,
|
.get_version = _get_version,
|
||||||
.create_dh = _create_dh,
|
.create_dh = _create_dh,
|
||||||
|
.create_nonce_gen = _create_nonce_gen,
|
||||||
.get_aead = _get_aead,
|
.get_aead = _get_aead,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ METHOD(keymat_t, create_dh, diffie_hellman_t*,
|
|||||||
return lib->crypto->create_dh(lib->crypto, group);
|
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
|
* Derive IKE keys for a combined AEAD algorithm
|
||||||
*/
|
*/
|
||||||
@@ -571,6 +577,7 @@ keymat_v2_t *keymat_v2_create(bool initiator)
|
|||||||
.keymat = {
|
.keymat = {
|
||||||
.get_version = _get_version,
|
.get_version = _get_version,
|
||||||
.create_dh = _create_dh,
|
.create_dh = _create_dh,
|
||||||
|
.create_nonce_gen = _create_nonce_gen,
|
||||||
.get_aead = _get_aead,
|
.get_aead = _get_aead,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -61,6 +61,16 @@ struct keymat_t {
|
|||||||
diffie_hellman_t* (*create_dh)(keymat_t *this,
|
diffie_hellman_t* (*create_dh)(keymat_t *this,
|
||||||
diffie_hellman_group_t group);
|
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.
|
* Get a AEAD transform to en-/decrypt and sign/verify IKE messages.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user