summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_both.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/s3_both.c')
-rw-r--r--src/lib/libssl/s3_both.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_both.c b/src/lib/libssl/s3_both.c
index 5db0a11618..a19ce74380 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.41 2015/07/14 05:41:07 doug Exp $ */ 1/* $OpenBSD: s3_both.c,v 1.42 2015/07/15 21:52:02 beck 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 *
@@ -242,9 +242,15 @@ ssl3_get_finished(SSL *s, int a, int b)
242 242
243 md_len = s->method->ssl3_enc->finish_mac_length; 243 md_len = s->method->ssl3_enc->finish_mac_length;
244 244
245 if (n < 0) {
246 al = SSL_AD_DECODE_ERROR;
247 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_BAD_DIGEST_LENGTH);
248 goto f_err;
249 }
250
245 CBS_init(&cbs, s->init_msg, n); 251 CBS_init(&cbs, s->init_msg, n);
246 252
247 if (n < 0 || s->s3->tmp.peer_finish_md_len != md_len || 253 if (s->s3->tmp.peer_finish_md_len != md_len ||
248 CBS_len(&cbs) != md_len) { 254 CBS_len(&cbs) != md_len) {
249 al = SSL_AD_DECODE_ERROR; 255 al = SSL_AD_DECODE_ERROR;
250 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_BAD_DIGEST_LENGTH); 256 SSLerr(SSL_F_SSL3_GET_FINISHED, SSL_R_BAD_DIGEST_LENGTH);