From ce461bbd13c5ea6a94ba0b34cbb4d1be8159b67e Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 14 Feb 2006 14:52:00 +0000 Subject: - 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 --- Source/charon/transforms/prfs/hmac_prf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/charon/transforms/prfs/hmac_prf.c') 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 @@ -67,6 +67,15 @@ static size_t get_block_size(private_hmac_prf_t *this) return this->hmac->get_block_size(this->hmac); } +/** + * 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. */ @@ -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; -- cgit v1.2.3