From 87dfb52384d6fa9cdb7418cfc6f81f1a121e862b Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 27 Mar 2015 12:29:54 +0000 Subject: Factor out the init_buf initialisation code, rather than duplicating it in four different places. ok doug@ guenther@ --- src/lib/libssl/s3_srvr.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/lib/libssl/s3_srvr.c') diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c index 0bff0204d9..ce48809f65 100644 --- a/src/lib/libssl/s3_srvr.c +++ b/src/lib/libssl/s3_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_srvr.c,v 1.100 2015/02/25 03:49:21 bcook Exp $ */ +/* $OpenBSD: s3_srvr.c,v 1.101 2015/03/27 12:29:54 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -265,21 +265,10 @@ ssl3_accept(SSL *s) } s->type = SSL_ST_ACCEPT; - if (s->init_buf == NULL) { - BUF_MEM *buf; - if ((buf = BUF_MEM_new()) == NULL) { - ret = -1; - goto end; - } - if (!BUF_MEM_grow(buf, - SSL3_RT_MAX_PLAIN_LENGTH)) { - BUF_MEM_free(buf); - ret = -1; - goto end; - } - s->init_buf = buf; + if (!ssl3_setup_init_buffer(s)) { + ret = -1; + goto end; } - if (!ssl3_setup_buffers(s)) { ret = -1; goto end; -- cgit v1.2.3-55-g6feb