mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
Add ISA context id getter to TKM keymat
This commit is contained in:
parent
cdd4d73ff5
commit
d91acfdb5d
@ -356,6 +356,12 @@ METHOD(keymat_t, destroy, void,
|
||||
free(this);
|
||||
}
|
||||
|
||||
METHOD(tkm_keymat_t, get_isa_id, isa_id_type,
|
||||
private_tkm_keymat_t *this)
|
||||
{
|
||||
return this->isa_ctx_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* See header.
|
||||
*/
|
||||
@ -377,6 +383,7 @@ tkm_keymat_t *tkm_keymat_create(bool initiator)
|
||||
.get_skd = _get_skd,
|
||||
.get_auth_octets = _get_auth_octets,
|
||||
.get_psk_sig = _get_psk_sig,
|
||||
.get_isa_id = _get_isa_id,
|
||||
},
|
||||
.initiator = initiator,
|
||||
.isa_ctx_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_ISA),
|
||||
|
@ -106,6 +106,14 @@ struct tkm_keymat_t {
|
||||
bool (*get_psk_sig)(tkm_keymat_t *this, bool verify, chunk_t ike_sa_init,
|
||||
chunk_t nonce, chunk_t secret,
|
||||
identification_t *id, char reserved[3], chunk_t *sig);
|
||||
|
||||
/**
|
||||
* Get ISA context id.
|
||||
*
|
||||
* @return id of associated ISA context.
|
||||
*/
|
||||
isa_id_type (*get_isa_id)(tkm_keymat_t * const this);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -54,6 +54,7 @@ START_TEST(test_derive_ike_keys)
|
||||
|
||||
tkm_keymat_t *keymat = tkm_keymat_create(TRUE);
|
||||
fail_if(!keymat, "Unable to create keymat");
|
||||
fail_if(!keymat->get_isa_id(keymat), "Invalid ISA context id (0)");
|
||||
|
||||
chunk_t nonce;
|
||||
tkm_nonceg_t *ng = tkm_nonceg_create();
|
||||
|
Loading…
x
Reference in New Issue
Block a user