Clean up reset of read/write sequences
authorMatt Caswell <matt@openssl.org>
Wed, 26 Aug 2015 15:22:45 +0000 (16:22 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 26 Aug 2015 15:22:45 +0000 (16:22 +0100)
Use sizeof instead of an explicit size, and use the functions for the
purpose.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/record/rec_layer_s3.c

index 5b28663..6beb8ce 100644 (file)
@@ -166,8 +166,8 @@ void RECORD_LAYER_clear(RECORD_LAYER *rl)
     SSL3_RECORD_clear(&rl->rrec);
     SSL3_RECORD_clear(&rl->wrec);
 
-    memset(rl->read_sequence, 0, sizeof(rl->read_sequence));
-    memset(rl->write_sequence, 0, sizeof(rl->write_sequence));
+    RECORD_LAYER_reset_read_sequence(rl);
+    RECORD_LAYER_reset_write_sequence(rl);
     
     if (rl->d)
         DTLS_RECORD_LAYER_clear(rl);
@@ -219,12 +219,12 @@ void RECORD_LAYER_dup(RECORD_LAYER *dst, RECORD_LAYER *src)
 
 void RECORD_LAYER_reset_read_sequence(RECORD_LAYER *rl)
 {
-    memset(rl->read_sequence, 0, 8);
+    memset(rl->read_sequence, 0, sizeof(rl->read_sequence));
 }
 
 void RECORD_LAYER_reset_write_sequence(RECORD_LAYER *rl)
 {
-    memset(rl->write_sequence, 0, 8);
+    memset(rl->write_sequence, 0, sizeof(rl->write_sequence));
 }
 
 int RECORD_LAYER_setup_comp_buffer(RECORD_LAYER *rl)