summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-02-01 15:30:37 +0000
committerMatt Caswell <matt@openssl.org>2015-03-26 13:53:07 +0000
commit92ffa83d8b5bb9ba9d56a8e321d5924956a0bbe4 (patch)
tree49d52d6436d880481277fd249377c9ed715d3d19
parentcd986e55865987c95bb89bd48b0ea1b0d7422860 (diff)
Encapsulate s->s3->wrec
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r--ssl/d1_pkt.c2
-rw-r--r--ssl/record/rec_layer.h1
-rw-r--r--ssl/s3_enc.c4
-rw-r--r--ssl/s3_lib.c2
-rw-r--r--ssl/s3_pkt.c4
-rw-r--r--ssl/t1_enc.c4
6 files changed, 9 insertions, 8 deletions
diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index 69a2467e0e..fbfc7232df 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -1468,7 +1468,7 @@ int do_dtls1_write(SSL *s, int type, const unsigned char *buf,
if (len == 0 && !create_empty_fragment)
return 0;
- wr = &(s->s3->wrec);
+ wr = RECORD_LAYER_get_wrec(&s->rlayer);
sess = s->session;
if ((sess == NULL) ||
diff --git a/ssl/record/rec_layer.h b/ssl/record/rec_layer.h
index 3a04b170ee..786d1a1623 100644
--- a/ssl/record/rec_layer.h
+++ b/ssl/record/rec_layer.h
@@ -133,3 +133,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)
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index b36aca8891..19cd49a85e 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -500,7 +500,7 @@ int ssl3_enc(SSL *s, int send)
if (send) {
ds = s->enc_write_ctx;
- rec = &(s->s3->wrec);
+ rec = RECORD_LAYER_get_wrec(&s->rlayer);
if (s->enc_write_ctx == NULL)
enc = NULL;
else
@@ -725,7 +725,7 @@ int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
int t;
if (send) {
- rec = &(ssl->s3->wrec);
+ rec = RECORD_LAYER_get_wrec(&ssl->rlayer);
mac_sec = &(ssl->s3->write_mac_secret[0]);
seq = &(ssl->s3->write_sequence[0]);
hash = ssl->write_hash;
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 825abedd54..eaa15ba863 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -3112,7 +3112,7 @@ int ssl3_new(SSL *s)
goto err;
memset(s3, 0, sizeof *s3);
s->s3 = s3;
- memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num));
+ SSL3_RECORD_clear(RECORD_LAYER_get_wrec(&s->rlayer));
#ifndef OPENSSL_NO_SRP
if(!SSL_SRP_CTX_init(s))
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index b86ee1e5cf..1ec76664be 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -619,7 +619,7 @@ int ssl3_do_compress(SSL *ssl)
int i;
SSL3_RECORD *wr;
- wr = &(ssl->s3->wrec);
+ wr = RECORD_LAYER_get_wrec(&ssl->rlayer);
i = COMP_compress_block(ssl->compress, wr->data,
SSL3_RT_MAX_COMPRESSED_LENGTH,
wr->input, (int)wr->length);
@@ -900,7 +900,7 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
if (len == 0 && !create_empty_fragment)
return 0;
- wr = &(s->s3->wrec);
+ wr = RECORD_LAYER_get_wrec(&s->rlayer);
sess = s->session;
if ((sess == NULL) ||
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index 70ea6c0796..9f876b4745 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -749,7 +749,7 @@ int tls1_enc(SSL *s, int send)
OPENSSL_assert(n >= 0);
}
ds = s->enc_write_ctx;
- rec = &(s->s3->wrec);
+ rec = RECORD_LAYER_get_wrec(&s->rlayer);
if (s->enc_write_ctx == NULL)
enc = NULL;
else {
@@ -971,7 +971,7 @@ int tls1_mac(SSL *ssl, unsigned char *md, int send)
int t;
if (send) {
- rec = &(ssl->s3->wrec);
+ rec = RECORD_LAYER_get_wrec(&ssl->rlayer);
seq = &(ssl->s3->write_sequence[0]);
hash = ssl->write_hash;
} else {