From d23d5a5a8b41e1c3281bab995f3f601ac2e0e5d8 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 15 May 2015 21:48:48 -0400 Subject: [PATCH] Remove remnants of DTLS renegotiate. BUG=429450 Change-Id: I94846d1fd377bc07044f916d0bb1880e219416df Reviewed-on: https://boringssl-review.googlesource.com/4821 Reviewed-by: Adam Langley --- ssl/d1_clnt.c | 4 ---- ssl/d1_srvr.c | 55 ++++++++------------------------------------------- 2 files changed, 8 insertions(+), 51 deletions(-) diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 0d592d09..90123eac 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -155,10 +155,6 @@ int dtls1_connect(SSL *s) { state = s->state; switch (s->state) { - case SSL_ST_RENEGOTIATE: - s->renegotiate = 1; - s->state = SSL_ST_CONNECT; - /* break */ case SSL_ST_CONNECT: case SSL_ST_BEFORE | SSL_ST_CONNECT: if (cb != NULL) { diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 442e5e18..856e2e9c 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -159,10 +159,6 @@ int dtls1_accept(SSL *s) { state = s->state; switch (s->state) { - case SSL_ST_RENEGOTIATE: - s->renegotiate = 1; - /* s->state=SSL_ST_ACCEPT; */ - case SSL_ST_ACCEPT: case SSL_ST_BEFORE | SSL_ST_ACCEPT: if (cb != NULL) { @@ -181,49 +177,18 @@ int dtls1_accept(SSL *s) { s->init_num = 0; - if (s->state != SSL_ST_RENEGOTIATE) { - if (!ssl_init_wbio_buffer(s, 1)) { - ret = -1; - goto end; - } - - if (!ssl3_init_finished_mac(s)) { - OPENSSL_PUT_ERROR(SSL, dtls1_accept, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; - } - - s->state = SSL3_ST_SR_CLNT_HELLO_A; - } else { - /* s->state == SSL_ST_RENEGOTIATE, * we will just send a - * HelloRequest */ - s->state = SSL3_ST_SW_HELLO_REQ_A; - } - - break; - - case SSL3_ST_SW_HELLO_REQ_A: - case SSL3_ST_SW_HELLO_REQ_B: - s->shutdown = 0; - dtls1_clear_record_buffer(s); - dtls1_start_timer(s); - ret = ssl3_send_hello_request(s); - if (ret <= 0) { + if (!ssl_init_wbio_buffer(s, 1)) { + ret = -1; goto end; } - s->s3->tmp.next_state = SSL3_ST_SR_CLNT_HELLO_A; - s->state = SSL3_ST_SW_FLUSH; - s->init_num = 0; if (!ssl3_init_finished_mac(s)) { OPENSSL_PUT_ERROR(SSL, dtls1_accept, ERR_R_INTERNAL_ERROR); ret = -1; goto end; } - break; - case SSL3_ST_SW_HELLO_REQ_C: - s->state = SSL_ST_OK; + s->state = SSL3_ST_SR_CLNT_HELLO_A; break; case SSL3_ST_SR_CLNT_HELLO_A: @@ -470,17 +435,13 @@ int dtls1_accept(SSL *s) { ssl_free_wbio_buffer(s); s->init_num = 0; + s->renegotiate = 0; + s->s3->initial_handshake_complete = 1; - if (s->renegotiate == 2) { - /* skipped if we just sent a HelloRequest */ - s->renegotiate = 0; - s->s3->initial_handshake_complete = 1; + ssl_update_cache(s, SSL_SESS_CACHE_SERVER); - ssl_update_cache(s, SSL_SESS_CACHE_SERVER); - - if (cb != NULL) { - cb(s, SSL_CB_HANDSHAKE_DONE, 1); - } + if (cb != NULL) { + cb(s, SSL_CB_HANDSHAKE_DONE, 1); } ret = 1;