diff options
Diffstat (limited to 'chromium/third_party/openssl/openssl/ssl/s23_clnt.c')
-rw-r--r-- | chromium/third_party/openssl/openssl/ssl/s23_clnt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chromium/third_party/openssl/openssl/ssl/s23_clnt.c b/chromium/third_party/openssl/openssl/ssl/s23_clnt.c index 2d0f51dab82..750d208a866 100644 --- a/chromium/third_party/openssl/openssl/ssl/s23_clnt.c +++ b/chromium/third_party/openssl/openssl/ssl/s23_clnt.c @@ -466,7 +466,10 @@ static int ssl23_client_hello(SSL *s) { /* create Client Hello in SSL 3.0/TLS 1.0 format */ - /* do the record header (5 bytes) and handshake message header (4 bytes) last */ + /* do the record header (5 bytes) and handshake message + * header (4 bytes) last. Note: the final argument to + * ssl_add_clienthello_tlsext below depends on the size + * of this prefix. */ d = p = &(buf[9]); *(p++) = version_major; @@ -523,7 +526,10 @@ static int ssl23_client_hello(SSL *s) SSLerr(SSL_F_SSL23_CLIENT_HELLO,SSL_R_CLIENTHELLO_TLSEXT); return -1; } - if ((p = ssl_add_clienthello_tlsext(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH)) == NULL) + /* The buffer includes the 5 byte record header, so + * subtract it to compute hlen for + * ssl_add_clienthello_tlsext. */ + if ((p = ssl_add_clienthello_tlsext(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH, p-buf-5)) == NULL) { SSLerr(SSL_F_SSL23_CLIENT_HELLO,ERR_R_INTERNAL_ERROR); return -1; |