summaryrefslogtreecommitdiffstats
path: root/lib/libssl/s3_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/s3_clnt.c')
-rw-r--r--lib/libssl/s3_clnt.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/lib/libssl/s3_clnt.c b/lib/libssl/s3_clnt.c
index 5d9ac2e2e81..07d2eb583a7 100644
--- a/lib/libssl/s3_clnt.c
+++ b/lib/libssl/s3_clnt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_clnt.c,v 1.109 2015/03/11 19:34:06 tedu Exp $ */
+/* $OpenBSD: s3_clnt.c,v 1.110 2015/03/27 12:29:54 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -218,7 +218,6 @@ ssl3_get_client_method(int ver)
int
ssl3_connect(SSL *s)
{
- BUF_MEM *buf = NULL;
void (*cb)(const SSL *ssl, int type, int val) = NULL;
int ret = -1;
int new_state, state, skip = 0;
@@ -263,26 +262,14 @@ ssl3_connect(SSL *s)
/* s->version=SSL3_VERSION; */
s->type = SSL_ST_CONNECT;
- if (s->init_buf == NULL) {
- if ((buf = BUF_MEM_new()) == NULL) {
- ret = -1;
- goto end;
- }
- if (!BUF_MEM_grow(buf,
- SSL3_RT_MAX_PLAIN_LENGTH)) {
- ret = -1;
- goto end;
- }
- s->init_buf = buf;
- buf = NULL;
+ if (!ssl3_setup_init_buffer(s)) {
+ ret = -1;
+ goto end;
}
-
if (!ssl3_setup_buffers(s)) {
ret = -1;
goto end;
}
-
- /* setup buffing BIO */
if (!ssl_init_wbio_buffer(s, 0)) {
ret = -1;
goto end;
@@ -631,12 +618,12 @@ ssl3_connect(SSL *s)
}
skip = 0;
}
+
end:
s->in_handshake--;
- if (buf != NULL)
- BUF_MEM_free(buf);
if (cb != NULL)
cb(s, SSL_CB_CONNECT_EXIT, ret);
+
return (ret);
}