Move s->s3->rrec to s->rlayer->rrec

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Matt Caswell 2015-01-30 23:27:17 +00:00
parent 258f8721a5
commit cd986e5586
4 changed files with 5 additions and 4 deletions

View file

@ -123,6 +123,8 @@ typedef struct record_layer_st {
SSL3_BUFFER rbuf;
/* write IO goes into here */
SSL3_BUFFER wbuf;
/* each decoded record goes in here */
SSL3_RECORD rrec;
} RECORD_LAYER;
#define RECORD_LAYER_set_ssl(rl, s) ((rl)->s = (s))
@ -130,4 +132,4 @@ typedef struct record_layer_st {
#define RECORD_LAYER_get_read_ahead(rl) ((rl)->read_ahead)
#define RECORD_LAYER_get_rbuf(rl) (&(rl)->rbuf)
#define RECORD_LAYER_get_wbuf(rl) (&(rl)->wbuf)
#define RECORD_LAYER_get_rrec(rl) (&(rl)->s->s3->rrec)
#define RECORD_LAYER_get_rrec(rl) (&(rl)->rrec)

View file

@ -3112,7 +3112,6 @@ int ssl3_new(SSL *s)
goto err;
memset(s3, 0, sizeof *s3);
s->s3 = s3;
SSL3_RECORD_clear(RECORD_LAYER_get_rrec(&s->rlayer));
memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num));
#ifndef OPENSSL_NO_SRP
@ -3131,7 +3130,6 @@ void ssl3_free(SSL *s)
return;
ssl3_cleanup_key_block(s);
SSL3_RECORD_release(RECORD_LAYER_get_rrec(&s->rlayer));
#ifndef OPENSSL_NO_DH
DH_free(s->s3->tmp.dh);
#endif

View file

@ -303,6 +303,7 @@ SSL *SSL_new(SSL_CTX *ctx)
memset(s, 0, sizeof(SSL));
RECORD_LAYER_set_ssl(&s->rlayer, s);
SSL3_RECORD_clear(RECORD_LAYER_get_rrec(&s->rlayer));
#ifndef OPENSSL_NO_KRB5
s->kssl_ctx = kssl_ctx_new();
@ -625,6 +626,7 @@ void SSL_free(SSL *s)
ssl3_release_read_buffer(s);
if (SSL3_BUFFER_is_initialised(RECORD_LAYER_get_wbuf(&s->rlayer)))
ssl3_release_write_buffer(s);
SSL3_RECORD_release(RECORD_LAYER_get_rrec(&s->rlayer));
if (s->ctx)
SSL_CTX_free(s->ctx);

View file

@ -1241,7 +1241,6 @@ typedef struct ssl3_state_st {
int empty_fragment_done;
/* The value of 'extra' when the buffers were initialized */
int init_extra;
SSL3_RECORD rrec; /* each decoded record goes in here */
SSL3_RECORD wrec; /* goes out from here */
/*
* storage for Alert/Handshake protocol data received but not yet