diff options
author | jkim <jkim@FreeBSD.org> | 2012-06-27 16:44:58 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-06-27 16:44:58 +0000 |
commit | 1554498e64df093a519f9074c3412047f398aa17 (patch) | |
tree | cc5cd6657453d80b7eafb3ba5cc4ef4fd66c176f /ssl/t1_lib.c | |
parent | ae03beb758270fb19d741c93f7bfde88a6635612 (diff) | |
download | FreeBSD-src-1554498e64df093a519f9074c3412047f398aa17.zip FreeBSD-src-1554498e64df093a519f9074c3412047f398aa17.tar.gz |
Import OpenSSL 0.9.8x.
Diffstat (limited to 'ssl/t1_lib.c')
-rw-r--r-- | ssl/t1_lib.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 0cc8320..cc97258 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -521,6 +521,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; @@ -559,9 +560,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; @@ -569,6 +575,12 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in sdata = data; if (dsize > 0) { + if (s->tlsext_ocsp_exts) + { + sk_X509_EXTENSION_pop_free(s->tlsext_ocsp_exts, + X509_EXTENSION_free); + } + s->tlsext_ocsp_exts = d2i_X509_EXTENSIONS(NULL, &sdata, dsize); |