Move s->s3->wrec to s>rlayer>wrec
authorMatt Caswell <matt@openssl.org>
Sun, 1 Feb 2015 15:41:06 +0000 (15:41 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 26 Mar 2015 13:53:07 +0000 (13:53 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl/record/rec_layer.h
ssl/s3_lib.c
ssl/ssl_lib.c
ssl/ssl_locl.h

index 786d1a162349be71a5d28ee3be3aa4f89f60b405..3f63fac82e729c651b361db205ecaa9e7e2a017c 100644 (file)
@@ -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)
index eaa15ba8638d4720daca8264c72862c08911c493..6066c7807d8715e8eb6e28210733537384b31354 100644 (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_wrec(&s->rlayer));
     
 #ifndef OPENSSL_NO_SRP
     if(!SSL_SRP_CTX_init(s))
index 0483220f288f17c42047f70b0d1fe5eea873a1f7..727f91305fbfd8608c1f7424c0b8a44176358131 100644 (file)
@@ -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();
index 5deec91a3a5b3d5792f19bef56c186260a330a2a..04261906ec1a421fd374c08b8a85b61fef5e0588 100644 (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 wrec;           /* goes out from here */
     /*
      * storage for Alert/Handshake protocol data received but not yet
      * processed by ssl3_read_bytes: