From 61cd731c4ee3c26533a96bf5a21631f31d747610 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 9 Sep 2016 22:08:04 +0800 Subject: [PATCH] Fix issue with authentication --- src/local.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/local.c b/src/local.c index 0030e3b6..4f94cb24 100644 --- a/src/local.c +++ b/src/local.c @@ -658,14 +658,15 @@ server_recv_cb(EV_P_ ev_io *w, int revents) ss_onetimeauth(abuf, server->e_ctx->evp.iv, BUF_SIZE); } + if (buf->len > 0 && auth) { + ss_gen_hash(buf, &remote->counter, server->e_ctx, BUF_SIZE); + } + brealloc(remote->buf, buf->len + abuf->len, BUF_SIZE); memcpy(remote->buf->array, abuf->array, abuf->len); remote->buf->len = buf->len + abuf->len; if (buf->len > 0) { - if (auth) { - ss_gen_hash(buf, &remote->counter, server->e_ctx, BUF_SIZE); - } memcpy(remote->buf->array + abuf->len, buf->array, buf->len); } } else {