mirror of
https://github.com/strongswan/strongswan.git
synced 2025-12-08 00:00:29 -05:00
keymat: Add AUTH payload setter/getter functions
These functions are used in the TKM specific bus listener to store/retrieve the AUTH payload chunk in the message/authorize hooks.
This commit is contained in:
parent
d0ce4116b0
commit
071e792a85
@ -66,6 +66,11 @@ struct private_tkm_keymat_t {
|
|||||||
*/
|
*/
|
||||||
ae_id_type ae_ctx_id;
|
ae_id_type ae_ctx_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AUTH payload chunk.
|
||||||
|
*/
|
||||||
|
chunk_t auth_payload;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -352,6 +357,7 @@ METHOD(keymat_t, destroy, void,
|
|||||||
|
|
||||||
DESTROY_IF(this->aead_in);
|
DESTROY_IF(this->aead_in);
|
||||||
DESTROY_IF(this->aead_out);
|
DESTROY_IF(this->aead_out);
|
||||||
|
chunk_free(&this->auth_payload);
|
||||||
this->proxy->keymat.destroy(&this->proxy->keymat);
|
this->proxy->keymat.destroy(&this->proxy->keymat);
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
@ -362,6 +368,18 @@ METHOD(tkm_keymat_t, get_isa_id, isa_id_type,
|
|||||||
return this->isa_ctx_id;
|
return this->isa_ctx_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(tkm_keymat_t, set_auth_payload, void,
|
||||||
|
private_tkm_keymat_t *this, const chunk_t * const payload)
|
||||||
|
{
|
||||||
|
this->auth_payload = chunk_clone(*payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(tkm_keymat_t, get_auth_payload, chunk_t*,
|
||||||
|
private_tkm_keymat_t *this)
|
||||||
|
{
|
||||||
|
return &this->auth_payload;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See header.
|
* See header.
|
||||||
*/
|
*/
|
||||||
@ -384,10 +402,13 @@ tkm_keymat_t *tkm_keymat_create(bool initiator)
|
|||||||
.get_auth_octets = _get_auth_octets,
|
.get_auth_octets = _get_auth_octets,
|
||||||
.get_psk_sig = _get_psk_sig,
|
.get_psk_sig = _get_psk_sig,
|
||||||
.get_isa_id = _get_isa_id,
|
.get_isa_id = _get_isa_id,
|
||||||
|
.set_auth_payload = _set_auth_payload,
|
||||||
|
.get_auth_payload = _get_auth_payload,
|
||||||
},
|
},
|
||||||
.initiator = initiator,
|
.initiator = initiator,
|
||||||
.isa_ctx_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_ISA),
|
.isa_ctx_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_ISA),
|
||||||
.ae_ctx_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_AE),
|
.ae_ctx_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_AE),
|
||||||
|
.auth_payload = chunk_empty,
|
||||||
.proxy = keymat_v2_create(initiator),
|
.proxy = keymat_v2_create(initiator),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -114,6 +114,20 @@ struct tkm_keymat_t {
|
|||||||
*/
|
*/
|
||||||
isa_id_type (*get_isa_id)(tkm_keymat_t * const this);
|
isa_id_type (*get_isa_id)(tkm_keymat_t * const this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set IKE AUTH payload.
|
||||||
|
*
|
||||||
|
* @param payload AUTH payload
|
||||||
|
*/
|
||||||
|
void (*set_auth_payload)(tkm_keymat_t *this, const chunk_t * const payload);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get IKE AUTH payload.
|
||||||
|
*
|
||||||
|
* @return AUTH payload if set, chunk_empty otherwise
|
||||||
|
*/
|
||||||
|
chunk_t* (*get_auth_payload)(tkm_keymat_t * const this);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user