diff options
author | Matt Caswell <matt@openssl.org> | 2015-02-02 13:57:12 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-26 15:01:59 +0000 |
commit | c036e210f3339fc30fa88da4bd78753c6e643eaa (patch) | |
tree | 7d27723c8b00dcc61fb9c573b00b2e03a522c71c | |
parent | bbcd6d7fe263361f18060c40cac676d6a6193ead (diff) |
Remove RECORD_LAYER_set_ssl and introduce RECORD_LAYER_init
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r-- | ssl/record/rec_layer.h | 2 | ||||
-rw-r--r-- | ssl/record/s3_pkt.c | 7 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/ssl/record/rec_layer.h b/ssl/record/rec_layer.h index 4d91476d4e..a4f0eb837c 100644 --- a/ssl/record/rec_layer.h +++ b/ssl/record/rec_layer.h @@ -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); diff --git a/ssl/record/s3_pkt.c b/ssl/record/s3_pkt.c index 376697f744..0695d813b1 100644 --- a/ssl/record/s3_pkt.c +++ b/ssl/record/s3_pkt.c @@ -132,6 +132,13 @@ # 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; diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 9a29d9c60a..892f2e3383 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -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(); |