diff options
author | Matt Caswell <matt@openssl.org> | 2015-01-30 14:57:54 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-26 13:53:07 +0000 |
commit | 28d59af8740680c89e22ac19304457f2163e4371 (patch) | |
tree | e0b10c2bf091e6fa6ef824141837bba5803d59ee /ssl/s23_clnt.c | |
parent | 52e1d7b152a92d4fc2c3704a0129ec0ee0ce5e21 (diff) |
Encapsulate SSL3_BUFFER and all access to s->s3->rbuf.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/s23_clnt.c')
-rw-r--r-- | ssl/s23_clnt.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c index 3451b7c1ef..abefcaa0ef 100644 --- a/ssl/s23_clnt.c +++ b/ssl/s23_clnt.c @@ -481,7 +481,7 @@ static int ssl23_client_hello(SSL *s) static int ssl23_get_server_hello(SSL *s) { - char buf[8]; + unsigned char buf[8]; unsigned char *p; int i; int n; @@ -575,13 +575,11 @@ static int ssl23_get_server_hello(SSL *s) */ s->rstate = SSL_ST_READ_HEADER; s->packet_length = n; - if (s->s3->rbuf.buf == NULL) + if (!SSL3_BUFFER_is_initialised(RECORD_LAYER_get_rbuf(&s->rlayer))) if (!ssl3_setup_read_buffer(s)) goto err; - s->packet = &(s->s3->rbuf.buf[0]); - memcpy(s->packet, buf, n); - s->s3->rbuf.left = n; - s->s3->rbuf.offset = 0; + s->packet = SSL3_BUFFER_get_buf(RECORD_LAYER_get_rbuf(&s->rlayer)); + SSL3_BUFFER_set_data(RECORD_LAYER_get_rbuf(&s->rlayer), buf, n); s->handshake_func = s->method->ssl_connect; } else { |