From bc41b879d5f8d2286f094d85222d0d40b90ace00 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sat, 15 Jun 2013 20:13:59 +0200 Subject: curve: curve25519_tfm_alloc/curve25519_tfm_free helpers Facilitate allocation and destruction of crypto objects through common helper functions. Signed-off-by: Daniel Borkmann --- ct_server.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ct_server.c') diff --git a/ct_server.c b/ct_server.c index eb53bd3..9737ffd 100644 --- a/ct_server.c +++ b/ct_server.c @@ -448,21 +448,19 @@ static void *worker(void *self) int fd, old_state; ssize_t ret; size_t blen = TUNBUFF_SIZ; //FIXME - const struct worker_struct *ws = self; + struct worker_struct *ws = self; struct pollfd fds; char *buff; fds.fd = ws->efd[0]; fds.events = POLLIN; - curve25519_alloc_or_maybe_die(ws->c); - + ws->c = curve25519_tfm_alloc(); buff = xmalloc_aligned(blen, 64); syslog(LOG_INFO, "curvetun thread on CPU%u up!\n", ws->cpu); - pthread_cleanup_push(xfree_func, ws->c); - pthread_cleanup_push(curve25519_free, ws->c); + pthread_cleanup_push(curve25519_tfm_free_void, ws->c); pthread_cleanup_push(xfree_func, buff); while (likely(!sigint)) { @@ -488,7 +486,6 @@ static void *worker(void *self) syslog(LOG_INFO, "curvetun thread on CPU%u down!\n", ws->cpu); - pthread_cleanup_pop(1); pthread_cleanup_pop(1); pthread_cleanup_pop(1); -- cgit v1.2.3-54-g00ecf