summaryrefslogtreecommitdiff
path: root/lib/libssl/t1_enc.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2014-07-08 16:05:53 +0000
committerBob Beck <beck@cvs.openbsd.org>2014-07-08 16:05:53 +0000
commit3a3f5ed52a7da555755fc185ef7e7546ba0785fa (patch)
treef8c3a5ec2826b66917b0efc6357a68b5abd44c8b /lib/libssl/t1_enc.c
parent9d028822b91f360c3af9645da41adb8b974c61fc (diff)
pedantic avoidance of division by zero, likely not actually
possible to hit for real. ok miod@ jsing@
Diffstat (limited to 'lib/libssl/t1_enc.c')
-rw-r--r--lib/libssl/t1_enc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libssl/t1_enc.c b/lib/libssl/t1_enc.c
index 373c2d0060f..46238dc6c3b 100644
--- a/lib/libssl/t1_enc.c
+++ b/lib/libssl/t1_enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_enc.c,v 1.63 2014/06/21 17:02:25 jsing Exp $ */
+/* $OpenBSD: t1_enc.c,v 1.64 2014/07/08 16:05:52 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -251,6 +251,11 @@ tls1_PRF(long digest_mask, const void *seed1, int seed1_len, const void *seed2,
if ((m << TLS1_PRF_DGST_SHIFT) & digest_mask)
count++;
}
+ if (count == 0) {
+ SSLerr(SSL_F_TLS1_PRF,
+ SSL_R_SSL_HANDSHAKE_FAILURE);
+ goto err;
+ }
len = slen / count;
if (count == 1)
slen = 0;