From: Adrian-Ken Rueegsegger Date: Wed, 22 Aug 2012 08:53:08 +0000 (+0200) Subject: nonceg: Insert id mapping when allocating nonce X-Git-Tag: 5.0.3rc1~39^2~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=624178fececdf6376e5ee21c330f35b0f685f8b7;p=thirdparty%2Fstrongswan.git nonceg: Insert id mapping when allocating nonce --- diff --git a/src/charon-tkm/src/tkm/tkm_nonceg.c b/src/charon-tkm/src/tkm/tkm_nonceg.c index 7079412cd4..2723a3ee5e 100644 --- a/src/charon-tkm/src/tkm/tkm_nonceg.c +++ b/src/charon-tkm/src/tkm/tkm_nonceg.c @@ -56,7 +56,12 @@ METHOD(nonce_gen_t, allocate_nonce, bool, private_tkm_nonceg_t *this, size_t size, chunk_t *chunk) { *chunk = chunk_alloc(size); - return get_nonce(this, chunk->len, chunk->ptr); + if (get_nonce(this, chunk->len, chunk->ptr)) + { + tkm->chunk_map->insert(tkm->chunk_map, chunk, this->context_id); + return TRUE; + } + return FALSE; } METHOD(nonce_gen_t, destroy, void,