summaryrefslogtreecommitdiffstats
path: root/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2017-01-24 08:41:53 +0000
committerjsing <jsing@openbsd.org>2017-01-24 08:41:53 +0000
commitc36dba41cee66975338f027ec03b5548d89916d2 (patch)
tree58718c9df53f315ed48325d7abf5e5011742470b /lib/libssl/t1_lib.c
parentMerge LLVM 4.0.0 rc1 (diff)
downloadwireguard-openbsd-c36dba41cee66975338f027ec03b5548d89916d2.tar.xz
wireguard-openbsd-c36dba41cee66975338f027ec03b5548d89916d2.zip
Correct bounds checks used when generating the EC curves extension.
ok beck@
Diffstat (limited to 'lib/libssl/t1_lib.c')
-rw-r--r--lib/libssl/t1_lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c
index 5ca0a1f4a0e..b69e52a85c6 100644
--- a/lib/libssl/t1_lib.c
+++ b/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_lib.c,v 1.107 2017/01/24 03:41:43 jsing Exp $ */
+/* $OpenBSD: t1_lib.c,v 1.108 2017/01/24 08:41:53 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -752,9 +752,9 @@ ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit)
return NULL;
lenmax = limit - ret - 6;
- if (curveslen > lenmax)
+ if (curveslen * 2 > lenmax)
return NULL;
- if (curveslen > 65532) {
+ if (curveslen * 2 > 65532) {
SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT,
ERR_R_INTERNAL_ERROR);
return NULL;