summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/ssl/d1_srvr.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2015-03-27 12:29:54 +0000
committerjsing <jsing@openbsd.org>2015-03-27 12:29:54 +0000
commit4c5ec7da26a11a298d79cded54aa76d431fdda94 (patch)
tree59e19ccbcd28ea53aebc59248e7f35610a5d20e4 /lib/libssl/src/ssl/d1_srvr.c
parentBUF_MEM_free() has its own explicit NULL check. (diff)
downloadwireguard-openbsd-4c5ec7da26a11a298d79cded54aa76d431fdda94.tar.xz
wireguard-openbsd-4c5ec7da26a11a298d79cded54aa76d431fdda94.zip
Factor out the init_buf initialisation code, rather than duplicating it
in four different places. ok doug@ guenther@
Diffstat (limited to 'lib/libssl/src/ssl/d1_srvr.c')
-rw-r--r--lib/libssl/src/ssl/d1_srvr.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/libssl/src/ssl/d1_srvr.c b/lib/libssl/src/ssl/d1_srvr.c
index 4e6d0da3b39..1d3779f5671 100644
--- a/lib/libssl/src/ssl/d1_srvr.c
+++ b/lib/libssl/src/ssl/d1_srvr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_srvr.c,v 1.49 2015/02/09 10:53:28 jsing Exp $ */
+/* $OpenBSD: d1_srvr.c,v 1.50 2015/03/27 12:29:54 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -228,20 +228,10 @@ dtls1_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;