diff options
| author | jsing <> | 2015-03-27 12:29:54 +0000 |
|---|---|---|
| committer | jsing <> | 2015-03-27 12:29:54 +0000 |
| commit | e4bb8802504ce04db08be8266b9377e800301e84 (patch) | |
| tree | d1107e1e9c18e2392e54fb1e385c31262c4dbd2e /src/lib/libssl/s3_srvr.c | |
| parent | 3c33e1429e1b0d6e6a121c97b536af97a1fd8e0a (diff) | |
| download | openbsd-e4bb8802504ce04db08be8266b9377e800301e84.tar.gz openbsd-e4bb8802504ce04db08be8266b9377e800301e84.tar.bz2 openbsd-e4bb8802504ce04db08be8266b9377e800301e84.zip | |
Factor out the init_buf initialisation code, rather than duplicating it
in four different places.
ok doug@ guenther@
Diffstat (limited to 'src/lib/libssl/s3_srvr.c')
| -rw-r--r-- | src/lib/libssl/s3_srvr.c | 19 |
1 files changed, 4 insertions, 15 deletions
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 @@ | |||
| 1 | /* $OpenBSD: s3_srvr.c,v 1.100 2015/02/25 03:49:21 bcook Exp $ */ | 1 | /* $OpenBSD: s3_srvr.c,v 1.101 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 | * |
| @@ -265,21 +265,10 @@ ssl3_accept(SSL *s) | |||
| 265 | } | 265 | } |
| 266 | s->type = SSL_ST_ACCEPT; | 266 | s->type = SSL_ST_ACCEPT; |
| 267 | 267 | ||
| 268 | if (s->init_buf == NULL) { | 268 | if (!ssl3_setup_init_buffer(s)) { |
| 269 | BUF_MEM *buf; | 269 | ret = -1; |
| 270 | if ((buf = BUF_MEM_new()) == NULL) { | 270 | goto end; |
| 271 | ret = -1; | ||
| 272 | goto end; | ||
| 273 | } | ||
| 274 | if (!BUF_MEM_grow(buf, | ||
| 275 | SSL3_RT_MAX_PLAIN_LENGTH)) { | ||
| 276 | BUF_MEM_free(buf); | ||
| 277 | ret = -1; | ||
| 278 | goto end; | ||
| 279 | } | ||
| 280 | s->init_buf = buf; | ||
| 281 | } | 271 | } |
| 282 | |||
| 283 | if (!ssl3_setup_buffers(s)) { | 272 | if (!ssl3_setup_buffers(s)) { |
| 284 | ret = -1; | 273 | ret = -1; |
| 285 | goto end; | 274 | goto end; |
