diff options
author | Martin Willi <martin@strongswan.org> | 2006-02-14 14:52:00 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-02-14 14:52:00 +0000 |
commit | ce461bbd13c5ea6a94ba0b34cbb4d1be8159b67e (patch) | |
tree | d3ba1aa2e97e7aeb7b24163d4b8671abbeb9a7c9 /Source/charon/transforms/prfs | |
parent | 409d010131f14e551e0645e9b88ad7621d08b781 (diff) | |
download | strongswan-ce461bbd13c5ea6a94ba0b34cbb4d1be8159b67e.tar.bz2 strongswan-ce461bbd13c5ea6a94ba0b34cbb4d1be8159b67e.tar.xz |
- refactored ike proposal
- uses now proposal_t, wich is also used by child proposals
- ike key derivation refactored
- crypter_t api has get_key_size now
- some other improvements here and there
Diffstat (limited to 'Source/charon/transforms/prfs')
-rw-r--r-- | Source/charon/transforms/prfs/hmac_prf.c | 10 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf.h | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Source/charon/transforms/prfs/hmac_prf.c b/Source/charon/transforms/prfs/hmac_prf.c index af307a4d0..ce4330090 100644 --- a/Source/charon/transforms/prfs/hmac_prf.c +++ b/Source/charon/transforms/prfs/hmac_prf.c @@ -68,6 +68,15 @@ static size_t get_block_size(private_hmac_prf_t *this) } /** + * Implementation of prf_t.get_block_size. + */ +static size_t get_key_size(private_hmac_prf_t *this) +{ + /* for HMAC prfs, IKEv2 uses block size as key size */ + return this->hmac->get_block_size(this->hmac); +} + +/** * Implementation of prf_t.set_key. */ static void set_key(private_hmac_prf_t *this, chunk_t key) @@ -94,6 +103,7 @@ hmac_prf_t *hmac_prf_create(hash_algorithm_t hash_algorithm) this->public.prf_interface.get_bytes = (void (*) (prf_t *,chunk_t,u_int8_t*))get_bytes; this->public.prf_interface.allocate_bytes = (void (*) (prf_t*,chunk_t,chunk_t*))allocate_bytes; this->public.prf_interface.get_block_size = (size_t (*) (prf_t*))get_block_size; + this->public.prf_interface.get_key_size = (size_t (*) (prf_t*))get_key_size; this->public.prf_interface.set_key = (void (*) (prf_t *,chunk_t))set_key; this->public.prf_interface.destroy = (void (*) (prf_t *))destroy; diff --git a/Source/charon/transforms/prfs/prf.h b/Source/charon/transforms/prfs/prf.h index d96fc66ae..17b1110b2 100644 --- a/Source/charon/transforms/prfs/prf.h +++ b/Source/charon/transforms/prfs/prf.h @@ -98,6 +98,14 @@ struct prf_t { size_t (*get_block_size) (prf_t *this); /** + * @brief Get the key size of this prf_t object. + * + * @param this calling object + * @return key size in bytes + */ + size_t (*get_key_size) (prf_t *this); + + /** * @brief Set the key for this prf_t object. * * @param this calling object |