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>2015-05-30 23:22:10 +0300
committerAdam Langley <agl@google.com>2015-06-02 01:27:55 +0300
commita6022771b33d39268ab846142924938248a9dca7 (patch)
treeece40c69d840c9ebca9bb638ddb2ded05a192928 /ssl/d1_both.c
parentc933a47e6f8f21f4f49f922177a93ac38b8f4f2b (diff)
Split ssl_read_bytes hook into app_data and close_notify hooks.
This still needs significant work, especially the close_notify half, but clarify the interface and get *_read_bytes out of SSL_PROTOCOL_METHOD. read_bytes is an implementation detail of those two and get_message rather than both an implementation detail of get_message for handshake and a (wholly inappropriate) exposed interface for the other two. BUG=468889 Change-Id: I7dd23869e0b7c3532ceb2e9dd31ca25ea31128e7 Reviewed-on: https://boringssl-review.googlesource.com/4956 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/d1_both.c')
-rw-r--r--ssl/d1_both.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 3eb26c52..b6f26e31 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -404,8 +404,7 @@ static int dtls1_discard_fragment_body(SSL *s, size_t frag_len) {
uint8_t discard[256];
while (frag_len > 0) {
size_t chunk = frag_len < sizeof(discard) ? frag_len : sizeof(discard);
- int ret = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, discard, chunk,
- 0);
+ int ret = dtls1_read_bytes(s, SSL3_RT_HANDSHAKE, discard, chunk, 0);
if (ret != chunk) {
return 0;
}
@@ -480,8 +479,8 @@ static int dtls1_process_fragment(SSL *s) {
* body across two records. Change this interface to consume the fragment in
* one pass. */
uint8_t header[DTLS1_HM_HEADER_LENGTH];
- int ret = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, header,
- DTLS1_HM_HEADER_LENGTH, 0);
+ int ret = dtls1_read_bytes(s, SSL3_RT_HANDSHAKE, header,
+ DTLS1_HM_HEADER_LENGTH, 0);
if (ret <= 0) {
return ret;
}
@@ -533,8 +532,8 @@ static int dtls1_process_fragment(SSL *s) {
assert(msg_len > 0);
/* Read the body of the fragment. */
- ret = s->method->ssl_read_bytes(
- s, SSL3_RT_HANDSHAKE, frag->fragment + frag_off, frag_len, 0);
+ ret = dtls1_read_bytes(s, SSL3_RT_HANDSHAKE, frag->fragment + frag_off,
+ frag_len, 0);
if (ret != frag_len) {
OPENSSL_PUT_ERROR(SSL, dtls1_process_fragment, SSL_R_UNEXPECTED_MESSAGE);
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE);