From: Matt Caswell Date: Sun, 1 Feb 2015 15:41:06 +0000 (+0000) Subject: Move s->s3->wrec to s>rlayer>wrec X-Git-Tag: OpenSSL_1_1_0-pre1~1428 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e08d4a84c5935667ae266008174565b3ba39b58;p=openssl Move s->s3->wrec to s>rlayer>wrec Reviewed-by: Richard Levitte --- diff --git a/ssl/record/rec_layer.h b/ssl/record/rec_layer.h index 786d1a1623..3f63fac82e 100644 --- a/ssl/record/rec_layer.h +++ b/ssl/record/rec_layer.h @@ -125,6 +125,8 @@ typedef struct record_layer_st { SSL3_BUFFER wbuf; /* each decoded record goes in here */ SSL3_RECORD rrec; + /* goes out from here */ + SSL3_RECORD wrec; } RECORD_LAYER; #define RECORD_LAYER_set_ssl(rl, s) ((rl)->s = (s)) @@ -133,4 +135,4 @@ typedef struct record_layer_st { #define RECORD_LAYER_get_rbuf(rl) (&(rl)->rbuf) #define RECORD_LAYER_get_wbuf(rl) (&(rl)->wbuf) #define RECORD_LAYER_get_rrec(rl) (&(rl)->rrec) -#define RECORD_LAYER_get_wrec(rl) (&(rl)->s->s3->wrec) +#define RECORD_LAYER_get_wrec(rl) (&(rl)->wrec) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index eaa15ba863..6066c7807d 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -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_wrec(&s->rlayer)); #ifndef OPENSSL_NO_SRP if(!SSL_SRP_CTX_init(s)) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 0483220f28..727f91305f 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -304,6 +304,7 @@ SSL *SSL_new(SSL_CTX *ctx) RECORD_LAYER_set_ssl(&s->rlayer, s); SSL3_RECORD_clear(RECORD_LAYER_get_rrec(&s->rlayer)); + SSL3_RECORD_clear(RECORD_LAYER_get_wrec(&s->rlayer)); #ifndef OPENSSL_NO_KRB5 s->kssl_ctx = kssl_ctx_new(); diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 5deec91a3a..04261906ec 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -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 wrec; /* goes out from here */ /* * storage for Alert/Handshake protocol data received but not yet * processed by ssl3_read_bytes: