diff options
Diffstat (limited to 'src/lib/libssl/s23_clnt.c')
| -rw-r--r-- | src/lib/libssl/s23_clnt.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/lib/libssl/s23_clnt.c b/src/lib/libssl/s23_clnt.c index 4159ae0580..0ab56fa38d 100644 --- a/src/lib/libssl/s23_clnt.c +++ b/src/lib/libssl/s23_clnt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s23_clnt.c,v 1.36 2015/02/06 08:30:23 jsing Exp $ */ | 1 | /* $OpenBSD: s23_clnt.c,v 1.37 2015/03/27 12:29:54 jsing Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -176,7 +176,6 @@ ssl23_get_client_method(int ver) | |||
| 176 | int | 176 | int |
| 177 | ssl23_connect(SSL *s) | 177 | ssl23_connect(SSL *s) |
| 178 | { | 178 | { |
| 179 | BUF_MEM *buf = NULL; | ||
| 180 | void (*cb)(const SSL *ssl, int type, int val) = NULL; | 179 | void (*cb)(const SSL *ssl, int type, int val) = NULL; |
| 181 | int ret = -1; | 180 | int ret = -1; |
| 182 | int new_state, state; | 181 | int new_state, state; |
| @@ -214,24 +213,14 @@ ssl23_connect(SSL *s) | |||
| 214 | /* s->version=TLS1_VERSION; */ | 213 | /* s->version=TLS1_VERSION; */ |
| 215 | s->type = SSL_ST_CONNECT; | 214 | s->type = SSL_ST_CONNECT; |
| 216 | 215 | ||
| 217 | if (s->init_buf == NULL) { | 216 | if (!ssl3_setup_init_buffer(s)) { |
| 218 | if ((buf = BUF_MEM_new()) == NULL) { | 217 | ret = -1; |
| 219 | ret = -1; | 218 | goto end; |
| 220 | goto end; | ||
| 221 | } | ||
| 222 | if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { | ||
| 223 | ret = -1; | ||
| 224 | goto end; | ||
| 225 | } | ||
| 226 | s->init_buf = buf; | ||
| 227 | buf = NULL; | ||
| 228 | } | 219 | } |
| 229 | |||
| 230 | if (!ssl3_setup_buffers(s)) { | 220 | if (!ssl3_setup_buffers(s)) { |
| 231 | ret = -1; | 221 | ret = -1; |
| 232 | goto end; | 222 | goto end; |
| 233 | } | 223 | } |
| 234 | |||
| 235 | if (!ssl3_init_finished_mac(s)) { | 224 | if (!ssl3_init_finished_mac(s)) { |
| 236 | ret = -1; | 225 | ret = -1; |
| 237 | goto end; | 226 | goto end; |
| @@ -280,12 +269,12 @@ ssl23_connect(SSL *s) | |||
| 280 | s->state = new_state; | 269 | s->state = new_state; |
| 281 | } | 270 | } |
| 282 | } | 271 | } |
| 272 | |||
| 283 | end: | 273 | end: |
| 284 | s->in_handshake--; | 274 | s->in_handshake--; |
| 285 | if (buf != NULL) | ||
| 286 | BUF_MEM_free(buf); | ||
| 287 | if (cb != NULL) | 275 | if (cb != NULL) |
| 288 | cb(s, SSL_CB_CONNECT_EXIT, ret); | 276 | cb(s, SSL_CB_CONNECT_EXIT, ret); |
| 277 | |||
| 289 | return (ret); | 278 | return (ret); |
| 290 | } | 279 | } |
| 291 | 280 | ||
