summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_both.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_both.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_both.c')
-rw-r--r--src/lib/libssl/s3_both.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_both.c b/src/lib/libssl/s3_both.c
index 0d9cc3d65c..ffc10774d8 100644
--- a/src/lib/libssl/s3_both.c
+++ b/src/lib/libssl/s3_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_both.c,v 1.33 2014/12/10 15:36:46 jsing Exp $ */ 1/* $OpenBSD: s3_both.c,v 1.34 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 *
@@ -464,7 +464,11 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
464 * start a new handshake?). We need to restart the mac. 464 * start a new handshake?). We need to restart the mac.
465 * Don't increment {num,total}_renegotiations because 465 * Don't increment {num,total}_renegotiations because
466 * we have not completed the handshake. */ 466 * we have not completed the handshake. */
467 ssl3_init_finished_mac(s); 467 if (!ssl3_init_finished_mac(s)) {
468 SSLerr(SSL_F_SSL3_GET_MESSAGE,
469 ERR_R_MALLOC_FAILURE);
470 goto err;
471 }
468 } 472 }
469 473
470 s->s3->tmp.message_type= *(p++); 474 s->s3->tmp.message_type= *(p++);