summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_srvr.c
diff options
context:
space:
mode:
authorjsing <>2014-12-10 15:43:31 +0000
committerjsing <>2014-12-10 15:43:31 +0000
commit47eb97a22f4397f7e4d7b37419d4c88e805cf71b (patch)
tree626ac5debee47cd4bf6f23ff35253234be5bbe4d /src/lib/libssl/s3_srvr.c
parent1434a91c4d4dc782915ce81dd056fa8f6cb77ae1 (diff)
downloadopenbsd-47eb97a22f4397f7e4d7b37419d4c88e805cf71b.tar.gz
openbsd-47eb97a22f4397f7e4d7b37419d4c88e805cf71b.tar.bz2
openbsd-47eb97a22f4397f7e4d7b37419d4c88e805cf71b.zip
ssl3_init_finished_mac() calls BIO_new() which can fail since it in turn
calls malloc(). Instead of silently continuing on failure, check the return value of BIO_new() and propagate failure back to the caller for appropriate handling. ok bcook@
Diffstat (limited to 'src/lib/libssl/s3_srvr.c')
-rw-r--r--src/lib/libssl/s3_srvr.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c
index 43880a0610..645caf4bc9 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.92 2014/12/10 15:36:47 jsing Exp $ */ 1/* $OpenBSD: s3_srvr.c,v 1.93 2014/12/10 15:43:31 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 *
@@ -298,7 +298,11 @@ ssl3_accept(SSL *s)
298 goto end; 298 goto end;
299 } 299 }
300 300
301 ssl3_init_finished_mac(s); 301 if (!ssl3_init_finished_mac(s)) {
302 ret = -1;
303 goto end;
304 }
305
302 s->state = SSL3_ST_SR_CLNT_HELLO_A; 306 s->state = SSL3_ST_SR_CLNT_HELLO_A;
303 s->ctx->stats.sess_accept++; 307 s->ctx->stats.sess_accept++;
304 } else if (!s->s3->send_connection_binding) { 308 } else if (!s->s3->send_connection_binding) {
@@ -334,7 +338,10 @@ ssl3_accept(SSL *s)
334 s->state = SSL3_ST_SW_FLUSH; 338 s->state = SSL3_ST_SW_FLUSH;
335 s->init_num = 0; 339 s->init_num = 0;
336 340
337 ssl3_init_finished_mac(s); 341 if (!ssl3_init_finished_mac(s)) {
342 ret = -1;
343 goto end;
344 }
338 break; 345 break;
339 346
340 case SSL3_ST_SW_HELLO_REQ_C: 347 case SSL3_ST_SW_HELLO_REQ_C: