diff options
author | Matt Caswell <matt@openssl.org> | 2015-01-30 16:05:47 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-26 13:53:07 +0000 |
commit | db9a32e7193ef5841e5a021061237b8b24f68126 (patch) | |
tree | d9c90fb8f825f4e920297f38bfdf9db5e6a57c37 /ssl/s3_lib.c | |
parent | 33d23b87a0d06bc497a13b1998737a1ce469a785 (diff) |
Encapsulate access to s->s3->wbuf
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 2097b79358..28eccb4ea0 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3131,7 +3131,7 @@ void ssl3_free(SSL *s) return; ssl3_cleanup_key_block(s); - if (s->s3->wbuf.buf != NULL) + if (SSL3_BUFFER_is_initialised(RECORD_LAYER_get_wbuf(&s->rlayer))) ssl3_release_write_buffer(s); if (s->s3->rrec.comp != NULL) OPENSSL_free(s->s3->rrec.comp); @@ -3188,8 +3188,8 @@ void ssl3_clear(SSL *s) # endif /* !OPENSSL_NO_EC */ #endif /* !OPENSSL_NO_TLSEXT */ - wp = s->s3->wbuf.buf; - wlen = s->s3->wbuf.len; + wp = SSL3_BUFFER_get_buf(RECORD_LAYER_get_wbuf(&s->rlayer)); + wlen = SSL3_BUFFER_get_len(RECORD_LAYER_get_wbuf(&s->rlayer)); init_extra = s->s3->init_extra; BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; @@ -3203,8 +3203,8 @@ void ssl3_clear(SSL *s) } #endif memset(s->s3, 0, sizeof *s->s3); - s->s3->wbuf.buf = wp; - s->s3->wbuf.len = wlen; + SSL3_BUFFER_set_buf(RECORD_LAYER_get_wbuf(&s->rlayer), wp); + SSL3_BUFFER_set_len(RECORD_LAYER_get_wbuf(&s->rlayer), wlen); s->s3->init_extra = init_extra; ssl_free_wbio_buffer(s); @@ -4488,8 +4488,9 @@ int ssl3_renegotiate_check(SSL *s) int ret = 0; if (s->s3->renegotiate) { - if ((SSL3_BUFFER_get_left(RECORD_LAYER_get_rbuf(&s->rlayer)) == 0) && - (s->s3->wbuf.left == 0) && !SSL_in_init(s)) { + if ((SSL3_BUFFER_get_left(RECORD_LAYER_get_rbuf(&s->rlayer)) == 0) + && (SSL3_BUFFER_get_left(RECORD_LAYER_get_wbuf(&s->rlayer)) == 0) + && !SSL_in_init(s)) { /* * if we are the server, and we have sent a 'RENEGOTIATE' * message, we need to go to SSL_ST_ACCEPT. |