Remove RECORD_LAYER_set_ssl and introduce RECORD_LAYER_init
authorMatt Caswell <matt@openssl.org>
Mon, 2 Feb 2015 13:57:12 +0000 (13:57 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 26 Mar 2015 15:01:59 +0000 (15:01 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl/record/rec_layer.h
ssl/record/s3_pkt.c
ssl/ssl_lib.c

index 4d91476d4e74df7cab7a9ee4fe35c2cfebf4faac..a4f0eb837cb7c7686a9e470a48968aad051eb34d 100644 (file)
@@ -158,7 +158,6 @@ typedef struct record_layer_st {
  *                                                                           *
  *****************************************************************************/
 
-#define RECORD_LAYER_set_ssl(rl, s)             ((rl)->s = (s))
 #define RECORD_LAYER_set_read_ahead(rl, ra)     ((rl)->read_ahead = (ra))
 #define RECORD_LAYER_get_read_ahead(rl)         ((rl)->read_ahead)
 #define RECORD_LAYER_get_rbuf(rl)               (&(rl)->rbuf)
@@ -166,6 +165,7 @@ typedef struct record_layer_st {
 #define RECORD_LAYER_get_rrec(rl)               (&(rl)->rrec)
 #define RECORD_LAYER_get_wrec(rl)               (&(rl)->wrec)
 
+void RECORD_LAYER_init(RECORD_LAYER *rl, SSL *s);
 void RECORD_LAYER_clear(RECORD_LAYER *rl);
 void RECORD_LAYER_release(RECORD_LAYER *rl);
 int RECORD_LAYER_read_pending(RECORD_LAYER *rl);
index 376697f744c150958763ec6c0dbd05cc379b284c..0695d813b18bb42868639e136ec6c3036c7dc4b6 100644 (file)
 # define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0
 #endif
 
+void RECORD_LAYER_init(RECORD_LAYER *rl, SSL *s)
+{
+    rl->s = s;
+    SSL3_RECORD_clear(&rl->rrec);
+    SSL3_RECORD_clear(&rl->wrec);
+}
+
 void RECORD_LAYER_clear(RECORD_LAYER *rl)
 {
     unsigned char *rp, *wp;
index 9a29d9c60a6c0c5659651044e4b30c037f79b9db..892f2e3383f2339e4960b1de89635efbb54acff1 100644 (file)
@@ -282,9 +282,7 @@ SSL *SSL_new(SSL_CTX *ctx)
         goto err;
     memset(s, 0, sizeof(SSL));
 
-    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));
+    RECORD_LAYER_init(&s->rlayer, s);
 
 #ifndef OPENSSL_NO_KRB5
     s->kssl_ctx = kssl_ctx_new();