diff options
author | Bodo Möller <bodo@openssl.org> | 2006-01-02 23:14:37 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2006-01-02 23:14:37 +0000 |
commit | ed3883d21bb4ddfc21ec9d154e14e84c85db164d (patch) | |
tree | 90b41ebd80a9ddc73886c2f9d3ff427d48508f21 /ssl/s3_clnt.c | |
parent | ea558241e08c575cfea49732b19eaf14bae9e672 (diff) | |
download | openssl-ed3883d21bb4ddfc21ec9d154e14e84c85db164d.tar.gz |
Support TLS extensions (specifically, HostName)
Submitted by: Peter Sylvester
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r-- | ssl/s3_clnt.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 0098f56178..7a4f256642 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -255,6 +255,16 @@ int ssl3_connect(SSL *s) case SSL3_ST_CR_SRVR_HELLO_B: ret=ssl3_get_server_hello(s); if (ret <= 0) goto end; +#ifndef OPENSSL_NO_TLSEXT + { + int extension_error = 0,al; + if ((al = ssl_check_Hello_TLS_extensions(s,&extension_error)) != SSL_ERROR_NONE){ + ret = -1; + SSLerr(SSL_F_SSL3_CONNECT,SSL_R_SERVERHELLO_TLS_EXT); + goto end; + } + } +#endif if (s->hit) s->state=SSL3_ST_CR_FINISHED_A; else @@ -602,6 +612,13 @@ int ssl3_client_hello(SSL *s) } #endif *(p++)=0; /* Add the NULL method */ +#ifndef OPENSSL_NO_TLSEXT + if ((p = ssl_add_ClientHello_TLS_extensions(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH)) == NULL) + { + SSLerr(SSL_F_SSL3_CLIENT_HELLO,ERR_R_INTERNAL_ERROR); + goto err; + } +#endif l=(p-d); d=buf; @@ -786,6 +803,16 @@ int ssl3_get_server_hello(SSL *s) s->s3->tmp.new_compression=comp; } #endif +#ifndef OPENSSL_NO_TLSEXT + /* TLS extensions*/ + if (s->version > SSL3_VERSION) + { + if ((al = ssl_parse_ServerHello_TLS_extensions(s,&p,d,n)) != SSL_ERROR_NONE){ + SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_PARSE_TLS_EXT); + goto f_err; + } + } +#endif if (p != (d+n)) { |