Added a keymat_t version to cast it safely

This commit is contained in:
Martin Willi
2012-03-20 17:31:30 +01:00
parent 3d54ae94d9
commit 3bacc1f429
3 changed files with 21 additions and 0 deletions
+7
View File
@@ -71,6 +71,12 @@ struct private_keymat_v2_t {
chunk_t skp_verify;
};
METHOD(keymat_t, get_version, ike_version_t,
private_keymat_v2_t *this)
{
return IKEV2;
}
METHOD(keymat_t, create_dh, diffie_hellman_t*,
private_keymat_v2_t *this, diffie_hellman_group_t group)
{
@@ -563,6 +569,7 @@ keymat_v2_t *keymat_v2_create(bool initiator)
INIT(this,
.public = {
.keymat = {
.get_version = _get_version,
.create_dh = _create_dh,
.get_aead = _get_aead,
.destroy = _destroy,