diff options
author | David Benjamin <davidben@chromium.org> | 2014-11-17 11:23:24 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-11-17 23:27:13 +0300 |
commit | 5e4f6e92476144313b14dbadee25f1e288583d41 (patch) | |
tree | c94e8bdfc9e2b4bec319b9eedf5960a1b49f61a5 /ssl/ssl_sess.c | |
parent | 3087f6e594849d4805dd4a1507347fdbd2135489 (diff) |
Remove some remnants of SSLv2.
Change-Id: Id294821162c4c9ea6f2fce2a0be65bafcb616068
Reviewed-on: https://boringssl-review.googlesource.com/2311
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 6b5f8c29..ee3daa9d 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -283,40 +283,15 @@ int ssl_get_new_session(SSL *s, int session) if (session) { - if (s->version == SSL2_VERSION) + if (s->version == SSL3_VERSION || + s->version == TLS1_VERSION || + s->version == TLS1_1_VERSION || + s->version == TLS1_2_VERSION || + s->version == DTLS1_VERSION || + s->version == DTLS1_2_VERSION) { - ss->ssl_version=SSL2_VERSION; - ss->session_id_length=SSL2_SSL_SESSION_ID_LENGTH; - } - else if (s->version == SSL3_VERSION) - { - ss->ssl_version=SSL3_VERSION; - ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; - } - else if (s->version == TLS1_VERSION) - { - ss->ssl_version=TLS1_VERSION; - ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; - } - else if (s->version == TLS1_1_VERSION) - { - ss->ssl_version=TLS1_1_VERSION; - ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; - } - else if (s->version == TLS1_2_VERSION) - { - ss->ssl_version=TLS1_2_VERSION; - ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; - } - else if (s->version == DTLS1_VERSION) - { - ss->ssl_version=DTLS1_VERSION; - ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; - } - else if (s->version == DTLS1_2_VERSION) - { - ss->ssl_version=DTLS1_2_VERSION; - ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; + ss->ssl_version = s->version; + ss->session_id_length = SSL3_SSL_SESSION_ID_LENGTH; } else { @@ -355,11 +330,7 @@ int ssl_get_new_session(SSL *s, int session) SSL_SESSION_free(ss); return(0); } - /* If the session length was shrunk and we're SSLv2, pad it */ - if((tmp < ss->session_id_length) && (s->version == SSL2_VERSION)) - memset(ss->session_id + tmp, 0, ss->session_id_length - tmp); - else - ss->session_id_length = tmp; + ss->session_id_length = tmp; /* Finally, check for a conflict */ if(SSL_has_matching_session_id(s, ss->session_id, ss->session_id_length)) |