summaryrefslogtreecommitdiffstats
path: root/ssl/s23_clnt.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-04-29 22:56:51 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-04-29 22:56:51 +0000
commit7409d7ad517650db332ae528915a570e4e0ab88b (patch)
tree30ef3e18eff537854b4e443080bfb1f96c0fef12 /ssl/s23_clnt.c
parent08557cf22cd7c337d7430c32fb21ed29a77a8131 (diff)
Initial incomplete TLS v1.2 support. New ciphersuites added, new version
checking added, SHA256 PRF support added. At present only RSA key exchange ciphersuites work with TLS v1.2 as the new signature format is not yet implemented.
Diffstat (limited to 'ssl/s23_clnt.c')
-rw-r--r--ssl/s23_clnt.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c
index 47f9389817..f49a95ba99 100644
--- a/ssl/s23_clnt.c
+++ b/ssl/s23_clnt.c
@@ -131,6 +131,8 @@ static const SSL_METHOD *ssl23_get_client_method(int ver)
return(TLSv1_client_method());
else if (ver == TLS1_1_VERSION)
return(TLSv1_1_client_method());
+ else if (ver == TLS1_2_VERSION)
+ return(TLSv1_2_client_method());
else
return(NULL);
}
@@ -286,7 +288,11 @@ static int ssl23_client_hello(SSL *s)
if (ssl2_compat && ssl23_no_ssl2_ciphers(s))
ssl2_compat = 0;
- if (!(s->options & SSL_OP_NO_TLSv1_1))
+ if (!(s->options & SSL_OP_NO_TLSv1_2))
+ {
+ version = TLS1_2_VERSION;
+ }
+ else if (!(s->options & SSL_OP_NO_TLSv1_1))
{
version = TLS1_1_VERSION;
}
@@ -335,7 +341,12 @@ static int ssl23_client_hello(SSL *s)
if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0)
return -1;
- if (version == TLS1_1_VERSION)
+ if (version == TLS1_2_VERSION)
+ {
+ version_major = TLS1_2_VERSION_MAJOR;
+ version_minor = TLS1_2_VERSION_MINOR;
+ }
+ else if (version == TLS1_1_VERSION)
{
version_major = TLS1_1_VERSION_MAJOR;
version_minor = TLS1_1_VERSION_MINOR;
@@ -619,7 +630,7 @@ static int ssl23_get_server_hello(SSL *s)
#endif
}
else if (p[1] == SSL3_VERSION_MAJOR &&
- p[2] <= TLS1_1_VERSION_MINOR &&
+ p[2] <= TLS1_2_VERSION_MINOR &&
((p[0] == SSL3_RT_HANDSHAKE && p[5] == SSL3_MT_SERVER_HELLO) ||
(p[0] == SSL3_RT_ALERT && p[3] == 0 && p[4] == 2)))
{
@@ -643,6 +654,12 @@ static int ssl23_get_server_hello(SSL *s)
s->version=TLS1_1_VERSION;
s->method=TLSv1_1_client_method();
}
+ else if ((p[2] == TLS1_2_VERSION_MINOR) &&
+ !(s->options & SSL_OP_NO_TLSv1_2))
+ {
+ s->version=TLS1_2_VERSION;
+ s->method=TLSv1_2_client_method();
+ }
else
{
SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL);