Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2014-12-15 03:44:34 +0300
committerAdam Langley <agl@google.com>2014-12-16 04:43:51 +0300
commite4824e8af0f46bd9723750e045401de65741bbe9 (patch)
tree20b4cf0d029c34890378dd12bd0213884d2e5b19 /ssl/s3_srvr.c
parent44f2d1a9bf3a71d0f502933ac6807d97ae1f16ba (diff)
Add outgoing messages to the handshake hash at set_handshake_header.
This avoids needing a should_add_to_finished_hash boolean on do_write. The logic in do_write was a little awkward because do_write would be called multiple times if the write took several iterations. This also gets complex if DTLS retransmits are involved. (At a glance, it's not obvious the BIO_CTRL_DGRAM_MTU_EXCEEDED case actually works.) Doing it as the handshake message is being prepared avoids this concern. It also gives a natural point for the extended master secret logic which needs to do work after the finished hash has been sampled. As a bonus, we can remove s->d1->retransmitting which was only used to deal with this issue. Change-Id: Ifedf23ee4a6c5e08f960d296a6eb1f337a16dc7a Reviewed-on: https://boringssl-review.googlesource.com/2604 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/s3_srvr.c')
-rw-r--r--ssl/s3_srvr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index 433d81b2..3ec6e5a5 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -1899,6 +1899,7 @@ int ssl3_send_certificate_request(SSL *s)
*(p++)=0;
*(p++)=0;
s->init_num += 4;
+ ssl3_finish_mac(s, p - 4, 4);
}
#endif
@@ -2784,10 +2785,10 @@ int ssl3_send_new_session_ticket(SSL *s)
/* Now write out lengths: p points to end of data written */
/* Total length */
len = p - ssl_handshake_start(s);
- ssl_set_handshake_header(s, SSL3_MT_NEWSESSION_TICKET, len);
/* Skip ticket lifetime hint */
p = ssl_handshake_start(s) + 4;
s2n(len - 6, p);
+ ssl_set_handshake_header(s, SSL3_MT_NEWSESSION_TICKET, len);
s->state=SSL3_ST_SW_SESSION_TICKET_B;
OPENSSL_free(session);
}