summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2011-02-10 22:40:27 +0000
committerdjm <djm@openbsd.org>2011-02-10 22:40:27 +0000
commit26d465f0668a7a3e8949bf120ad5c39e4c94e02b (patch)
treefb964f4e2cf6a10f349ca5a4f0a06ad55e0e3836 /lib
parentPut a limit on recursion during matching, and reject input of size greater (diff)
downloadwireguard-openbsd-26d465f0668a7a3e8949bf120ad5c39e4c94e02b.tar.xz
wireguard-openbsd-26d465f0668a7a3e8949bf120ad5c39e4c94e02b.zip
fix for CVE-2011-0014 "OCSP stapling vulnerability";
ok markus@ jasper@ miod@ AFAIK nothing in base uses this, though apache2 from ports may be affected.
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/src/ssl/t1_lib.c8
-rw-r--r--lib/libssl/t1_lib.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/libssl/src/ssl/t1_lib.c b/lib/libssl/src/ssl/t1_lib.c
index 833fc172de1..0baa70663aa 100644
--- a/lib/libssl/src/ssl/t1_lib.c
+++ b/lib/libssl/src/ssl/t1_lib.c
@@ -917,6 +917,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
}
n2s(data, idsize);
dsize -= 2 + idsize;
+ size -= 2 + idsize;
if (dsize < 0)
{
*al = SSL_AD_DECODE_ERROR;
@@ -955,9 +956,14 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
}
/* Read in request_extensions */
+ if (size < 2)
+ {
+ *al = SSL_AD_DECODE_ERROR;
+ return 0;
+ }
n2s(data,dsize);
size -= 2;
- if (dsize > size)
+ if (dsize != size)
{
*al = SSL_AD_DECODE_ERROR;
return 0;
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c
index 833fc172de1..0baa70663aa 100644
--- a/lib/libssl/t1_lib.c
+++ b/lib/libssl/t1_lib.c
@@ -917,6 +917,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
}
n2s(data, idsize);
dsize -= 2 + idsize;
+ size -= 2 + idsize;
if (dsize < 0)
{
*al = SSL_AD_DECODE_ERROR;
@@ -955,9 +956,14 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
}
/* Read in request_extensions */
+ if (size < 2)
+ {
+ *al = SSL_AD_DECODE_ERROR;
+ return 0;
+ }
n2s(data,dsize);
size -= 2;
- if (dsize > size)
+ if (dsize != size)
{
*al = SSL_AD_DECODE_ERROR;
return 0;